[android-developers] Re: Build of Studio app from command line fails with weird exceptions and then hangs forever

2016-08-06 Thread David Karr
Oh, and if it isn't obvious from my other post at about the same time, I 
currently have Android Studio version 1.5.1.

On Saturday, August 6, 2016 at 9:54:25 AM UTC-7, David Karr wrote:
>
> I occasionally bring up Studio to work on a personal project. It was 
> basically working at one point, at least it appears to be built in Studio.  
> I decided I wanted to try to build it from the command line.  From what I 
> understand, this just requires "./gradlew assemble".
>
> This produced the following (truncated) output:
> :Application:preBuild UP-TO-DATE
> ...
> :Application:generateReleaseResources UP-TO-DATE
> :Application:mergeReleaseResourcesjava.io.IOException: Cannot run program 
> "/Android/Sdk/build-tools/23.0.2/aapt": error=2, No such file or 
> directory
> at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
> at com.android.builder.png.AaptProcess$Builder.start(AaptProcess.java:
> 154)
> at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.
> java:105)
> at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:204)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.io.IOException: error=2, No such file or directory
> at java.lang.UNIXProcess.forkAndExec(Native Method)
> at java.lang.UNIXProcess.(UNIXProcess.java:248)
> at java.lang.ProcessImpl.start(ProcessImpl.java:134)
> at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
> ... 4 more
>
> That stacktrace repeated 20 more times after this, and then it just sat 
> there. It didn't complete, just hung waiting for input of some sort.  It's 
> been sitting here for the last few minutes, and I don't think it's going to 
> complete.
>
> My platform is CentOS Linux.
>
> Note that the path given above DOES exist, and is executable.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/2dd4369d-f78d-4fa8-a9ef-20832cf3d4f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Build of Studio app from command line fails with weird exceptions and then hangs forever

2016-08-06 Thread David Karr
I occasionally bring up Studio to work on a personal project. It was 
basically working at one point, at least it appears to be built in Studio.  
I decided I wanted to try to build it from the command line.  From what I 
understand, this just requires "./gradlew assemble".

This produced the following (truncated) output:
:Application:preBuild UP-TO-DATE
...
:Application:generateReleaseResources UP-TO-DATE
:Application:mergeReleaseResourcesjava.io.IOException: Cannot run program 
"/Android/Sdk/build-tools/23.0.2/aapt": error=2, No such file or 
directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at com.android.builder.png.AaptProcess$Builder.start(AaptProcess.java:
154)
at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java
:105)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:204)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.(UNIXProcess.java:248)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 4 more

That stacktrace repeated 20 more times after this, and then it just sat 
there. It didn't complete, just hung waiting for input of some sort.  It's 
been sitting here for the last few minutes, and I don't think it's going to 
complete.

My platform is CentOS Linux.

Note that the path given above DOES exist, and is executable.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/3a3dd85c-6b36-4a70-afe5-8b6a4835176e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Studio prompts me to update from 1.5.1 to 2.1.2, but the download button leads in circles

2016-08-06 Thread David Karr
My platform (right now) is CentOS Linux.

I occasionally work on a personal project in Studio.  I still find much of 
it pretty baffling after years being used to Eclipse.  In any case, when I 
brought up Studio today, it prompted me to update the version of studio.  I 
had version 1.5.1 installed, and it said that 2.1.2 was available.

I clicked the "Download" button, and that opened up my browser to 
https://sites.google.com/a/android.com/tools/download/studio/canary/latest 
, which prominently displays the download for "Latest Android Studio Canary 
Build: 2.2 Preview 7".  From what I briefly understand of "canary" builds, 
I definitely didn't want that, so I saw the links up above this and I 
clicked on "Download", which goes to a very helpful page that says "This 
page is obsolete. You're probably looking for the Android Studio Downloads 
 page."  
Great, so I clicked on that link, which goes to a page titled "Downloads & 
Preview Channels", with a first line that says "Download the official 
stable release from the Android Developer SDK 
 site."  Ok, I clicked on that 
link.

Ok, this is looking better.  Now this has a prominent button labeled 
"DOWNLOAD ANDROID STUDIO 2.1", so I clicked that.

I saw a "terms & conditions" box, followed by a checkbox to agree to that, 
and then a thin grey box below it.  I checked the checkbox, and the thin 
grey box became blue.  I guessed this is some some sort of "OK" button, but 
the text isn't displaying for some reason.  I clicked that thin button.

This sent me to https://developer.android.com/index.html . So far, no 
indication it's actually going to download anything. The closest thing I 
can see on this page is a link labeled "Get Android Studio 
", so I clicked that, 
which sent me back to https://developer.android.com/studio/index.html, with 
the same "DOWNLOAD ANDROID STUDIO 2.1" button that I saw earlier.

WTF.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/79d31ed7-aab4-47bf-a4b8-c42f2e1497b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: clone from github didn't get all the branches

2016-08-04 Thread David Karr
Never mind, I figured out how to attach the other branch.

On Thursday, August 4, 2016 at 8:26:40 PM UTC-7, David Karr wrote:
>
> I have a project on github, and my recent work is on a branch, and it's 
> all pushed to github.  I installed studio on a new box and checked out from 
> github.  What I got appears to be the master branch.  When I went to a 
> shell to look closer at the git configuration (as I can't figure out how to 
> do it in Studio), I saw that it had only the master branch.
>
> I guess I need to download the additional branch so I can switch to it.  
> This may just be a git question, but I don't know how to do this.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/89ce1f41-b4d2-414b-8077-857b5838d1e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] clone from github didn't get all the branches

2016-08-04 Thread David Karr
I have a project on github, and my recent work is on a branch, and it's all 
pushed to github.  I installed studio on a new box and checked out from 
github.  What I got appears to be the master branch.  When I went to a 
shell to look closer at the git configuration (as I can't figure out how to 
do it in Studio), I saw that it had only the master branch.

I guess I need to download the additional branch so I can switch to it.  
This may just be a git question, but I don't know how to do this.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/0b54a6b8-68d5-4fcb-a919-4c883a97b12e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How do I make my custom video app not exit when it's been idle for a while?

2016-04-15 Thread David Karr
On Thursday, April 14, 2016 at 11:28:38 PM UTC-7, gjs wrote:
>
> Hi,
>
> Take a look at 
> http://developer.android.com/training/scheduling/wakelock.html
>
> You probably also need to set the Display Sleep time in Android Settings 
> as well.
>

In my limited testing, setting the parameter in the activity seemed to do 
the trick by itself.  Thanks.
 

>
> Regards
>
> On Friday, April 15, 2016 at 12:07:03 PM UTC+10, David Karr wrote:
>>
>> I've assembled a custom video recorder app based on a common sample from 
>> Google.  You can see the entire source at 
>> https://github.com/davidmichaelkarr/android-Camera2Video/tree/refinements 
>> .
>>
>> Except for an annoyance I recently posted about here (writes zero length 
>> file in addition to valid files), it works pretty well, except for the fact 
>> that when the app sits idle for a minute or so, it seems like it just goes 
>> away.
>>
>> I imagine there's an idle timeout, perhaps related to the overall power 
>> management on the phone.
>>
>> For this particular app, when it's running, I want it to never time out.  
>> What's the best way to make that happen?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/de216046-2908-4a21-b685-0386b6a7b03a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] How do I make my custom video app not exit when it's been idle for a while?

2016-04-14 Thread David Karr
I've assembled a custom video recorder app based on a common sample from 
Google.  You can see the entire source at 
https://github.com/davidmichaelkarr/android-Camera2Video/tree/refinements .

Except for an annoyance I recently posted about here (writes zero length 
file in addition to valid files), it works pretty well, except for the fact 
that when the app sits idle for a minute or so, it seems like it just goes 
away.

I imagine there's an idle timeout, perhaps related to the overall power 
management on the phone.

For this particular app, when it's running, I want it to never time out.  
What's the best way to make that happen?

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/f30e1598-6305-4ec4-bdcd-d3bf5d844b5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Why is sample video app storing good video file and also zero-length video file?

2016-04-10 Thread David Karr
I managed to find a good video app sample at 
https://github.com/googlesamples/android-Camera2Video .  I forked this to 
make some simple utilitarian changes.  The result is functional, but not 
pretty at all.  For what I'm using it for, pretty isn't important.

My fork of this is at 
https://github.com/davidmichaelkarr/android-Camera2Video/tree/refinements 
.  I would paste some of the code from that here, but it might be more 
effective to just have you look at the code there.

What was surprising is that when I stop the video recording, it correctly 
saves the video, but when I look in the filesystem, I see both the real 
video and a zero-length video file.  The timestamp on the zero-length file 
is a few seconds later than the real video file.

I guess I understand why this is happening, but I'm not certain of the best 
way to resolve this.

The way the app is structured, the File to write the video to is set up 
when preview is initiated.  The file isn't written to unless I start 
recording video.  As a result, the file on disk is actually created when I 
start preview mode, even if I don't record a video that time that I started 
the app.

One possible strategy for cleaning up that zero-length file is somehow 
removing the file in "onPause" (or some variation of that).  Basically, to 
remove the file when I "stop using the app".

It might be cleaner to set up the file only when I start recording, but I'm 
not sure how to properly structure that to make that happen.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/33a278b0-dd08-407e-9738-251950cfe206%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Android Studio doesn't show code samples in doc tooltips

2016-03-27 Thread David Karr
I mostly use Eclipse, so there may be conventions in Android Studio that 
I'm not familiar with.

I was editing some Android code in Android Studio, and I wanted to read the 
javadoc detail for a method that's being called.  After I managed to pin 
the tooltip (is there a convenient function key like Eclipse's "F2" to 
prevent it from disappearing?) I paged through the detail, and I got to a 
block like this:

Here is an example of typical code to manipulate a picture in an 
> application's private storage and add it to the media database:
> {@sample 
> development/samples/ApiDemos/src/com/example/android/apis/content/ExternalStorage.java
>  
> * private_picture}
> Parameters:
>

If it matters, this is in the javadoc for:

> android.content.Context
> public abstract java.io.File getExternalFilesDir(java.lang.String type)


Looking further through the method javadoc, I found more of these "@sample" 
blocks that don't actually show the code.

Is there some way to have the javadoc tooltips show the code samples?

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/13c06f3b-e5f5-4c56-a32a-62187413eb56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Camcorder app produces video that is out of focus, and upside down

2016-03-26 Thread David Karr
On Friday, March 25, 2016 at 12:29:57 AM UTC-7, gjs wrote:
>
> Hi again,
>
> Well I suspect you are also getting low resolution / low quality video due 
> to missing -
>
> mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
>
>
> See http://developer.android.com/guide/topics/media/camera.html
>
>
Ok, I think this is working.  The thing seems fragile, but it appears the 
resolution is higher.  I can see the metadata now, and the resolution 
metadata is higher than it used to be, and the video looks that way.  Doing 
this without the information in that javadoc emphasizes how careful you 
have to be in the ordering of these things.  I was also getting some 
occurrences of "Method called after release()".  I looked at some of the 
fixes for this, but they also seemed unreliable.  In any case, I stopped 
seeing that error.


> - you could verify that by examining the metadata / properties of the video 
> you have already recorded.
>
>
> Regards
>
>
> On Friday, March 25, 2016 at 11:58:15 AM UTC+11, David Karr wrote:
>>
>>
>>
>> On Thursday, March 24, 2016 at 3:49:52 PM UTC-7, gjs wrote:
>>>
>>> Hi,
>>>
>>> Re -  I imagine I'm doing something horribly wrong,
>>>
>>> Well yes, particularly for this code, calling methods on a null object 
>>> ???  -
>>>
>>>  if (mCamera == null) {
>>> mCamera.setPreviewDisplay(holder); ...
>>>
>>>
>>> I'd suggest waiting a little after starting the Camera Preview before 
>>> initiating a call to autofocus, say 500ms to 1 second, this is to give the 
>>> camera some time to settle after it has just been opened.
>>>
>>>
>>> I'd also suggest that you do this asynchronously, eg -
>>>
>>>
>>> // Need handler for callbacks to the UI thread
>>> final Handler mHandler = new Handler();
>>>
>>>
>>> mHandler.postDelayed(new Runnable()
>>> {
>>>@Override
>>>public void run()
>>>{
>>>   doAutoFocus(..
>>>}
>>>  
>>> }, 500 );
>>>
>>>
>>> Regards
>>>
>>>
>> Ok, well, the good news is that doing this let it get into the callback 
>> with success == true.  And I think I saw the preview display sharpen.  
>> However, the resulting stored video seems to be the same.  It's still 
>> fuzzy. 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/f2af5403-005c-433d-beca-9af0c5af5717%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Camcorder app produces video that is out of focus, and upside down

2016-03-25 Thread David Karr
On Friday, March 25, 2016 at 12:29:57 AM UTC-7, gjs wrote:
>
> Hi again,
>
> Well I suspect you are also getting low resolution / low quality video due 
> to missing -
>
> mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
>
>
> See http://developer.android.com/guide/topics/media/camera.html
>
>
> - you could verify that by examining the metadata / properties of the video 
> you have already recorded.
>
>
And how exactly do I do that?  I found an app that shows the metadata of 
videos, and I opened one of my recorded videos with that.  It shows a 
"Properties" list, along with a "View Atom Structure" function.  How can I 
tell from this whether it's "high quality" or not? 

>
> Regards
>
>
> On Friday, March 25, 2016 at 11:58:15 AM UTC+11, David Karr wrote:
>>
>>
>>
>> On Thursday, March 24, 2016 at 3:49:52 PM UTC-7, gjs wrote:
>>>
>>> Hi,
>>>
>>> Re -  I imagine I'm doing something horribly wrong,
>>>
>>> Well yes, particularly for this code, calling methods on a null object 
>>> ???  -
>>>
>>>  if (mCamera == null) {
>>> mCamera.setPreviewDisplay(holder); ...
>>>
>>>
>>> I'd suggest waiting a little after starting the Camera Preview before 
>>> initiating a call to autofocus, say 500ms to 1 second, this is to give the 
>>> camera some time to settle after it has just been opened.
>>>
>>>
>>> I'd also suggest that you do this asynchronously, eg -
>>>
>>>
>>> // Need handler for callbacks to the UI thread
>>> final Handler mHandler = new Handler();
>>>
>>>
>>> mHandler.postDelayed(new Runnable()
>>> {
>>>@Override
>>>public void run()
>>>{
>>>   doAutoFocus(..
>>>}
>>>  
>>> }, 500 );
>>>
>>>
>>> Regards
>>>
>>>
>> Ok, well, the good news is that doing this let it get into the callback 
>> with success == true.  And I think I saw the preview display sharpen.  
>> However, the resulting stored video seems to be the same.  It's still 
>> fuzzy. 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/63682c47-6a44-45a2-9c33-a97941e4cc93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Camcorder app produces video that is out of focus, and upside down

2016-03-24 Thread David Karr


On Thursday, March 24, 2016 at 3:49:52 PM UTC-7, gjs wrote:
>
> Hi,
>
> Re -  I imagine I'm doing something horribly wrong,
>
> Well yes, particularly for this code, calling methods on a null object ??? 
>  -
>
>  if (mCamera == null) {
> mCamera.setPreviewDisplay(holder); ...
>
>
> I'd suggest waiting a little after starting the Camera Preview before 
> initiating a call to autofocus, say 500ms to 1 second, this is to give the 
> camera some time to settle after it has just been opened.
>
>
> I'd also suggest that you do this asynchronously, eg -
>
>
> // Need handler for callbacks to the UI thread
> final Handler mHandler = new Handler();
>
>
> mHandler.postDelayed(new Runnable()
> {
>@Override
>public void run()
>{
>   doAutoFocus(..
>}
>  
> }, 500 );
>
>
> Regards
>
>
Ok, well, the good news is that doing this let it get into the callback 
with success == true.  And I think I saw the preview display sharpen.  
However, the resulting stored video seems to be the same.  It's still 
fuzzy. 

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/7bd14e04-5edf-4d35-9d84-233190daaa0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Camcorder app produces video that is out of focus, and upside down

2016-03-24 Thread David Karr


On Thursday, March 24, 2016 at 3:49:52 PM UTC-7, gjs wrote:
>
> Hi,
>
> Re -  I imagine I'm doing something horribly wrong,
>
> Well yes, particularly for this code, calling methods on a null object ??? 
>  -
>
>  if (mCamera == null) {
> mCamera.setPreviewDisplay(holder); ...
>
>
*smacking oneself in head*

In reality, it didn't even matter, because it never got to that block with 
mCamera == null.  I copied this from a sample on the internet.  "It must be 
true, right?"
 

>
> I'd suggest waiting a little after starting the Camera Preview before 
> initiating a call to autofocus, say 500ms to 1 second, this is to give the 
> camera some time to settle after it has just been opened.
>
>
> I'd also suggest that you do this asynchronously, eg -
>
>
> // Need handler for callbacks to the UI thread
> final Handler mHandler = new Handler();
>
>
> mHandler.postDelayed(new Runnable()
> {
>@Override
>public void run()
>{
>   doAutoFocus(..
>}
>  
> }, 500 );
>
>
> Regards
>
>
Ok.  I'll give that a try.
 

>
>
> On Thursday, March 24, 2016 at 12:11:11 PM UTC+11, David Karr wrote:
>>
>> On Wednesday, March 23, 2016 at 12:06:47 AM UTC-7, gjs wrote:
>>
>> Hi,
>>
>> For the focus / fuzzy issue try initiating auto focusing of the camera 
>> before you start recording your video -
>>
>>
>> http://developer.android.com/reference/android/hardware/Camera.html#autoFocus(android.hardware.Camera.AutoFocusCallback)
>>
>>
>> Thanks for replying.  I imagine I'm doing something horribly wrong, but 
>> I'm not getting much from this.  I made a change in my "CameraPreview" 
>> class to add this call, in the "surfaceCreated()" method.  It now looks 
>> like this, which will immediately look odd:
>>
>> public void surfaceCreated(SurfaceHolder holder) {
>> try {
>> // create the surface and start camera preview
>> if (mCamera == null) {
>> mCamera.setPreviewDisplay(holder);
>> mCamera.startPreview();
>> mCamera.autoFocus(new Camera.AutoFocusCallback() {
>> @Override
>> public void onAutoFocus(boolean success, Camera camera) {
>> Log.d(VIEW_LOG_TAG, "Completed autofocus setup: 
>> success[" + success + "]");
>> }
>> });
>> }
>> else {
>> mCamera.setPreviewDisplay(holder);
>> mCamera.startPreview();
>> mCamera.autoFocus(new Camera.AutoFocusCallback() {
>> @Override
>> public void onAutoFocus(boolean success, Camera camera) {
>> Log.d(VIEW_LOG_TAG, "Completed autofocus setup: 
>> success[" + success + "]");
>> }
>> });
>> }
>> } catch (IOException e) {
>> Log.d(VIEW_LOG_TAG, "Error setting camera preview: " + 
>> e.getMessage());
>> }
>> }
>>
>>
>>
>>
>> Yes, I'm calling that block for both the null and !null case.  I did that 
>> because when I ran in the debugger, I saw that it never got into the "== 
>> null" block, so I'm experimenting with calling it when it's not null.  In 
>> any case, it calls the "autofocus()" method, but the "onAutoFocus()" method 
>> is never called.  At one point when it retrieves the "Camera.Parameters" 
>> object, I added a log statement for "focusMode", and it prints "auto".  And 
>> it doesn't appear to be focusing.
>>  
>>
>>
>> - you can also do this whilst the video is recording as well, although 
>> you will have periods of a few seconds where focus is lost before being 
>> regained.
>>
>> Note sure about upside down video, I suspect this not the video recording 
>> but perhaps some Camera Preview rotation mismatch / issue in your 
>> CameraPreview class ? Compare the Camera Preview orientation in your app 
>> vs when you use the default Camera App. (NOTE also that Nexus 5X has some 
>> wrong camera preview orientation issues...)
>>
>> Regards
>>
>>
>>
>> On Wednesday, March 23, 2016 at 3:41:02 PM UTC+11, David Karr wrote:
>>
>> I've assembled a relatively small camcorder app. It only does what I need 
>> it to do.  I assembled it from sample code, and some people on this forum 
>> have helped me fix some of the problems with it, a

[android-developers] Re: Camcorder app produces video that is out of focus, and upside down

2016-03-23 Thread David Karr
On Wednesday, March 23, 2016 at 12:06:47 AM UTC-7, gjs wrote:
>
> Hi,
>
> For the focus / fuzzy issue try initiating auto focusing of the camera 
> before you start recording your video -
>
>
> http://developer.android.com/reference/android/hardware/Camera.html#autoFocus(android.hardware.Camera.AutoFocusCallback)
>

Thanks for replying.  I imagine I'm doing something horribly wrong, but I'm 
not getting much from this.  I made a change in my "CameraPreview" class to 
add this call, in the "surfaceCreated()" method.  It now looks like this, 
which will immediately look odd:

public void surfaceCreated(SurfaceHolder holder) {
try {
// create the surface and start camera preview
if (mCamera == null) {
mCamera.setPreviewDisplay(holder);
mCamera.startPreview();
mCamera.autoFocus(new Camera.AutoFocusCallback() {
@Override
public void onAutoFocus(boolean success, Camera camera) {
Log.d(VIEW_LOG_TAG, "Completed autofocus setup: success[" + 
success + "]");
}
});
}
else {
mCamera.setPreviewDisplay(holder);
mCamera.startPreview();
mCamera.autoFocus(new Camera.AutoFocusCallback() {
@Override
public void onAutoFocus(boolean success, Camera camera) {
Log.d(VIEW_LOG_TAG, "Completed autofocus setup: success[" + 
success + "]");
}
});
}
} catch (IOException e) {
Log.d(VIEW_LOG_TAG, "Error setting camera preview: " + e.getMessage());
}
}




Yes, I'm calling that block for both the null and !null case.  I did that 
because when I ran in the debugger, I saw that it never got into the "== 
null" block, so I'm experimenting with calling it when it's not null.  In 
any case, it calls the "autofocus()" method, but the "onAutoFocus()" method 
is never called.  At one point when it retrieves the "Camera.Parameters" 
object, I added a log statement for "focusMode", and it prints "auto".  And 
it doesn't appear to be focusing.
 

>
> - you can also do this whilst the video is recording as well, although you 
> will have periods of a few seconds where focus is lost before being 
> regained.
>
> Note sure about upside down video, I suspect this not the video recording 
> but perhaps some Camera Preview rotation mismatch / issue in your 
> CameraPreview class ? Compare the Camera Preview orientation in your app 
> vs when you use the default Camera App. (NOTE also that Nexus 5X has some 
> wrong camera preview orientation issues...)
>
> Regards
>
>
>
> On Wednesday, March 23, 2016 at 3:41:02 PM UTC+11, David Karr wrote:
>
> I've assembled a relatively small camcorder app. It only does what I need 
> it to do.  I assembled it from sample code, and some people on this forum 
> have helped me fix some of the problems with it, although some of the 
> details of interfacing with the camera are beyond me.
>
> After some usage of it, I've realized there are two problems with it:
>
> * Although the preview display is right-side up, the resulting stored 
> video is upside down.  This isn't a huge deal, as I later process this with 
> another app that lets me rotate it till its right-side up, but it's still 
> an annoyance, especially when previewing many videos to see which ones I 
> want to use.
>
> * The video it produces is just fuzzy, or out of focus.  I don't know 
> whether this is the nature of video vs. still images or whether I'm not 
> doing something I should be doing.  Is there some autofocus feature of the 
> camcorder that I'm not taking advantage of?
>
> I'd appreciate any useful advice on this.
>
> I'll provide here the entire Activity class.
>
> package com.integralsoftware.videograbber;
>
> import android.content.Intent;
> import android.media.AudioFormat;
> import android.media.AudioManager;
> import android.media.AudioTrack;
> import android.media.MediaScannerConnection;
> import android.net.Uri;
> import android.os.Bundle;
> import android.os.Environment;
> import android.util.Log;
> import android.view.View;
>
> import java.io.File;
> import java.io.IOException;
> import java.text.SimpleDateFormat;
> import java.util.Date;
>
> import android.app.Activity;
> import android.content.Context;
> import android.content.pm.PackageManager;
> import android.hardware.Camera;
> import android.hardware.Camera.CameraInfo;
> import android.media.MediaRecorder;
> import android.view.View.OnClickListener;
> import android.view.WindowManager;
> import android.view.animation.AlphaAnimation;
&g

[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-31 Thread David Karr
A negative confirmation is better than nothing, so thanks for that.  At 
least I don't have to try any more variations of the scanner code.

On Tuesday, December 29, 2015 at 12:17:23 AM UTC-8, gjs wrote:
>
> Hi,
>
> I don't think you'll get the confirmation you are seeking, but here's what 
> I think is currently happening.
>
> (1) The (Google) Gallery app is no more, now being replaced by the 
> (Google) Photos app.
>
> (2) Currently the (Google) Photos app appears to ignore the 
> MediaScannerConnection calls and / or does not query the associated Media 
> repository (/database) where media metadata is cataloged nor listen or act 
> on any associated Content Providers etc.
>
> (3) The (Google) Photos app currently seems heavily invested in using 
> (Google) cloud storage to backup and sync all your photos from all your 
> devices mobile & desktop. From some tests undertaken just now I've found 
> that photos from third party app won't show up in the (Google) Photos app 
> unless you explicitly turn on sync'ing and backup (via its settings) 
> and explicitly select your third party app media folder(s). You 
> won't necessarily see photos taken very recently (with 3rd party app) in 
> the main photo view and you might see these in the Device Folders view (on 
> some devices), eg: I can see a recent photo taken on a Nexus 6P, but I 
> can't yet on an Xperia Z5.
>
> (4) The (Google) Photos app is overly ambitious(?) with many moving parts, 
> seeking to do all sorts of things, grouping stories, show what you were 
> doing on this day in previous years etc etc etc, but can't get the basics 
> to work *reliably* such as show all photos on the device, sharing & getting 
> sync'ing to work consistently, (unless perhaps you only use the default 
> camera app). On the Xperia Z5 sharing a photos currently crashes 
> the (Google) Photos app... The help suggests things like turning off 
> syncing and turning it back on again when it's not working...
>
> (5) Google has a habit of consistently changing the Photos apps every few 
> months or so both on mobile and on the web, so what might work now it bound 
> to change and be broken again in future.
>
> (6) If you want to be certain that photos, videos captured with you app 
> are present on the device then you need to provide you own viewer activity 
> of some sort as previously suggest, or else be willing to help your users 
> get the (Google) Photos app configured to find photos, video created with 
> your app and be ready to do that all over again with next the (Google) 
> Photo app updates.
>
> Regards
>
>
> On Tuesday, December 29, 2015 at 6:37:32 AM UTC+11, David Karr wrote:
>>
>> I'm still hoping to get some help with this.  I've made no progress on 
>> this.
>>
>> I've yet to get any confirmation that something like this can even do 
>> what I think it's supposed to do, which is make videos recorded by a custom 
>> app be visible by the "Photos" or "Gallery" app, as if they were recorded 
>> by the stock app.  What I've read implies that this will happen, but I've 
>> yet to have this confirmed.
>>
>> The versions of this that I've tried both call the "completed" callback 
>> (except for the simple "sendBroadcast" variation), but that's the only 
>> indication I get that the process did anything.  Despite the "completed" 
>> callback being called, the recorded videos are never visible in the 
>> "Photos" or "Gallery" app.
>>
>> On Saturday, December 19, 2015 at 9:58:02 AM UTC-8, David Karr wrote:
>>>
>>> Because I can't bring up the stock camera app with just a video 
>>> record/stop button (I'm using a remote bluetooth button to start/stop 
>>> recording), I've written a custom app that just displays the camera preview 
>>> and a video record/stop button.
>>>
>>> Despite the fact that this is a custom app, as much as possible I'd like 
>>> to store the videos as if they were taken with the stock app.  This at 
>>> least means storing them in the same place, with a consistent naming and 
>>> metadata scheme.  I might consider having custom preferences in the app, 
>>> but for now I'd just like to retrieve properties that will tell me where 
>>> the stock camera app will store videos, along with any other configuration 
>>> that should describe how I store the videos.
>>>
>>> How can I get this information within my custom app?
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/997d84fa-9d06-4bab-a7ac-8b050d3d9ccc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-28 Thread David Karr
I'm still hoping to get some help with this.  I've made no progress on this.

I've yet to get any confirmation that something like this can even do what 
I think it's supposed to do, which is make videos recorded by a custom app 
be visible by the "Photos" or "Gallery" app, as if they were recorded by 
the stock app.  What I've read implies that this will happen, but I've yet 
to have this confirmed.

The versions of this that I've tried both call the "completed" callback 
(except for the simple "sendBroadcast" variation), but that's the only 
indication I get that the process did anything.  Despite the "completed" 
callback being called, the recorded videos are never visible in the 
"Photos" or "Gallery" app.

On Saturday, December 19, 2015 at 9:58:02 AM UTC-8, David Karr wrote:
>
> Because I can't bring up the stock camera app with just a video 
> record/stop button (I'm using a remote bluetooth button to start/stop 
> recording), I've written a custom app that just displays the camera preview 
> and a video record/stop button.
>
> Despite the fact that this is a custom app, as much as possible I'd like 
> to store the videos as if they were taken with the stock app.  This at 
> least means storing them in the same place, with a consistent naming and 
> metadata scheme.  I might consider having custom preferences in the app, 
> but for now I'd just like to retrieve properties that will tell me where 
> the stock camera app will store videos, along with any other configuration 
> that should describe how I store the videos.
>
> How can I get this information within my custom app?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/2dc51302-2247-43b2-8577-2771956a02ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-23 Thread David Karr
On Tuesday, December 22, 2015 at 10:33:17 AM UTC-8, David Karr wrote:
>
> On Tuesday, December 22, 2015 at 12:49:55 AM UTC-8, gjs wrote:
>>
>> Hi,
>>
>> MediaScannerConnection scanFile() (& the equivalent Intent), is just a 
>> request to the OS, it does provide an on completion listener to let you 
>> know when it is finished the request, but that doesn't necessarily mean it 
>> actually or immediately performs the 'scanning' for you request, it might 
>> defer or ignore it. (Once upon a time it did scan when requested, but you'd 
>> need to read recent Android OS Source code / Photos app source code to be 
>> certain).
>>
>> Proving your own media viewer activity or using an Intent to open the 
>> media file or showing the image capture briefly or as a thumbnail is 
>> usually what done to provide immediate feedback.
>>
>
> My intention was to do something that would make the "Photos" app see my 
> stored videos.  This (MediaScannerConnection) doesn't appear to be doing 
> it, and I haven't seen any real confirmation that it's even supposed to do 
> it.  What is the point of doing this?  I'm going to guess that if I just 
> change the subdir name I write to to "Camera", then "Photos" will see my 
> videos.
>

Unfortunately,  my guess was wrong.  I changed  the subdir from the custom 
name for my app to "Camera".  It stored the video in that folder, along 
with the pictures and videos from the stock app, but the videos from my 
custom app are still not visible in the Photos or Gallery app.

I've tried both the "sendBroadcast" and more verbose 
"MediaScannerConnection.scanFile()" approach.  Neither of these fail, and 
the latter does call the "onScanCompleted" callback, but neither of these 
seem to do anything.

Any ideas?

 
>
>>
>> Regards
>>
>>
>> On Tuesday, December 22, 2015 at 5:29:36 AM UTC+11, David Karr wrote:
>>>
>>> On Monday, December 21, 2015 at 12:08:57 AM UTC-8, gjs wrote:
>>>>
>>>> Hi,
>>>>
>>>> If your phone is not a Google Nexus variety then that's not surprising, 
>>>> but Environment.getExternalStoragePublicDirectory(Environment.
>>>> DIRECTORY_DCIM) is what's recommended.
>>>>
>>>> In some respects it does not really matter which folder you use to 
>>>> store media generated by your app (*), provided you go to the trouble of 
>>>> 'cataloging' the media generated using MediaScannerConnection - 
>>>> http://developer.android.com/reference/android/media/MediaScannerConnection.html#scanFile(android.content.Context,
>>>>  
>>>> java.lang.String[], java.lang.String[], 
>>>> android.media.MediaScannerConnection.OnScanCompletedListener) then your 
>>>> photos / video will quickly show up in the default 'Photos' app, without 
>>>> having to wait for it to scan the device periodically to find new media 
>>>> files.
>>>>
>>>> (*) And is some other respects it really, really does matter what 
>>>> folder you use - if you don't want the media files deleted when your app 
>>>> in 
>>>> uninstalled (!) Be very careful about what you decide, here's some 
>>>> 'interesting' history - 
>>>> https://groups.google.com/forum/#!topic/android-platform/14VUiIgwUjY%5B1-25%5D
>>>>
>>>> Regards
>>>>
>>>>
>>> Ok, following this information and some other advice (I created a custom 
>>> subdir of "DCIM" for my app), I ended up with the following:
>>>
>>> sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, 
>>> Uri.parse("file://" + outputFilePath)));
>>>
>>>
>>>  The problem is, it's not clear to me that this is doing anything.  
>>> After storing one of these and calling this, I exit my app and run the 
>>> Photos app, and the new video is not shown there.  I've verified that the 
>>> video is stored and viewable.
>>>
>>> On Monday, December 21, 2015 at 5:53:49 AM UTC+11, David Karr wrote:
>>>>>
>>>>> On Saturday, December 19, 2015 at 10:34:46 PM UTC-8, gjs wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> See 
>>>>>> http://developer.android.com/reference/android/os/Environment.html 
>>>>>> it has methods to retrieve default paths of where photo, video files etc 
>>>>>> are stored.
>>>>>>
>>>>>> The file naming con

[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-22 Thread David Karr
On Tuesday, December 22, 2015 at 12:49:55 AM UTC-8, gjs wrote:
>
> Hi,
>
> MediaScannerConnection scanFile() (& the equivalent Intent), is just a 
> request to the OS, it does provide an on completion listener to let you 
> know when it is finished the request, but that doesn't necessarily mean it 
> actually or immediately performs the 'scanning' for you request, it might 
> defer or ignore it. (Once upon a time it did scan when requested, but you'd 
> need to read recent Android OS Source code / Photos app source code to be 
> certain).
>
> Proving your own media viewer activity or using an Intent to open the 
> media file or showing the image capture briefly or as a thumbnail is 
> usually what done to provide immediate feedback.
>

My intention was to do something that would make the "Photos" app see my 
stored videos.  This (MediaScannerConnection) doesn't appear to be doing 
it, and I haven't seen any real confirmation that it's even supposed to do 
it.  What is the point of doing this?  I'm going to guess that if I just 
change the subdir name I write to to "Camera", then "Photos" will see my 
videos.
 

>
> Regards
>
>
> On Tuesday, December 22, 2015 at 5:29:36 AM UTC+11, David Karr wrote:
>>
>> On Monday, December 21, 2015 at 12:08:57 AM UTC-8, gjs wrote:
>>>
>>> Hi,
>>>
>>> If your phone is not a Google Nexus variety then that's not surprising, 
>>> but Environment.getExternalStoragePublicDirectory(Environment.
>>> DIRECTORY_DCIM) is what's recommended.
>>>
>>> In some respects it does not really matter which folder you use to store 
>>> media generated by your app (*), provided you go to the trouble of 
>>> 'cataloging' the media generated using MediaScannerConnection - 
>>> http://developer.android.com/reference/android/media/MediaScannerConnection.html#scanFile(android.content.Context,
>>>  
>>> java.lang.String[], java.lang.String[], 
>>> android.media.MediaScannerConnection.OnScanCompletedListener) then your 
>>> photos / video will quickly show up in the default 'Photos' app, without 
>>> having to wait for it to scan the device periodically to find new media 
>>> files.
>>>
>>> (*) And is some other respects it really, really does matter what folder 
>>> you use - if you don't want the media files deleted when your app in 
>>> uninstalled (!) Be very careful about what you decide, here's some 
>>> 'interesting' history - 
>>> https://groups.google.com/forum/#!topic/android-platform/14VUiIgwUjY%5B1-25%5D
>>>
>>> Regards
>>>
>>>
>> Ok, following this information and some other advice (I created a custom 
>> subdir of "DCIM" for my app), I ended up with the following:
>>
>> sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, 
>> Uri.parse("file://" + outputFilePath)));
>>
>>
>>  The problem is, it's not clear to me that this is doing anything.  After 
>> storing one of these and calling this, I exit my app and run the Photos 
>> app, and the new video is not shown there.  I've verified that the video is 
>> stored and viewable.
>>
>> On Monday, December 21, 2015 at 5:53:49 AM UTC+11, David Karr wrote:
>>>>
>>>> On Saturday, December 19, 2015 at 10:34:46 PM UTC-8, gjs wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> See http://developer.android.com/reference/android/os/Environment.html 
>>>>> it has methods to retrieve default paths of where photo, video files etc 
>>>>> are stored.
>>>>>
>>>>> The file naming convention should be easy enough to mimic, usually 
>>>>> being based on date time stamps.
>>>>>
>>>>
>>>> Thanks.  That gets pretty close.  I'm having trouble getting it to 
>>>> match what my phone is using.  For the directory expression, I'm currently 
>>>> using this:
>>>>
>>>> Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
>>>>
>>>>
>>>> However, on my phone, the actual place where it stores pictures from 
>>>> the stock camera is in a "Camera" subdirectory.  This expression doesn't 
>>>> include that.  I could hardcode that, but doesn't feel right.  I tried 
>>>> some 
>>>> variations of this, but I never found an expression that returns "Camera" 
>>>> as the base directory name.
>>>>
>>>>>
>>>>> Regards
>

[android-developers] Re: Best strategy for emitting countdown tones for shutter delay like stock camera app

2015-12-22 Thread David Karr
 audioTrack.play();
>
> try {
> Thread.sleep(duration);
> } catch (Exception ignore) {
> }
>
> audioTrack.setStereoVolume(0, 0);
>
> audioTrack.stop();
>
> audioTrack.release();
>
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
>
> }).start();
> }
>
> private void testTones()
> {
> new Thread(new Runnable()
> {
> @Override
> public void run ()
> {
> long sleep = 500;
>
> for ( int frequency = 3000; frequency >= 300; frequency -= 300 )
> {
> playToneStreaming(frequency, sleep);
>
> try {
> Thread.sleep(sleep);
> } catch (Exception ignore) {
> }
>
> if ( frequency < 1000 )
> {
> sleep = 250;
> }
>     }
>
> sleep = 500;
>
> for ( int frequency = 3000; frequency >= 300; frequency -= 300 )
> {
> playToneStatic(frequency, sleep);
>
> try {
> Thread.sleep(sleep);
> } catch (Exception ignore) {
> }
>
> if ( frequency < 1000 )
> {
> sleep = 250;
> }
> }
> }
>
> }).start();
> }
>
>
> On Tuesday, December 22, 2015 at 5:25:07 AM UTC+11, David Karr wrote:
>>
>> On Sunday, December 20, 2015 at 11:27:14 PM UTC-8, gjs wrote:
>>>
>>> Hi,
>>>
>>> Here's some examples of using AudioTrack 
>>> http://www.programcreek.com/java-api-examples/index.php?api=android.media.AudioTrack
>>>
>>> Just be sure to run in a separate thread.
>>>
>>> Regards
>>>
>>
>> Note that I did already say that I'd found multiple ways to do this, and 
>> I was looking for advice on the actual best (or at least better) way to do 
>> this, and you pointed me to a selection of choices, with no information on 
>> tradeoffs.
>>
>> In any case, I tried the first one (creating an AudioTrack and then 
>> playing it), and wrapping it with a Runnable and a started Thread, and I 
>> heard no sound from my device when the code executed.
>>
>> If it matters, here's the method I ended up with:
>>
>> private void playTone() {
>> new Thread(new Runnable() {
>> @Override
>> public void run() {
>> int minSize = AudioTrack.getMinBufferSize(8000, 
>> AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT);
>> AudioTrack  audioTrack  = new 
>> AudioTrack(AudioManager.STREAM_MUSIC, 8000, 
>> AudioFormat.CHANNEL_CONFIGURATION_MONO,
>> AudioFormat.ENCODING_PCM_16BIT, minSize, 
>> AudioTrack.MODE_STREAM);
>> audioTrack.play();
>> }
>> }).start();
>> }
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/5a1556d3-9f22-460d-9ab6-f2380c1844c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-21 Thread David Karr
On Monday, December 21, 2015 at 12:08:57 AM UTC-8, gjs wrote:
>
> Hi,
>
> If your phone is not a Google Nexus variety then that's not surprising, but
>  Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) 
> is what's recommended.
>
> In some respects it does not really matter which folder you use to store 
> media generated by your app (*), provided you go to the trouble of 
> 'cataloging' the media generated using MediaScannerConnection - 
> http://developer.android.com/reference/android/media/MediaScannerConnection.html#scanFile(android.content.Context,
>  
> java.lang.String[], java.lang.String[], 
> android.media.MediaScannerConnection.OnScanCompletedListener) then your 
> photos / video will quickly show up in the default 'Photos' app, without 
> having to wait for it to scan the device periodically to find new media 
> files.
>
> (*) And is some other respects it really, really does matter what folder 
> you use - if you don't want the media files deleted when your app in 
> uninstalled (!) Be very careful about what you decide, here's some 
> 'interesting' history - 
> https://groups.google.com/forum/#!topic/android-platform/14VUiIgwUjY%5B1-25%5D
>
> Regards
>
>
Ok, following this information and some other advice (I created a custom 
subdir of "DCIM" for my app), I ended up with the following:

sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, 
Uri.parse("file://" + outputFilePath)));


 The problem is, it's not clear to me that this is doing anything.  After 
storing one of these and calling this, I exit my app and run the Photos 
app, and the new video is not shown there.  I've verified that the video is 
stored and viewable.

On Monday, December 21, 2015 at 5:53:49 AM UTC+11, David Karr wrote:
>>
>> On Saturday, December 19, 2015 at 10:34:46 PM UTC-8, gjs wrote:
>>>
>>> Hi,
>>>
>>> See http://developer.android.com/reference/android/os/Environment.html 
>>> it has methods to retrieve default paths of where photo, video files etc 
>>> are stored.
>>>
>>> The file naming convention should be easy enough to mimic, usually being 
>>> based on date time stamps.
>>>
>>
>> Thanks.  That gets pretty close.  I'm having trouble getting it to match 
>> what my phone is using.  For the directory expression, I'm currently using 
>> this:
>>
>> Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
>>
>>
>> However, on my phone, the actual place where it stores pictures from the 
>> stock camera is in a "Camera" subdirectory.  This expression doesn't 
>> include that.  I could hardcode that, but doesn't feel right.  I tried some 
>> variations of this, but I never found an expression that returns "Camera" 
>> as the base directory name.
>>
>>>
>>> Regards
>>>
>>> On Sunday, December 20, 2015 at 4:58:02 AM UTC+11, David Karr wrote:
>>>>
>>>> Because I can't bring up the stock camera app with just a video 
>>>> record/stop button (I'm using a remote bluetooth button to start/stop 
>>>> recording), I've written a custom app that just displays the camera 
>>>> preview 
>>>> and a video record/stop button.
>>>>
>>>> Despite the fact that this is a custom app, as much as possible I'd 
>>>> like to store the videos as if they were taken with the stock app.  This 
>>>> at 
>>>> least means storing them in the same place, with a consistent naming and 
>>>> metadata scheme.  I might consider having custom preferences in the app, 
>>>> but for now I'd just like to retrieve properties that will tell me where 
>>>> the stock camera app will store videos, along with any other configuration 
>>>> that should describe how I store the videos.
>>>>
>>>> How can I get this information within my custom app?
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/1fee646d-729f-44de-8f22-d967d14c7e34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Best strategy for emitting countdown tones for shutter delay like stock camera app

2015-12-21 Thread David Karr
On Sunday, December 20, 2015 at 11:27:14 PM UTC-8, gjs wrote:
>
> Hi,
>
> Here's some examples of using AudioTrack 
> http://www.programcreek.com/java-api-examples/index.php?api=android.media.AudioTrack
>
> Just be sure to run in a separate thread.
>
> Regards
>

Note that I did already say that I'd found multiple ways to do this, and I 
was looking for advice on the actual best (or at least better) way to do 
this, and you pointed me to a selection of choices, with no information on 
tradeoffs.

In any case, I tried the first one (creating an AudioTrack and then playing 
it), and wrapping it with a Runnable and a started Thread, and I heard no 
sound from my device when the code executed.

If it matters, here's the method I ended up with:

private void playTone() {
new Thread(new Runnable() {
@Override
public void run() {
int minSize = AudioTrack.getMinBufferSize(8000, 
AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT);
AudioTrack  audioTrack  = new AudioTrack(AudioManager.STREAM_MUSIC, 
8000, AudioFormat.CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_16BIT, minSize, 
AudioTrack.MODE_STREAM);
audioTrack.play();
}
}).start();
}



-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/e6f449ee-433c-4410-8948-0d5900b8934f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Best strategy for emitting countdown tones for shutter delay like stock camera app

2015-12-20 Thread David Karr
I'm attempting to implement the conventional countdown shutter delay 
strategy for a custom camcorder app, just like the stock camera app.  I've 
implemented the visual and functional part of the countdown, but now I have 
to implement the audio part.  This emits a tone every second and multiple 
tones per second in the last 2-3 seconds (probably 2).  There are 
apparently multiple ways to do this.  My initial searches found several 
possibilities, but I'd like to know what people would think is the best way 
to do something like this, and what the tradeoffs would be for other 
options.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/a31666a2-ff65-4da9-b0b5-d8249c91d3b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-20 Thread David Karr
On Saturday, December 19, 2015 at 10:34:46 PM UTC-8, gjs wrote:
>
> Hi,
>
> See http://developer.android.com/reference/android/os/Environment.html it 
> has methods to retrieve default paths of where photo, video files etc are 
> stored.
>
> The file naming convention should be easy enough to mimic, usually being 
> based on date time stamps.
>

Thanks.  That gets pretty close.  I'm having trouble getting it to match 
what my phone is using.  For the directory expression, I'm currently using 
this:

Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)


However, on my phone, the actual place where it stores pictures from the 
stock camera is in a "Camera" subdirectory.  This expression doesn't 
include that.  I could hardcode that, but doesn't feel right.  I tried some 
variations of this, but I never found an expression that returns "Camera" 
as the base directory name.

>
> Regards
>
> On Sunday, December 20, 2015 at 4:58:02 AM UTC+11, David Karr wrote:
>>
>> Because I can't bring up the stock camera app with just a video 
>> record/stop button (I'm using a remote bluetooth button to start/stop 
>> recording), I've written a custom app that just displays the camera preview 
>> and a video record/stop button.
>>
>> Despite the fact that this is a custom app, as much as possible I'd like 
>> to store the videos as if they were taken with the stock app.  This at 
>> least means storing them in the same place, with a consistent naming and 
>> metadata scheme.  I might consider having custom preferences in the app, 
>> but for now I'd just like to retrieve properties that will tell me where 
>> the stock camera app will store videos, along with any other configuration 
>> that should describe how I store the videos.
>>
>> How can I get this information within my custom app?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/925296b6-f891-4b43-b2a7-c9d2972b5757%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Layout structure to display button over camera preview (like in stock camera app)

2015-12-19 Thread David Karr
On Friday, December 18, 2015 at 10:52:43 PM UTC-8, gjs wrote:
>
> Hi,
>
> Try a FrameLayout - 
> http://developer.android.com/reference/android/widget/FrameLayout.html
>

Ok, that's working pretty well.  One problem, however. How do I mask 
multiple "gravity" constants in the  component?  I started with "bottom" 
and wanted to make it "bottom | center_horizontal", but it barfs on that.


> Regards
>
> On Saturday, December 19, 2015 at 5:20:35 AM UTC+11, David Karr wrote:
>>
>> I'm working with a sample video capture app (
>> http://examples.javacodegeeks.com/android/core/android-video-capture-example/).
>>   
>> I've made some changes to it, but the basic structure is the same.  The 
>> layout used displays the preview in a pane on the left side of the screen, 
>> with a layout containing buttons to the right.  I really need the preview 
>> to take up the entire screen, and have the button (I'm only going to have 
>> the "Capture" button, not the "switch camera" button) display at the bottom 
>> center, just like the stock camera app.
>>
>> This is really just a layout question.  Can someone show the basic 
>> structure that would display a single button at the center of the bottom, 
>> displayed on top of the camera preview?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/f9f5f5ec-9e09-4246-9a2c-6fbd47cf2e3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Best way to determine output file path at time of stopping media recording?

2015-12-19 Thread David Karr
When I start to record a video, I have to call 
"mediaRecorder.setOutputFile(filepath)". When I later stop recording, I can 
report that the video is recorded, but it would be nice to know at the 
point of stopping the recording what the output file path was.  As I have 
the "mediaRecorder" there, you'd think I would be able to call 
"getOutputFile()" on it, but that method doesn't exist. I can of course 
create an activity instance variable to hold this, but it just seems odd 
that I would have to do that.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/9cf9cf17-b426-444d-90a4-651dd9cdaaae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-19 Thread David Karr
Because I can't bring up the stock camera app with just a video record/stop 
button (I'm using a remote bluetooth button to start/stop recording), I've 
written a custom app that just displays the camera preview and a video 
record/stop button.

Despite the fact that this is a custom app, as much as possible I'd like to 
store the videos as if they were taken with the stock app.  This at least 
means storing them in the same place, with a consistent naming and metadata 
scheme.  I might consider having custom preferences in the app, but for now 
I'd just like to retrieve properties that will tell me where the stock 
camera app will store videos, along with any other configuration that 
should describe how I store the videos.

How can I get this information within my custom app?

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/7d3f7fb4-f6c5-4bb1-8e8c-33bac209c7b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Build app using video camera that stores separate preferences and doesn't prompt to save videos

2015-12-18 Thread David Karr
On Friday, December 18, 2015 at 1:31:45 AM UTC-8, gjs wrote:
>
> Hi,
>
> See 
> http://developer.android.com/guide/topics/media/camera.html#capture-video
>
> For (1) As per the link provided, ordinarily the video is saved to (the 
> nominated) file automatically, there is no prompt to save or discard the 
> (video) file, that would require extra effort if you did wish to discard 
> the file, via a Dialog screen of some sort.
>
> For (2) You can save (and read) your custom "camera" properties as Key 
> Value pairs from persistent memory using SharedPreferences, see 
> http://developer.android.com/reference/android/content/SharedPreferences.html
>  
>
> If you wish to edit your custom "camera" property values you probably need 
> to develop an Activity screen or perhaps just a Dialog if you only have a 
> few things to configure for the camera.
>

Thanks.  I was able to find a small example app to use as a base for this: 
http://examples.javacodegeeks.com/android/core/android-video-capture-example/ 
.  It had some bugs wrt proper ordering of sources, encoders, and formats 
(pretty gnarly to get it all right, and I'm fairly certain it isn't 
bulletproof yet), but it's basically working as advertised.  Now I have to 
make several adjustments to get it closer to what I need. 


> Regards
>
> On Friday, December 18, 2015 at 6:07:13 AM UTC+11, David Karr wrote:
>>
>> I'm a very experienced Java dev, but an Android dev newbie (although I 
>> went through a lot of Eclipse-based Android dev tutorials years ago).
>>
>> I'm starting with a simple open-source app that runs the camcorder 
>> (probably mostly based on a tutorial itself).
>>
>> Using a remote bluetooth button device, I can start the app recording.  I 
>> can use the same device to stop the recording.  On the app, this brings up 
>> a "Save" or "Discard" prompt.  When I click "Save", this saves the video 
>> and then I can click again to get back to the camcorder screen, where I 
>> could then click the record button again.
>>
>> Starting with this, I'm wondering how difficult it would be to implement 
>> the following features:
>>
>> 1. When I click the "stop recording" button, either with the app in front 
>> of me or with the remote bluetooth button (the primary use case), I want it 
>> to just save the video and immediately return to the camcorder screen.  
>> This is the most important feature.
>>
>> 2. The preferences for the app are the common "camera" preferences.  I'd 
>> like to store separate preferences for this, particularly the shutter delay 
>> (I would make it ten seconds by default). This is not critical, although 
>> from the tutorials I went through a few years ago, I think I understand the 
>> basic steps for this.
>>
>> As I said, the first feature is the most important.  If I can't do that, 
>> I won't bother with this.
>>
>> Could someone outline the basic elements of a solution for this?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/2c0587ae-af08-4791-807c-139dbd9f3228%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Layout structure to display button over camera preview (like in stock camera app)

2015-12-18 Thread David Karr
I'm working with a sample video capture app 
(http://examples.javacodegeeks.com/android/core/android-video-capture-example/).
  
I've made some changes to it, but the basic structure is the same.  The 
layout used displays the preview in a pane on the left side of the screen, 
with a layout containing buttons to the right.  I really need the preview 
to take up the entire screen, and have the button (I'm only going to have 
the "Capture" button, not the "switch camera" button) display at the bottom 
center, just like the stock camera app.

This is really just a layout question.  Can someone show the basic 
structure that would display a single button at the center of the bottom, 
displayed on top of the camera preview?

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/df0164cc-48f5-420f-bb17-da403f87fbdb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Can't copy text from "Rendering Problems" in Android Studio on CentOS7.2

2015-12-17 Thread David Karr


On Thursday, December 17, 2015 at 11:47:52 AM UTC-8, David Karr wrote:
>
> I recently installed Android Studio on my CentOS7.2 laptop.  It basically 
> works, but while stepping through a simple "HelloWorld" exercise, it 
> displayed some "Rendering Problems" information over the "Design" view of 
> the layout file.  I wanted to copy the text of that to post a question 
> somewhere (likely here).  I'm able to select the text, but after trying all 
> of Ctrl-c, Ctrl-Insert, and selecting "Copy" from the Edit menu, that text 
> doesn't appear to make it into the clipboard, based on the following 
> "Paste" into an external editor not pasting that text.
>
> I haven't noticed an issue like this with other GUI applications running 
> on CentOS.
>

Note that part of the info in the "Rendering Problems" text is a 
stacktrace, and when I click the "Copy stack to clipboard" link and then 
paste into an external editor, it does paste the stacktrace. 

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/6ac86fd3-9122-4ea5-ab6d-076521e15be8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Can't copy text from "Rendering Problems" in Android Studio on CentOS7.2

2015-12-17 Thread David Karr


On Thursday, December 17, 2015 at 11:49:47 AM UTC-8, David Karr wrote:
>
>
>
> On Thursday, December 17, 2015 at 11:47:52 AM UTC-8, David Karr wrote:
>>
>> I recently installed Android Studio on my CentOS7.2 laptop.  It basically 
>> works, but while stepping through a simple "HelloWorld" exercise, it 
>> displayed some "Rendering Problems" information over the "Design" view of 
>> the layout file.  I wanted to copy the text of that to post a question 
>> somewhere (likely here).  I'm able to select the text, but after trying all 
>> of Ctrl-c, Ctrl-Insert, and selecting "Copy" from the Edit menu, that text 
>> doesn't appear to make it into the clipboard, based on the following 
>> "Paste" into an external editor not pasting that text.
>>
>> I haven't noticed an issue like this with other GUI applications running 
>> on CentOS.
>>
>
> Note that part of the info in the "Rendering Problems" text is a 
> stacktrace, and when I click the "Copy stack to clipboard" link and then 
> paste into an external editor, it does paste the stacktrace. 
>

Ah, and I then noticed that if I select the "Text" view, that of course 
shows the text of the file instead of the Design view, and in the "Preview" 
pane on the right it shows the same "Rendering Problems" information, and 
when I did the same copy operation with that text, it WAS able to get it 
into the clipboard so I could paste it into an external editor.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/755cb51b-5f66-4f77-9054-2785176c0126%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Build app using video camera that stores separate preferences and doesn't prompt to save videos

2015-12-17 Thread David Karr
I'm a very experienced Java dev, but an Android dev newbie (although I went 
through a lot of Eclipse-based Android dev tutorials years ago).

I'm starting with a simple open-source app that runs the camcorder 
(probably mostly based on a tutorial itself).

Using a remote bluetooth button device, I can start the app recording.  I 
can use the same device to stop the recording.  On the app, this brings up 
a "Save" or "Discard" prompt.  When I click "Save", this saves the video 
and then I can click again to get back to the camcorder screen, where I 
could then click the record button again.

Starting with this, I'm wondering how difficult it would be to implement 
the following features:

1. When I click the "stop recording" button, either with the app in front 
of me or with the remote bluetooth button (the primary use case), I want it 
to just save the video and immediately return to the camcorder screen.  
This is the most important feature.

2. The preferences for the app are the common "camera" preferences.  I'd 
like to store separate preferences for this, particularly the shutter delay 
(I would make it ten seconds by default). This is not critical, although 
from the tutorials I went through a few years ago, I think I understand the 
basic steps for this.

As I said, the first feature is the most important.  If I can't do that, I 
won't bother with this.

Could someone outline the basic elements of a solution for this?

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/18853497-860c-49f4-b216-98d588719382%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Can't copy text from "Rendering Problems" in Android Studio on CentOS7.2

2015-12-17 Thread David Karr
I recently installed Android Studio on my CentOS7.2 laptop.  It basically 
works, but while stepping through a simple "HelloWorld" exercise, it 
displayed some "Rendering Problems" information over the "Design" view of 
the layout file.  I wanted to copy the text of that to post a question 
somewhere (likely here).  I'm able to select the text, but after trying all 
of Ctrl-c, Ctrl-Insert, and selecting "Copy" from the Edit menu, that text 
doesn't appear to make it into the clipboard, based on the following 
"Paste" into an external editor not pasting that text.

I haven't noticed an issue like this with other GUI applications running on 
CentOS.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/0fb6ad82-17e7-413f-b105-8d9f1602cbde%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Use unrooted Android device to test web site running on desktop, through usb cable?

2012-12-25 Thread David Karr
If I have an unrooted Android device, a USB cable, and a laptop, can I run 
a web or application server on my laptop and test a site running on that 
server on the Android device?

I know I can do some testing with the Android emulator, but I'd like other 
options.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] RemoteViewsService can't access ContentProvider in same app

2012-12-01 Thread David Karr
I'm stepping through Professional Android 4 Application
Development.  I'm attempting to enter most of the code samples by
hand, but I'm deploying the provided downloaded apps if what I've
entered doesn't match what I expect.

I'm on chapter 14, the 3rd iteration of the Earthquake example,
which adds a list widget.  The regular widget works fine, but when I
try to place the list widget on the homescreen, I get the following:

FATAL EXCEPTION: Binder Thread #2
java.lang.SecurityException: Permission Denial: reading
com.example.earthquake.EarthquakeProvider uri
content://com.example.earthquakeprovider/earthquakes from pid=806,
uid=10001 requires null
at android.content.ContentProvider
$Transport.enforceReadPermission(ContentProvider.java:295)
at android.content.ContentProvider
$Transport.query(ContentProvider.java:177)

When I install the corresponding app version from the code download,
it works fine.  I must be missing a small detail, but I don't see it.
I've carefully compared the differences between the manifest files,
but I don't see anything that's obviously relevant.

If it matters, here is my entire app manifest.  The only permission
entry relevant to the list widget is BIND_REMOTEVIEWS, but the code
sample has the same thing.

-
manifest xmlns:android=http://schemas.android.com/apk/res/android;
package=com.example.earthquake
android:versionCode=1
android:versionName=1.0 

uses-sdk android:minSdkVersion=14
android:targetSdkVersion=15 /

uses-permission android:name=android.permission.INTERNET /
uses-permission android:name=android.permission.VIBRATE /

application android:icon=@drawable/ic_launcher
android:label=@string/app_name android:theme=@style/AppTheme 
meta-data android:name=android.app.default_searchable
android:value=.EarthquakeSearchResults /

uses-library android:name=com.google.android.maps /

activity android:name=.Earthquake android:label=@string/
title_activity_earthquake
android:uiOptions=splitActionBarWhenNarrow 
intent-filter
action android:name=android.intent.action.MAIN /
category
android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity
activity android:name=.PreferencesActivity
android:label=@string/title_activity_preferences /
activity android:name=.FragmentPreferences /
activity android:name=.EarthquakeSearchResults
android:exported=false android:label=@string/search_description
android:launchMode=singleTop 
intent-filter
action android:name=android.intent.action.SEARCH /
category
android:name=android.intent.category.DEFAULT /
/intent-filter
meta-data android:name=android.app.searchable
android:resource=@xml/searchable /
/activity
provider android:name=.EarthquakeProvider
android:authorities=com.example.earthquakeprovider
android:exported=false /
service android:name=.EarthquakeUpdateService
android:enabled=true /
receiver android:name=.EarthquakeAlarmReceiver
android:exported=false 
intent-filter
action
android:name=com.example.earthquake.ACTION_REFRESH_EARTHQUAKE_ALARM /

/intent-filter
/receiver
receiver android:name=.EarthquakeWidget
android:label=Earthquake 
intent-filter
action
android:name=android.appwidget.action.APPWIDGET_UPDATE /
/intent-filter
intent-filter
action
android:name=com.example.earthquake.QUAKES_REFRESHED /
/intent-filter
meta-data android:name=android.appwidget.provider
android:resource=@xml/quake_widget_info /
/receiver
receiver android:name=.EarthquakeListWidget
android:label=Earthquake List 
intent-filter
action
android:name=android.appwidget.action.APPWIDGET_UPDATE /
/intent-filter
meta-data android:name=android.appwidget.provider
android:resource=@xml/quake_list_widget_info /
/receiver
service android:name=.EarthquakeRemoteViewsService
android:permission=android.permission.BIND_REMOTEVIEWS/
/application
/manifest
-

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: starting avd fails, saying it can't find emulator, but it exists

2012-05-29 Thread David Karr
I figured this out. I didn't follow the installation instructions 
properly.  I'm on 64-bit Ubuntu, and the 32-bit SDK can't be used out of 
the box.  I had to install the 32-bit compatibility package (something like 
ia32), and that fixed the problem.

On Friday, May 25, 2012 7:35:55 PM UTC-7, David Karr wrote:

 0 down vote favorite 
 share [g+] share [fb] share [tw] 


 I've installed the SDK on Ubuntu 12.0.4. I started up the SDK manager 
 and updated several packages. 

 I ran the avd manager and tried to create an avd, but it just failed 
 with no information. 

 I then tried to create the avd from the command line, using the same 
 information I tried to use from the gui, and it worked. 

 When I tried to start that AVD, it failed with (some strings elided): 

 Failed to start emulator: Cannot run program myhome/apps/android/ 
 android-sdk-linux/tools/emulator: java.io.IOException: error=2, No 
 such file or directory 

 This is what I see when I look for this file: 

 $ ls -lt myhome/apps/android/android-sdk-linux/tools/emulator 
 -rwxrwxr-x 1 me me 24828 May 25 08:20 myhome/apps/android/ 
 android-sdk-linux/tools/emulator* 

 As you can see, the path it's looking for DOES exist. 

 What's going on here? 


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] starting avd fails, saying it can't find emulator, but it exists

2012-05-25 Thread David Karr
0 down vote favorite
share [g+] share [fb] share [tw]


I've installed the SDK on Ubuntu 12.0.4. I started up the SDK manager
and updated several packages.

I ran the avd manager and tried to create an avd, but it just failed
with no information.

I then tried to create the avd from the command line, using the same
information I tried to use from the gui, and it worked.

When I tried to start that AVD, it failed with (some strings elided):

Failed to start emulator: Cannot run program myhome/apps/android/
android-sdk-linux/tools/emulator: java.io.IOException: error=2, No
such file or directory

This is what I see when I look for this file:

$ ls -lt myhome/apps/android/android-sdk-linux/tools/emulator
-rwxrwxr-x 1 me me 24828 May 25 08:20 myhome/apps/android/
android-sdk-linux/tools/emulator*

As you can see, the path it's looking for DOES exist.

What's going on here?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] How to set clipboard in android emulator for ice cream sandwich?

2012-05-10 Thread David Karr
I found a StackOverflow post that showed me how I can use adb to set
the clipboard in the emulator:
http://stackoverflow.com/questions/7283446/pasting-text-into-android-emulator-clipboard-using-adb-shell
.

I'm finding that this only works for Gingerbread, both reading and
writing. When I try the same thing with an ICS emulator, writing fails
with a parcel string of Unknown package.  Reading appears to return
an empty string.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Browser in emulator with proxy setting just exits when url is entered

2012-04-18 Thread David Karr
Today I installed the SDK and created a Phone_IceCreamSandwich AVD.  I 
started it up and ran the browser in the emulator.  I noticed that it 
wasn't completing the request for the home page.  I'm inside a corporate 
firewall, so that's not surprising. I then restarted the AVD with a 
command-line proxy setting.  When I brought up the browser, it was able to 
display the default home page.  I then entered an existing URL for a public 
site into the emulator browser and pressed Enter.  After a couple of 
seconds the browser app went away, leaving me with the emulated home 
screen. I've tried this several times, with the same result, and using a 
couple of different public URLs.

What am I missing?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Will the browser in the ADT emulator use my desktop network connection for browsing sites?

2012-04-18 Thread David Karr
On Tuesday, April 17, 2012 9:31:47 PM UTC-7, Gene wrote:

 Yes.  The emulator uses the host NIC as though it's a WiFi service 
 provider. All the apps respond accordingly. 

 Not sure if this will be important for you, but the emulated settings 
 for Proxy and DNS for that emulated ISP all function by manipulating 
 the emulator GUI.  If you're on an enterprise LAN this might be 
 important.  There are emulator command-line flags for DNS and proxy, 
 but I found it necessary to set both these _and_ the GUI device 
 settings for our ELAN.  This was not easy to figure out. 


I tried to set this up.  I installed the SDK on my work laptop. I created a 
Phone_IceCreamSandwich AVD and started it up. When I started the emulator 
browser, it never completed displaying the default home page. I then 
stopped the emulator and restarted with a -http-proxy setting. When I 
brought up the browser, it was able to display the default home page. 
However, when I entered a different public URL in the browser, it just 
exited the browser app and went back to the home screen. I tried this 
several times, even with different public URLs, with the same result.

I don't know what I would set for a DNS server.

What are the GUI device settings?


 On Apr 17, 3:39 pm, David Karr davidmichaelk...@gmail.com wrote: 
  I can't test this right now, but if I start up an emulator instance on 
  my desktop, if I bring up the browser on the emulator, will that use 
  my desktop network connection for DNS and resolving urls?  If my 
  desktop is connected to VPN, I want the browser on the phone to be 
  able to view a page inside our firewall.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Will the browser in the ADT emulator use my desktop network connection for browsing sites?

2012-04-17 Thread David Karr
I can't test this right now, but if I start up an emulator instance on
my desktop, if I bring up the browser on the emulator, will that use
my desktop network connection for DNS and resolving urls?  If my
desktop is connected to VPN, I want the browser on the phone to be
able to view a page inside our firewall.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Looking for Jersey/Restlet/REST recommendations

2012-03-28 Thread David Karr

On Wednesday, March 28, 2012 1:44:44 PM UTC-7, Mark Phillips wrote:

 I forgot to include a subject line.

 On Wed, Mar 28, 2012 at 11:38 AM, Mark Phillips 
 m...@phillipsmarketing.biz wrote:

 My android app needs to talk to a MySQL database on a server. I have been 
 googling for solutions and found recommendations for Jersey and Restlet. I 
 have looked at these two frameworks, but from reading I cannot tell which 
 is better. I am new to REST, but have experience in Java, servlets, and 
 jsp. So I was wondering if anyone on this list has experience with one or 
 both, and any recommendations you may have. I am looking for a simple way 
 to CRUD data in my database (~ 15-20 tables). Any hands-on feedback is 
 appreciated!


I would also recommend Apache CXF. Both Jersey and CXF are implementations 
of the JAX-RS specification. You would use either of these frameworks only 
on the server side, of course. There is a small client framework for CXF 
(not sure about Jersey), but it's not critical.

I've implemented several REST services with Apache CXF, which integrates 
very well with Spring, which integrates very well with databases.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] So why is the style attribute for a view not in the android namespace?

2012-03-24 Thread David Karr
I'm just curious about the background on this, but I was wondering why the 
style attribute in a view definition isn't in the android namespace.

For instance, in the following sample:

 TextView  android:id=@+id/errorText 
 style=@style/ErrorText 
 android:text=No errors at this time 
 / 


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Question about using dimension resources in other resources vs. in Java code

2012-03-17 Thread David Karr
I'm just reading about dimension resources (Pro Android 4), and it seems 
curious how dimension resources are referenced in Java code (at least as 
specified in this book).

The resource value consists of the value and the dimension, like 5px or 
5dp or 5sp.

You could reference this in a layout resource, like to set the textSize 
of a TextView.  My assumption is that the unit specified in the dimension 
would be used in that calculation, which would result in slightly different 
sizes for the previous examples. That is only an assumption. It seems 
reasonable.  What would be the point of specifying the unit if it isn't 
used anywhere?

In Java code, however, it appears that you reference a dimension resource 
like this:

float dimen = 
 activity.getResources().getDimension(R.dimen.mysize_in_pixels);


That looks to me like it's only returning the dimensionless value (5, for 
instance). 

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] What needs to be in place for Javascript in a webapp to be able to get phone model and phone number?

2012-03-14 Thread David Karr
I know that an Android app can get the phone model and phone number, but 
what has to be in place for Javascript in a webapp, running in the Android 
browser, to get the same information. I know that I could have an Android 
app that creates a WebView, but is it possible for a webapp running in the 
stock browser to have access to that info?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] What needs to be in place for Javascript in a webapp to be able to get phone model and phone number?

2012-03-14 Thread David Karr
On Wed, Mar 14, 2012 at 10:54 AM, Mark Murphy mmur...@commonsware.comwrote:

 On Wed, Mar 14, 2012 at 1:46 PM, David Karr davidmichaelk...@gmail.com
 wrote:
  I know that an Android app can get the phone model and phone number, but
  what has to be in place for Javascript in a webapp, running in the
 Android
  browser, to get the same information. I know that I could have an Android
  app that creates a WebView, but is it possible for a webapp running in
 the
  stock browser to have access to that info?

 First, there is no the Android browser. There are probably as many
 browsers for Android as there are for Windows. I assume you mean the
 stock AOSP browser, which will exist on most but not all devices.

 Second, unless there is some W3C standard for privacy leaks, I hope a
 Web browser never has the ability to get the device's phone number, or
 at least it is disabled by default. Heck, we can't even get that
 reliably from *Java*.


I would also assume it is disabled by default, and I'm fine with that. I'm
considering this for a situation where the user is at least cooperative,
and is willing to have the phone provide this information, if there's any
way to do that.

It's starting to look like my only option is an android app with a WebView,
with Java classes tied to the Javascript.



 Model information may be included as part of the User-agent HTTP
 header, so navigator.userAgent or navigator.appVersion in theory
 should be able to provide that to you. Whether any given browser
 provides model information, of course, is up to that browser maker.


Acknowledged. We'll consider that.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Why doesn't the ADT show me the javadoc for a class in android.jar when I have the javadoc path set for the jar?

2012-01-01 Thread David Karr
This may be completely Eclipse-specific, but perhaps not.

I find it's very inconsistent whether I can get Eclipse to show me the 
Javadoc for an Android class or method, even when I appear to have valid 
javadoc attached to the android.jar file.

For instance, right now I'm viewing a class in a sample application that 
references SQLiteDatabase. There are no compile errors, so I have all of my 
dependencies properly set.  I hover on the class name reference and force 
the javadoc to display, it prints the class name as 
android.database.sqlite.SQLiteDatabase, but it says Note: This element 
has no attached source and the Javadoc could not be found in the attached 
Javadoc..

I then went into the Project Explorer and expanded the Android 2.3.3 
library, exposing the android.jar file. I right-clicked on that and 
selected Properties. I clicked on Javadoc Location. It's currently set to 
Javadoc URL and the Javadoc location path was set to the path to the 
reference directory in the android SDK. I clicked Validate and it said 
Location is likely valid.

Just in case, I verified that android/database/sqlite/SQLiteDatabase.html 
exists at the root of the javadoc tree.

So why is it not showing the javadoc for this class?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Android Support package, as described on Android site, not found in SDK Manager

2011-12-31 Thread David Karr
I was looking at the new Android Training section on the Android 
Developer's site. One of the first required steps is installing the 
Android Support package.

In the Downloading the Support Package section, it first says to Launch 
the SDK and AVD Manager.  This is curious, as my Eclipse has two options, 
called Android SDK Manager and AVD Manager. These instructions refer 
specifically to a choice called Android SDK and AVD Manager.  I assume 
they really mean the SDK Manager, so that's what I'm looking at.

The instructions next say Expand the Android Repository, check Android 
Support package.

My Android SDK Manager dialog has a pane labeled Packages. I see 
nothing labeled Android Repository. I also see nothing like Android 
Support.

What am I missing?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Why isn't layoutopt in my sdk?

2011-12-31 Thread David Karr
I noticed the mention of the layoutopt tool in the Android Training 
pages.  I see that I don't have that in my sdk distro anywhere. I've kept 
the SDK installed from the ADT pretty up to date, but perhaps that's 
separate from this.

Why might it be missing?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Is Spinner.setOnItemClickListener() supposed to work, or not?

2011-11-20 Thread David Karr
I'm looking at the 3.2 API for android.widget.Spinner.  The documentation 
for public void setOnItemClickListener (AdapterView.OnItemClickListener 
l) says this:

A spinner does not support item click events. Calling this method will 
raise an exception.

I'm also looking at the sample code from an Android book, which uses this 
method, and this works perfectly fine.

What's up with this?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Layout Question

2011-11-20 Thread David Karr
I would think that changing the layout_height of the LinearLayout to 
wrap_content would help. With what you have, both children of the 
RelativeLayout are set to fill_parent, so they'll have the same height.

Also, I would recommend you make up your mind whether you're going to use 
fill_parent or match_parent. It's annoying to use both of them.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Is Spinner.setOnItemClickListener() supposed to work, or not?

2011-11-20 Thread David Karr
Oh, duh.  That was actually the one I was using. I didn't notice the 
difference.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Is Spinner.setOnItemClickListener() supposed to work, or not?

2011-11-20 Thread David Karr
When someone says Oh, duh, that's an idiom for I understand now.

I was using Selected, but I read the advice on Click, and I didn't 
notice the difference in method names. I don't have an issue anymore.

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Android Eclipse plugin: setting background in wysiwyg didn't set background

2011-03-30 Thread David Karr
Is this the best place to ask about the Android Eclipse plugin?

I just noticed that when I changed the background property of my main layout 
in the wysiwyg mode (Graphical Layout), it looks fine in the graphical 
mode, but it doesn't appear to have changed the actual layout file. The 
display shows the background from the background picture I specified, but 
when I switch to the XML view, the background property isn't set, and when I 
run on the emulator, it doesn't have the new background (just the default). 
There is no indication that my file isn't saved.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Android Eclipse plugin: setting background in wysiwyg didn't set background

2011-03-30 Thread David Karr
Just so it's clear, I then manually added the property setting to the XML 
view and then ran on the emulator, and the background was changed.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Camera works fine, but deployed camera app says that I need an SD card

2010-12-19 Thread David Karr
On Dec 19, 7:46 am, savanevery savanev...@gmail.com wrote:
 I believe Mark is right, you need to unmount the SD card from your
 computer.  You should still be able to debug and deploy applications
 on the device, you just can't have it in the mode where it looks like
 a drive on your machine for file browsing.

 The example you are using leverages the built-in camera application
 which requires the SD card for saving the image.  You can get around
 that issue by building a custom camera application.

After finally figuring out how to do this (Windows doesn't make it
easy), I found it didn't make any difference.  I went through the
Safely remove hardware steps, and that removed the drive from File
Explorer.  Then, I reran the app, and it still complained about the SD
card when I pressed the camera button.  At that point I disconnected
the USB cable and pressed the camera button again, and this time it
worked.

 On Dec 19, 5:24 am, Mark Murphy mmur...@commonsware.com wrote:

  On Sun, Dec 19, 2010 at 1:29 AM, David Karr davidmichaelk...@gmail.com 
  wrote:
   Sorry, I need more information.

  ?

   You're saying that because I had the phone connected to my computer
   with the USB cable (so I could deploy the application to the device),
   that means that the SD card in the phone is mounted on the WinXP box,
   and so can't be used from the phone?

  No, I mean that if you mounted the SD card as a drive while connected
  to USB, the SD card is unavailable to Android.

   Is there something that should
   be done in the setup of the test on the phone so that I would unmount
   the SD card from the WinXP box, but still let me step through the code
   while it's running on the phone?

  Don't mount the drive in the first place. Or, unmount it the way you
  would any other USB drive (e.g., icon in the task tray).

   Calling Environment.getExternalStorageState() will tell me the
   current state of the SD card.  How does that help me?

  App users sometimes mount their external storage (e.g., SD cards).
  Apps, therefore, should not blindly write to external storage, but
  should check the storage state first.

  Again, this is all based on an educated guess that your problem
  stemmed from your having mounted your phone's external storage as a
  drive in Windows.

  --
  Mark Murphy (a Commons 
  Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

  _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
  Available!



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Camera works fine, but deployed camera app says that I need an SD card

2010-12-19 Thread David Karr
On Dec 19, 8:48 am, Kostya Vasilyev kmans...@gmail.com wrote:
 19.12.2010 19:36, David Karr пишет:

  After finally figuring out how to do this (Windows doesn't make it
  easy), I found it didn't make any difference.  I went through the
  Safely remove hardware steps, and that removed the drive from File
  Explorer.  Then, I reran the app, and it still complained about the SD
  card when I pressed the camera button.  At that point I disconnected
  the USB cable and pressed the camera button again, and this time it
  worked.

 You need to change the phone's USB connection mode, so that it doesn't
 present its memory card to Windows as a flash drive.

 This is device-specific, with one thing in common: there should be a
 status bar icon (on the phone) when it's connected to your computer over
 USB.

 Pull down the notification area, there will be something like Choose
 USB connection mode or just USB connection, and choose a mode that
 does not mount the memory card as a drive in Windows.

 The modes are device-specific, so experiment a little. On my Motorola
 Milestone, I use Portal  Tools.

I think I found it.
I clicked the status bar icon, and it gives me a USB Connection
property, with the following choices:

* PC Mode
* Windows Media Sync
* USB Mass Storage
* Charge Only

The USB Mass Storage was set.  I changed it to Charge Only and
then reran the test.  The application deployed to the device and
didn't complain about the SD card.  What's odd now is that the camera
doesn't work.  Pressing and holding the camera button doesn't bring up
the camera app.  In fact, it doesn't even work with the USB cable
disconnected.  After some googling for this, I find that this is
happening to some other people.  After I rebooted the phone, I was
able to get into the camera again.  I haven't tried rerunning the app
again after this.


 --
 Kostya Vasilyev -- WiFi Manager + pretty widget 
 --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] How to actually see log messages in ADT, or anywhere for that matter?

2010-12-19 Thread David Karr
I've deployed an app to my device that calls Log.v(String, String).
I'm using the ADT.  I have the LogCat view showing.

I step over the line of code that calls Log.v().  Nothing appears in
the LogCat view.

I haven't added any filters.  I've tried clicking the V toggle
button in the LogCat view, but that makes no difference.

It appears that I'm supposed to set the log level of the device. There
appears to be no way to do that from the ADT.  However, looking at the
various short articles discussing this, I believe that doing this from
the shell is supposed to do it:

  ./adb -d shell setprop log.tag.SNAPSHOT VERBOSE

Where my tag is SNAPSHOT.  I ran this, and it returned to the prompt
without showing the usage info, so I assume it at least recognized my
input.

The line of code that is executed is this:

Log.v(SNAPSHOT, Checking currentEffect[ + currentEffect + ]);

This line doesn't show up in the LogCat view.

What am I missing?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: How to actually see log messages in ADT, or anywhere for that matter?

2010-12-19 Thread David Karr
On Dec 19, 2:29 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 You could try running adb logcat from your computer's command line. That
 would tell you if it's the device or Eclipse that is the problem. If the
 device's logcat works, you will see lots of output, not just your
 application's. All tags should be enabled by default.

Ok, I can see my application's log output with adb logcat.  I still
don't see anything in the LogCat view in Eclipse.

  I've deployed an app to my device that calls Log.v(String, String).
  I'm using the ADT. I have the LogCat view showing.

  I step over the line of code that calls Log.v(). Nothing appears in
  the LogCat view.

  I haven't added any filters. I've tried clicking the V toggle
  button in the LogCat view, but that makes no difference.

  It appears that I'm supposed to set the log level of the device. There
  appears to be no way to do that from the ADT. However, looking at the
  various short articles discussing this, I believe that doing this from
  the shell is supposed to do it:

  ./adb -d shell setprop log.tag.SNAPSHOT VERBOSE

  Where my tag is SNAPSHOT. I ran this, and it returned to the prompt
  without showing the usage info, so I assume it at least recognized my
  input.

  The line of code that is executed is this:

  Log.v(SNAPSHOT, Checking currentEffect[ + currentEffect + ]);

  This line doesn't show up in the LogCat view.

  What am I missing?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: How to actually see log messages in ADT, or anywhere for that matter?

2010-12-19 Thread David Karr
On Dec 19, 4:20 pm, David Karr davidmichaelk...@gmail.com wrote:
 On Dec 19, 2:29 pm, Kostya Vasilyev kmans...@gmail.com wrote:

  You could try running adb logcat from your computer's command line. That
  would tell you if it's the device or Eclipse that is the problem. If the
  device's logcat works, you will see lots of output, not just your
  application's. All tags should be enabled by default.

 Ok, I can see my application's log output with adb logcat.  I still
 don't see anything in the LogCat view in Eclipse.

   I've deployed an app to my device that calls Log.v(String, String).
   I'm using the ADT. I have the LogCat view showing.

   I step over the line of code that calls Log.v(). Nothing appears in
   the LogCat view.

   I haven't added any filters. I've tried clicking the V toggle
   button in the LogCat view, but that makes no difference.

   It appears that I'm supposed to set the log level of the device. There
   appears to be no way to do that from the ADT. However, looking at the
   various short articles discussing this, I believe that doing this from
   the shell is supposed to do it:

   ./adb -d shell setprop log.tag.SNAPSHOT VERBOSE

   Where my tag is SNAPSHOT. I ran this, and it returned to the prompt
   without showing the usage info, so I assume it at least recognized my
   input.

   The line of code that is executed is this:

   Log.v(SNAPSHOT, Checking currentEffect[ + currentEffect + ]);

   This line doesn't show up in the LogCat view.

   What am I missing?



Oh, and I just noticed I wasn't using the latest version of the SDK or
plugin.  I just reinstalled everything and now LogCat is working fine.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Camera works fine, but deployed camera app says that I need an SD card

2010-12-18 Thread David Karr
I have a droid2.  I can take pictures with the camera. I can browse
the pictures I've taken on the phone.

I can connect the phone to my WinXP box and browse the SD card through
File Explorer.

I'm now trying a sample tutorial (SizedCameraIntent) from the Pro
Android Media book. When I deploy to the phone, the camera starts,
but when I try to take the picture, it gives me Please insert an SD
card before using the camera.

What am I doing wrong?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Camera works fine, but deployed camera app says that I need an SD card

2010-12-18 Thread David Karr
On Dec 18, 2:09 pm, Mark Murphy mmur...@commonsware.com wrote:
 If you have the SD card mounted on your WinXP box, that SD card is not
 available to the phone. You need to unmount first before you can save
 photos, etc. to the SD card. See Environment and
 getExternalStorageState().

Sorry, I need more information.

You're saying that because I had the phone connected to my computer
with the USB cable (so I could deploy the application to the device),
that means that the SD card in the phone is mounted on the WinXP box,
and so can't be used from the phone?  Is there something that should
be done in the setup of the test on the phone so that I would unmount
the SD card from the WinXP box, but still let me step through the code
while it's running on the phone?

Calling Environment.getExternalStorageState() will tell me the
current state of the SD card.  How does that help me?

 On Sat, Dec 18, 2010 at 5:00 PM, David Karr davidmichaelk...@gmail.com 
 wrote:
  I have a droid2.  I can take pictures with the camera. I can browse
  the pictures I've taken on the phone.

  I can connect the phone to my WinXP box and browse the SD card through
  File Explorer.

  I'm now trying a sample tutorial (SizedCameraIntent) from the Pro
  Android Media book. When I deploy to the phone, the camera starts,
  but when I try to take the picture, it gives me Please insert an SD
  card before using the camera.

  What am I doing wrong?

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
 Available!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Why do the Date/Time controls have + on the top and - on the bottom?

2010-12-04 Thread David Karr
I've always thought it was strange that the Date/Time controls have
the increment and decrement buttons in the order that seems opposite
to the natural order.  Experience in user interfaces tells you that
numbers increase down and decrease up, just like the entries in a
list.

If you had a Date/Time control that was synched with a list, where the
keys of the list are date or time markers, you would click the control
above the component (+) and the marker would move down the list.  If
you clicked the control below the component (-), the marker would
move up the list.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Possible to populate context menu at draw time?

2010-12-04 Thread David Karr
I don't necessarily have a need for this, but I noticed while reading
through some of the Menu features that there wasn't an obvious way to
populate a menu (context menu, for instance) just before drawing it. I
believe this is a typical feature of other menu systems.  Is it
possible to do this in Android menus?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] hardware update wizard doesn't start when I plug in the phone with the USB cable

2010-11-29 Thread David Karr
I'm experimenting with android development on my work XP laptop.  I
installed the SDK and the ADT in my Eclipse 3.5.2 environment.  I then
connected my device to my laptop with the USB cable.  Although my
computer appeared to recognize that a device had been connected, it
didn't bring up the Hardware Update Wizard.  The installation
instructions for the USB driver don't mention this scenario.

When I open up Device Manager in Computer Management I don't see
any hint about how I can make this happen.

I then opened up Explorer and I noticed a new drive with the name
Motorola.  When I visited that, I noticed the following files:

Autorun.inf
MotoConnect_MSI_Installation_01.01.30.msi
Motorola_End_User_Driver_Installation_4.7.1.msi
Motorola_End_User_Driver_Installation_x64_4.7.1.msi
config.ini
ins.vbs
run.bat*
setup.exe*

When I ran setup.exe, it brought up a dialog titled Motorola Mobile
Drivers Installation 4.7.1.  It sounds like this is similar to what
the Android setup instructions describe, but not quite the same.

How do I install the Android USB driver if the Hardware Update
Wizard doesn't start?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Bad link for Using the Contacts API article

2010-11-29 Thread David Karr
As this appears to be the only place to report issues with the
articles and the pages linking to them:

On the Technical Articles page, the link for Using the Contacts
API actually goes to the article for the previous link, to the Using
Text-to-Speech article.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] USB driver won't install

2010-11-29 Thread David Karr
I'm trying to install the USB driver for Windows, with the information
provided at http://developer.android.com/sdk/win-usb.html.  I've
connected my device with the cable.  I can now see files on my device
from Windows.  After I connected, the Hardware Update Wizard came
up.

I followed the instructions for specifying the path to the USB
driver.  I checked Search for the best driver in these locations,
unchecked Search removable media, and checked Include this location
in the search.  I clicked the Browse button and navigated into
where I installed the SDK.  When I selected the android-sdk-windows
directory, the OK button was insensitive. When I selected the
usb_driver directory, it was sensitive.  I then tried the i386
directory, and it was insensitive again.  So, I selected usb_driver
and then clicked Next on the main dialog.

At that point it very quickly said Cannot install this Hardware - the
hardware was not installed because the wizard cannot find the
necessary software.

In the usb_driver directory is the following files and directories:

./   amd64/   androidwinusb86.cat*   i386/
../  android_winusb.inf*  androidwinusba64.cat*  source.properties*

In the i386 directory is the following:

./   NOTICE*WdfCoInstaller01007.dll*
../  WUDFUpdate_01007.dll*  WinUSBCoInstaller.dll*

Any ideas what might be wrong here?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en