[android-developers] resubmit app to Play Store

2015-04-28 Thread john brown
My app was on Play Store and everything was working OK. I have several 
users that we are in contact with to provide support. apps were removed 
from the Play Store due to failure to accept the new Developer Distribution 
Agreement prior to the deadline. I am trying to resubmit the app without 
success. I need to get a Content Rating.(it is an industry specific app 
with no sex, drugs or violence.) I filled out the Content Rating form, 
clicked calculate rating, and apply rating. It says app could not be 
saved. refer to form for errors. But I really was not trying to resubmit 
(save) just apply content rating so I could return to Store Listing fill it 
out and then resubmit (save). I cannot find a save command on the Store 
Listing tab and it dumps my input whenever I go to the content rating tab. 
It seems I can only get one form filled out and both forms must be correct. 
This is very frustrating. Anybody experience the same confusion? Are there 
any resources that help me know what to do?

-- 
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
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: adt-bundle-windows download from developer.android.com

2012-11-19 Thread john brown
Update:

The next day, Nov 16, I gave up on that computer and decided to install 
eclipes and adt on another machine. On that day there was a selection for 
downloading either a 32 or a 64 bit version. I got the 32 bit and the name 
of the file was adt-bundle-windows-x86.zip. I checked the file I downloaded 
the day before and the name was adt-bundle-windows.zip with not indication 
of what version. The adt-bundle-windows-x86.zip version did install and 
run correctly. So the problem is solved. (Or else I made a mistake 
yesterday and there was versioning and I was just error prone and did not 
see it. There is evidence that I have made a mistake before)

Thanks, John Brown

On Thursday, November 15, 2012 4:34:52 PM UTC-6, john brown wrote:

 Hello,

 I downloaded the Android Developer Tools (adt-bundle-windows.zip) from 
 developer.android.com today. I followed the directions Setting Up the 
 ADT Bundle. It was simple download and un-zip although it does take a 
 while.

 When I run c:\mydir\adt-bundle-windows\eclipse\eclipse.exe, I get the 
 following
 Error: c:\mydir\adt-bundle-windows\eclipse\eclipse.exe is not a valid 
 Win32 application

 The computer is a Win XP. I could not find any specifications about the 
 Eclipse version on developer.android.com.

 Any suggestion would be appreciated. Thanks for your help.


-- 
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] adt-bundle-windows download from developer.android.com

2012-11-15 Thread john brown
Hello,

I downloaded the Android Developer Tools (adt-bundle-windows.zip) from 
developer.android.com today. I followed the directions Setting Up the ADT 
Bundle. It was simple download and un-zip although it does take a while.

When I run c:\mydir\adt-bundle-windows\eclipse\eclipse.exe, I get the 
following
Error: c:\mydir\adt-bundle-windows\eclipse\eclipse.exe is not a valid 
Win32 application

The computer is a Win XP. I could not find any specifications about the 
Eclipse version on developer.android.com.

Any suggestion would be appreciated. Thanks for your help.

-- 
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: two icons for the same app

2011-09-01 Thread john brown
Thanks to Streets of Boston and TreKing for the answers. Both were
correct. My problem is solved. And now I know what that line in the
Manifest does!

Thanks, John Brown

On Aug 31, 5:11 pm, TreKing treking...@gmail.com wrote:
 On Wed, Aug 31, 2011 at 4:58 PM, john brown 
 johnbrowngreybe...@gmail.comwrote:

  The first time I noticed the second icon was after I included a
  second activity that displays a WebView.

 Did you mark this Activity to have the LAUNCHER flag?

 --- 
 --
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
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] two icons for the same app

2011-08-31 Thread john brown
I have an application that I install via the Eclipse IDE toolbar
icon run package.name.app. My phone shows two icons for this app.
(only one icon until recently) The icons look identical but the name
is long and I cannot see the end of either icon labels. Even if I
uninstall the app via Settings  Applications  Manage Applications,
the next time I run it from Eclipse, the two icons are both there
again. The app is only listed one time under Manage Applications. The
first time I noticed the second icon was after I included a second
activity that displays a WebView. Everything seems to work OK. I can
launch the second activity and close it just fine.

Why do I have two icons? (I did not include code because I do not know
which code might be relevant.)

Thanks, John Brown

-- 
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] ProgressDialog call from AsyncTask thread

2011-03-28 Thread john brown
I have a process, getNextBook, that takes maybe 5 or 20 seconds,
depending on the size of the next book. It works OK but I need to
inform the user that I'm working, just wait so they will not tell
the App to do something else before the getNextBook process finishes.
(the code for something else is not included for the sake of
simplicity). I have included the display of a ProgressDialog so the
user can see when it is working and when it finishes. I have
experimented until I got it to work but there is something I do not
understand. The code is abbreviated for the sake of simplicity and it
does work even if I have created some error when I abbreviated.)

I utilize AsyncTask to make another thread so I will not block the
main thread. I want to call the ProgressDialog directly from the
AsyncTask getNextBook_T, but I cannot get it to work. Is there a way
to implement the ProgressDialog directly from getNextBook_T? Or is it
OK (or necessary) to do it indirectly like the code shows?

Thanks for your help

code
package very.long.name.App01;

import android.app.Activity;
import android.app.ProgressDialog;

public class App01 extends Activity {
private ProgressDialog pd;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}

public boolean onOptionsItemSelected(MenuItem item) {
String strTemp;
switch (item.getItemId()) {
case R.id.mnuCkSrv:
// bla, bla, bla
return true;
case R.id.mnuNextBook:
pd = ProgressDialog.show(this, , Downloading next 
book...,
true);
new getNextBook_T().execute();
return true;
default:
return super.onOptionsItemSelected(item);
}
}

private class getNextBook_T extends AsyncTaskVoid, Void, Integer {
protected Integer doInBackground(Void... arg0 ) {
return getNextBook();
}
protected void onPostExecute(Integer result) {
pdDismisser();
setDisplay();
}
}

public Integer getNextBook(){
// bla, bla, bla
}

public void pdDismisser(){
pd.dismiss();
}

}

/code

-- 
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: ProgressDialog call from AsyncTask thread

2011-03-28 Thread john brown
TreKing,


 What does cannot get it to work mean?
Well... The following code does not produce any Eclipse errors but
does produce the Sorry! App has stopped unexpectedly... when I try
to run it on the emulator, AVD.

private class getNextBook_T extends AsyncTaskVoid, Void, Integer {
private ProgressDialog pd1;
protected Integer doInBackground(Void... arg0 ) {
pd1 = ProgressDialog.show(App01.this, , Downloading 
next
book..., true);
return getNextBook();
}
protected void onPostExecute(Integer result) {
pd1.dismiss();
setDisplay();
}
}

The DDMS LogCat display shows:
03-28 15:42:32.132: ERROR/AndroidRuntime(227): Caused by:
java.lang.RuntimeException: Can't create handler inside thread that
has not called Looper.prepare()

Thanks, John
I did get it to work. Your post prompted me to try it a different way.
I just didn't get it at first.

Thanks, John Brown


On Mar 28, 11:27 am, TreKing treking...@gmail.com wrote:
 On Mon, Mar 28, 2011 at 12:21 PM, john brown
 johnbrowngreybe...@gmail.comwrote:

   I want to call the ProgressDialog directly from the
  AsyncTask getNextBook_T, but I cannot get it to work.

 What does cannot get it to work mean?

  Is there a way to implement the ProgressDialog directly from getNextBook_T?

 Yes.

  Or is it OK (or necessary) to do it indirectly like the code shows?

 OK? Sure. Necessary? No.

 --- 
 --
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
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: ProgressDialog call from AsyncTask thread

2011-03-28 Thread john brown
Kostya,

Part of my problem is that I do not know enough to understand the
documentation. In this specific documentation I got lost when it said:
 publishProgress(...
 setProgressPercent(
 showDialog(.

I do not know what those lines mean. I type them in my code, they are
not recognized and produce errors in my editor. (eclipse)

(I am studying. I have ordered new books. etc)

Thanks, John Brown

On Mar 28, 11:26 am, Kostya Vasilyev kmans...@gmail.com wrote:
 John,

 You can use this method:

 http://developer.android.com/reference/android/os/AsyncTask.html#publ..)

  This method can be invoked from |doInBackground(Params...)| to publish
  updates on the UI thread while the background computation is still
  running. Each call to this method will trigger the execution of
  |onProgressUpdate(Progress...)| on the UI thread.
  |onProgressUpdate(Progress...)| will note be called if the task has
  been canceled.

 ... and its twin brother, onProgressUpdate:

  Runs on the UI thread after |publishProgress(Progress...)| is invoked.
  The specified values are the values passed to
  |publishProgress(Progress...)|.

 -- Kostya

 28.03.2011 21:21, john brown ?:









  I have a process, getNextBook, that takes maybe 5 or 20 seconds,
  depending on the size of the next book. It works OK but I need to
  inform the user that I'm working, just wait so they will not tell
  the App to do something else before the getNextBook process finishes.
  (the code for something else is not included for the sake of
  simplicity). I have included the display of a ProgressDialog so the
  user can see when it is working and when it finishes. I have
  experimented until I got it to work but there is something I do not
  understand. The code is abbreviated for the sake of simplicity and it
  does work even if I have created some error when I abbreviated.)

  I utilize AsyncTask to make another thread so I will not block the
  main thread. I want to call the ProgressDialog directly from the
  AsyncTask getNextBook_T, but I cannot get it to work. Is there a way
  to implement the ProgressDialog directly from getNextBook_T? Or is it
  OK (or necessary) to do it indirectly like the code shows?

  Thanks for your help

  code
  package very.long.name.App01;

  import android.app.Activity;
  import android.app.ProgressDialog;

  public class App01 extends Activity {
     private ProgressDialog pd;

     /** Called when the activity is first created. */
       @Override
       public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.main);
       }

       public boolean onOptionsItemSelected(MenuItem item) {
             String strTemp;
             switch (item.getItemId()) {
             case R.id.mnuCkSrv:
                     // bla, bla, bla
                     return true;
             case R.id.mnuNextBook:
                     pd = ProgressDialog.show(this, , Downloading next 
  book...,
  true);
                     new getNextBook_T().execute();
                     return true;
             default:
                     return super.onOptionsItemSelected(item);
             }
       }

     private class getNextBook_T extends AsyncTaskVoid, Void, Integer  {
             protected Integer doInBackground(Void... arg0 ) {
                     return getNextBook();
             }
             protected void onPostExecute(Integer result) {
             pdDismisser();
             setDisplay();
             }
     }

     public Integer getNextBook(){
     // bla, bla, bla
     }

     public void pdDismisser(){
             pd.dismiss();
     }

  }

  /code

 --
 Kostya Vasilyev --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] Re: ProgressDialog call from AsyncTask thread

2011-03-28 Thread john brown
Kostya,

 Back to your error message. What it means (in translation from
 Androidese) is that your code tries to create a UI component
 (ProgressDialog) from the worker thread. This violates the rule that you
 can only touch the UI from the UI thread.

Bingo! That is what I was guessing all this means. With that bit of
information, maybe I will can learn a little more. Now I know why the
first code works and the second one does not.

Thanks Kostya, John Brown

On Mar 28, 2:39 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 29.03.2011 0:21, john brown пишет:

  Kostya,

  Part of my problem is that I do not know enough to understand the
  documentation. In this specific documentation I got lost when it said:
            publishProgress(...
            setProgressPercent(
            showDialog(.

 AsyncTask is pretty simple. It has two sides: the worker thread and the
 UI thread.

 Your code that performs a lengthy operation on the worker thread can
 call publishProgress(), which is automatically dispatched to the UI
 thread and turned into onProgressUpdate().

 This is needed because Android UI components can only be used from the
 UI thread, and AsyncTask's doInBackground() runs on a worker thread
 (which is AsyncTask's reason for existence).

 UI thread is defined here:

 http://developer.android.com/guide/topics/fundamentals/processes-and-...

 which also gives some simple rules to follow when dealing with threads
 on Android.

 Back to your error message. What it means (in translation from
 Androidese) is that your code tries to create a UI component
 (ProgressDialog) from the worker thread. This violates the rule that you
 can only touch the UI from the UI thread.

  I do not know what those lines mean. I type them in my code, they are
  not recognized and produce errors in my editor. (eclipse)

 Yes, you really need to know at least the basics of Java to program with it.

 -- Kostya

  (I am studying. I have ordered new books. etc)

  Thanks, John Brown

 --
 Kostya Vasilyev --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] published app not found by android market search

2011-02-14 Thread john brown
I have published an application. I have two beta users that have
utilized android market to download the application. They downloaded
and installed the app and it worked. This activity was a month or so
ago. The application does show up in my Developer Console today.

But when I search for the application, it is not found.

I search for the application exactly as the name appears in developer
console. I search for the application with just the name w/o the
version.

Thanks, John Brown

-- 
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] Market - download unsuccessful

2010-10-28 Thread john brown
Hello,

I have published my app on Android Market. I have successfully
downloaded and installed the app from Market on my Moto Droid 10 days
ago. My beta tester #1 successfully downloaded and installed the app
from Market on his Samsung Galaxy 8 days ago. My beta tester #2 gets
download unsuccessful when she tries to dowload app from Market on
her Motorola Droid X at 2010-10-28 4pm Central Std time USA (10pm
GMT). She tried several times over a 30 minute period. When I
uninstalled and tried to download my app during this same time period,
it took longer than I expected, then finished and said Google Maps had
successfully updated. No mention that my app did or did not install.
My app is not installed on my phone now.

Developer's Console shows no problem, 20 downloads, 4 active, no
errors, no comments. (This app is industry specific and not workable
without subscription to a website, etc.)

Does Market work perfectly everytime? Does it have good times and bad
times? If you think it may be my app that is the problem, what / where
should I look for as the problem?

Thanks, John Brown

-- 
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: Market - download unsuccessful

2010-10-28 Thread john brown
Now when I goto Market, my app is shown as found and when I click on
it I get the Info Screen but it seems to already be in the download
mode, i.e.. cancel download is the only option.

I will re-boot. Thanks, John

On Oct 28, 3:38 pm, john brown johnbrowngreybe...@gmail.com wrote:
 Hello,

 I have published my app on Android Market. I have successfully
 downloaded and installed the app from Market on my Moto Droid 10 days
 ago. My beta tester #1 successfully downloaded and installed the app
 from Market on his Samsung Galaxy 8 days ago. My beta tester #2 gets
 download unsuccessful when she tries to dowload app from Market on
 her Motorola Droid X at 2010-10-28 4pm Central Std time USA (10pm
 GMT). She tried several times over a 30 minute period. When I
 uninstalled and tried to download my app during this same time period,
 it took longer than I expected, then finished and said Google Maps had
 successfully updated. No mention that my app did or did not install.
 My app is not installed on my phone now.

 Developer's Console shows no problem, 20 downloads, 4 active, no
 errors, no comments. (This app is industry specific and not workable
 without subscription to a website, etc.)

 Does Market work perfectly everytime? Does it have good times and bad
 times? If you think it may be my app that is the problem, what / where
 should I look for as the problem?

 Thanks, John Brown

-- 
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 adb connection to Samsung Galaxy

2010-10-15 Thread john brown
Hello,

This month, I am not able to get a ATT Samsung Galaxy Captivate to be
recognized by my Win xp when I connect them with a USB cable. This is
the same phone I had trouble connecting a few months back. With much
help from this list, I was able to get them connected. (Win device
mngr, red check mark, get ID, insert this ID in android_winusb.inf
file and reinstall android sdk usb driver.) After the fix,
communication was successfull for Aug and Sept (about 10 connections
per monthduring a 5 day period). But this month the Win xp will not
recognize the phone. The only thing that happens is that the device
manager, usb, list is updated to include unknown device which has no
ID's. I have talked to ATT and Samsung. One person said that there
was an update Oct 5 and this bit of information got me introduced to
Samsung tech suppor level 1 and then, after considerable talking, to
level 2. Samsung level 2 said that I must have the specific USB cable
that came in the box with the phone, I said that probably was not the
problem because I have used this (motorola) cable successfully at
least 20 times. Then all of a sudden I get a dial tone. So I drove the
20 miles, went into the owners home (while talking to him on his
phone, he has mine to use beta testing) and got the cable. Results are
the same with this Samsung cable. I am writting this long note becasue
I have lots of time waiting for 50 minutes for level 2 support again.
I am loosing hope that Samsung is going to be able to help me or
possibly they recognize my phone # and know my problem is
unresolovable.

Does anybody have any light they can shed on this issue?

Thanks, John Brown

-- 
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] String.split(\t) results vary with source of string

2010-09-28 Thread john brown
Hello,

My understanding of String.split() and \t and \n seems to be
incomplete. (I come from a DOS, Win, and VB enviornment.) I am in the
habit of using Tab delimited 'records' in a text file where the
records are delimited by CRLF. VB uses constants like vbTab and vbCrLf
to refer to tabs and line feeds. And the Linux, Android enviornment
utilizes \t and \n for the same things.

The following code yields (I think) different responses depending on
the source of strResponse. If strResponse originates in my Android
Java code (as a paramater constructed in the code), the following code
works just fine. But if strResponse is parsed from html document
created by me using PHP on the server, then the two Log.d's produce
exactly the same thing, the record which contains several \t.

// Start Code *
String strRecords[] = strResponse.split(\n);
String strFields[];
Integer i;
for (i = 0; i  strRecords.length; i++){
strFields = strRecords[i].split(\t);
Log.d(NQ109, TAG +  in addTaps strRecords[i] =  + strRecords[i]);
Log.d(NQ109, TAG +  in addTaps strFields[0] =  + strFields[0]);
}
// End Code *

I also tried to utilize |, the pipe symbol, chr(124), but that just
seems to split the record into an array of individual characters.

What is the error in my understanding of the split() method?

http://developer.android.com/reference/java/lang/String.html#split(java.lang.String)
does not seem to go deep enough for me to figure it out.

Thanks, John Brown

-- 
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: String.split(\t) results vary with source of string

2010-09-28 Thread john brown
Well, I thought I found the answer at a Java site. It said if you use
the | it must be \\'ed then it will work. It looked like a solution
but when I tried it I got the same results.

         strFields = strRecords[i].split(\\|);

With the |'s, strRecords[i] looks like:
R|2251|1|15,008.05|250|Maple Street|Smith, John|1848|..

After
         strFields = strRecords[i].split(\\|);
strFields[0] looks like:
R|2251|1|15,008.05|250|Maple Street|Smith, John|1848|..
and it should just be R.

I am confused.

Thanks, John Brown
On Sep 28, 11:06 am, john brown johnbrowngreybe...@gmail.com wrote:
 Hello,

 My understanding of String.split() and \t and \n seems to be
 incomplete. (I come from a DOS, Win, and VB enviornment.) I am in the
 habit of using Tab delimited 'records' in a text file where the
 records are delimited by CRLF. VB uses constants like vbTab and vbCrLf
 to refer to tabs and line feeds. And the Linux, Android enviornment
 utilizes \t and \n for the same things.

 The following code yields (I think) different responses depending on
 the source of strResponse. If strResponse originates in my Android
 Java code (as a paramater constructed in the code), the following code
 works just fine. But if strResponse is parsed from html document
 created by me using PHP on the server, then the two Log.d's produce
 exactly the same thing, the record which contains several \t.

 // Start Code *
 String strRecords[] = strResponse.split(\n);
 String strFields[];
 Integer i;
 for (i = 0; i  strRecords.length; i++){
         strFields = strRecords[i].split(\t);
         Log.d(NQ109, TAG +  in addTaps strRecords[i] =  + strRecords[i]);
         Log.d(NQ109, TAG +  in addTaps strFields[0] =  + strFields[0]);}

 // End Code *

 I also tried to utilize |, the pipe symbol, chr(124), but that just
 seems to split the record into an array of individual characters.

 What is the error in my understanding of the split() method?

 http://developer.android.com/reference/java/lang/String.html#split(ja...)
 does not seem to go deep enough for me to figure it out.

 Thanks, John Brown

-- 
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: String.split(\t) results vary with source of string

2010-09-28 Thread john brown
Oops!

The \\ actually did work. It just let me get further into my code
where I discovered other errors.

I think I can work out of this problem but I would like to understand
this subject better if anybody can shed any light in this direction.

Thanks, John Brown

On Sep 28, 1:54 pm, TreKing treking...@gmail.com wrote:
 On Tue, Sep 28, 2010 at 12:06 PM, john brown
 johnbrowngreybe...@gmail.comwrote:

  What is the error in my understanding of the split() method?

 I don't have an actual answer for you, but I ran into the same issue where I
 was trying to parse a server response string delimited by the pipe and it
 failed miserably, as you've seen. The asterisk * was also a problem if I
 recall correctly.

 I didn't investigate too thoroughly, but I think these (and probably others)
 might be special characters in the split logic for regex stuff, but that's
 just a guess.

 If you have control over the server, I'd say just use a different delimiter.
 If you don't, you can do what I did and first replace the offending
 character with something else you know will not exist in the string and
 split on that. Lame, but it works.

 --- 
 --
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
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] LogCat and threads

2010-09-22 Thread john brown
Hello,

I am trying to understand threads and how they work, and when, etc. I
expected the pid in LogCat to be different in the background thread
logs but the pid is always the same.

Is the pid something other than the thread ID? If it is, is there a
way to indicate the thread ID in LogCat?

Thanks, John Brown

-- 
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] Service, AsyncTask, or both?

2010-09-21 Thread john brown
My application collects information entered by the user and stores it
in a sqlite database. The information is observed and entered every
few minutes. Each observation, or entry, becomes a record in a
database table. Each record needs to be transmitted via httpClient to
a server as soon as possible. The user, phone, may have intermittent
service. Each record is stored in the database immediately with a
isSent flag set to false. Next, I use AsyncTask to start a thread
separate from the UI thread, and attempt to transmit all the records,
one at a time, where isSent is false. If a record is successfully
transmitted, isSent is set to true. If httpClient gets a timeout or
page not found, I interperet that as no service and break out of the
process. I have all this written and successfully beta tested. (with
much help from this group. THANK YOU Android Developers Group.)

I used a Service in my first attempt at the routine to transmitt the
records. The documentation of Service indicated something about long
processes working w/o user input. But I found when there was no
internet connection, the routine took too long and I got a
application not responding error because the wait was in the UI
thread. I reprogrammed it utilizing AsyncTask to start a seperate
thread for the transmitt process and this seems to work w/o error.
During my reprogramming, I was confused on how to utilize both a
service and a AsyncTask, so I just did it without utilizing a Service.

Was my decision to drop the Service a good choice? Or am I missing
something useful offered by Service that would benifit this situation?

Thanks, John Brown

-- 
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 can i access the /data/data/my_project_name/files/my_file.txt on a real android device

2010-09-17 Thread john brown
Linda,

I am new to Android. I had my app on a Microsoft phone and used .txt
files for data storage. It seemed like a good idea on the Microsoft
smartphone and it worked.

I did the same with my app on the Android and found that unexpected
things happen with text files on the Android. Things like the path to
the sdcard changed with versions and also with different devices, i.e.
ATT androids have two sdcards and there are little complications. I
am not saying that Android cannot handle txt files. My thinking is
that on Android data storage is designed to work with sqlite
database.

(I like the Android development environment much better than
Microsoft!)

I converted my data storage to utilize sqlite database. My impression
is that everything works smoother (with my app) when I use sqlite
database. I can make it work with .txt files but it seems like that is
like paddling upstream. And paddling downstream is better.

HTH, John Brown

On Sep 17, 3:10 am, Lidia lidyp...@yahoo.com wrote:
 Hello to all,

 I wrote a file o the phone from my application in the following path:
 /data/data/my_project_name/files/my_file.txt
 If i run the application in emulator, i can see my file created in
 this path.
 but if i run the application on a real device, i can't see this file.

 Using DDMS from the eclipse the data folder from the phone has
 permissions drwxrwx--x  - what does this mean?
  and when i try to expend the +data , it seems to be empty.

 I use the Astro programm to access the data folder from the phone,
 and it seems to be empty.

 Is the content hidden of this folder, and there is not a way to see
 what it contains?

 Thanks
 Lidia

-- 
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] HttpClient routine works but w/o connection, it times out?

2010-09-17 Thread john brown
Hello,

This code does what I want and works just fine as long as there is
service or an internet connection.

*** code **
   public static String getHTTPresult(String URLwithGet){
Log.d(MP103, TAG + start
getHTTPresult);
String strTemp = this is a XX test;
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(URLwithGet);
Log.d(MP103, TAG + executing request  + httpget.getURI());
ResponseHandlerString responseHandler = new
BasicResponseHandler();
String responseBody = ;
Log.d(MP103, TAG + just before try );
try {
responseBody = httpclient.execute(httpget, 
responseHandler);
} catch (ClientProtocolException e) {
e.printStackTrace();
Log.d(MP103, TAG + error in getHTTPresult,
ClientProtocolException =  + e.toString());
} catch (IOException e) {
Log.d(MP103, TAG + error in getHTTPresult, IOException = 
+ e.toString());
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
Log.d(MP103, TAG + error in getHTTPresult, Exception =  +
e.toString());
Log.d(MP103, e.toString());
}
Log.d(MP103, TAG + after try catch );
if (responseBody == ) {
Log.d(MP103, TAG + responseBody = '');
responseBody = http error, responseBody = '';
}
else {
Log.d(MP103, TAG + responseBody !== '');
//Log.d(MP103, TAG + responseBody);
}
Log.d(MP103, TAG + end
getHTTPresult);
httpclient.getConnectionManager().shutdown();
return responseBody;
}
*** end code 

My beta tester had trouble when he was out of service. His description
was it froze up.
When I test on the emulator, I unplug the network cable, and thus have
no connection. On the emulator, in the routine listed above, it seems
to work just fine although it takes a while before returning
UnknownHost. I say it works just fine because of what I can see in
the Log results.

It does however display the error Application MyApp (in process
mnt.android.myapp.MA103) is not responding. along with a Force Close
button and a Wait button. If I wait a moment and press the Wait
button, the app proceeds like it should.

What can I do to avoid the long wait (and error) when there is no
service?

Thanks, John Brown

-- 
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] Verizon Moto droid auto update to 2.2 yesterday

2010-09-16 Thread john brown
Hello,

Yesterday my Verizon Motorola droid was automatically updated from
Android 2.1 to 2.2. I was informed that it had been done via text
message. I was not consulted or warned, only informed after the fact.
It does not cause any problem in my app. I used the getSDcardPath
(syntax approx) rather than hard-coding /sdcard/data. and I have
not found any other conflicts.

How are Android updates handled on devices? Always done automatically,
this instance of auto update was unusual, or what?

If it is always done automatically then we MUST incorporate all
accommodations for future changes that are not backwards compatible
just to keep our apps running on machines that they were designed to
run on. (it is difficult to anticipate all future changes!)

Previous to this automatic update, I was thinking that we should
incorporate all accommodations for future changes that are not
backwards compatible so the app would run on future Android versions.
(this option does not require knowledge of the future.)

Thanks, John Brown

PS. I did opt to do the Adobe update yesterday. But that just seemed
like a normal application update. No indication that it affected
anything else.

-- 
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: Verizon Moto droid auto update to 2.2 yesterday

2010-09-16 Thread john brown
Bret,

Specific case:
File myFile = android.os.Enviornment.getExternalStorageDirectory;
String strPath = myFile.toString();

The code above is the work around for an expected update that changed
the path to the external SDcard storage. This list and
developer.android.com documentation gave warning that reference to the
external storage should not be hard coded like /sdcard/Android/
data/... (2.2 path is something like /mtd/Android/data/...) and
that the listed code should be used. I followed the advice and avoided
any problems.

I also am new to Android. The os, java, Eclipse, the toolkit, the
documentation, and this list are all very good and have helped me a
lot.

But I was surprised that Verizon updated my os without warning or
consent. They did notify me after the fact. I am just wondering if
this is common or unusual. (Maybe I am just too cautious because of my
previous experiences. I would consider it quite a calamity if
Microsoft updated my XP's to Vistas.)

Happy coding, John Brown

On Sep 16, 10:49 am, Bret Foreman bret.fore...@gmail.com wrote:
 I occasionally put in some code to work around a bug in the OS. When I
 do, I always surround it with a conditional on the OS version. And
 deprecated methods seem to continue working for several more OS
 versions, giving active developers a chance to update before the old
 methods break. Have you seen or read of any specific cases that could
 not be addressed either by conditionals in the code or long support
 for deprecated methods?

-- 
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: mTelephonyMgr.getLineNumber1() returns null

2010-09-15 Thread john brown
Dear Self,

I found the problem. I had unintentionally and unknowingly changed the
Manifest. Something was wrong with the:
uses-permission android:name=android.permission.READ_PHONE_STATE/
uses-permission
line.

Eclipse tells me now that there is a problem with the Manifest if I
change name to nme.
But Eclipse does not register an error when it says:
uses-permission android:name=READ_PHONE_STATE/uses-permission

Anyway it is solved.

Thanks, John Brown





On Sep 14, 2:23 pm, john brown johnbrowngreybe...@gmail.com wrote:
 This was working at one time in development but now it does not seem
 to be working.

 I am using the emulator right now and it DID return 218135 before
 (a few days ago) but now it is returning null.

 I have uses-permission
 android:name=android.permission.READ_PHONE_STATE/uses-permission
 listed in the AndroidManifest.xml.

 I do not know of anything I changed that should affect this.

 I would appreciate any comments or suggestions.

 Thanks, John Brown

-- 
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] TelephonyManager getLine1Number() returns 10 or 11 characters?

2010-09-15 Thread john brown
It seems this code:
//***
TelephonyManager mTelephonyMgr =
(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);

phoneID = mTelephonyMgr.getLine1Number();
//

returns different phone number format on different devices.
Specifically:
Motorlola droid from Verizon returns:   780563 (length 10)
AVD with HVGA skin returns:   1218135 (length 11)
Samsung Galaxy from ATT returns: 17805639998 (length 11)

I can get rid of the leading 1 where it exists or I can add 1 to
make them all the same if this is all inclusive of what is returned.

What should I expect in variation from this routine?

Thanks, John Brown

-- 
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] mTelephonyMgr.getLineNumber1() returns null

2010-09-14 Thread john brown
This was working at one time in development but now it does not seem
to be working.

I am using the emulator right now and it DID return 218135 before
(a few days ago) but now it is returning null.

I have uses-permission
android:name=android.permission.READ_PHONE_STATE/uses-permission
listed in the AndroidManifest.xml.

I do not know of anything I changed that should affect this.

I would appreciate any comments or suggestions.

Thanks, John Brown

-- 
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: ATT Samsung Captivate mExternalStorageAvailable == false;

2010-08-19 Thread john brown
Kostya,

 What state does the code return? Perhaps logging the actual value would
 be a good place to start.

Good idea. Unfortunately, I have limited access (time) to that phone
since it is in use as a in case of emergency call 123-4567 type
situation and that phone's owner must keep it with him at all times.
Also we are beta testing the app in actual usage and so he is having
to use my phone for that. So he has both phones and I have, for the
next few days, the emulator.

But that gives me time to step back and look at what I have done so
far. I am new to android. I need to figure out which if I am using any
processes that can be classified as fighting the system. I have had
problems with using flat text data files on the sdcard to store,
receive, delete, etc information. This information could be kept in a
database. The database seems like overkill to me but it might be that
data files on the sdcard are going to be headaches if I want to use
several different devices. Maybe the database would work smoothly from
device to device.

I think I will write a general description of my app, post it on this
helpful list, and ask for advice as to which architectures to use and
which to avoid.

Thank you Kostya. John Brown


On Aug 19, 12:35 am, Kostya Vasilyev kmans...@gmail.com wrote:
   John,

 What state does the code return? Perhaps logging the actual value would
 be a good place to start.

 System.out.println(in cksdcard, Something else is wrong, state =  + state);

 The output from ls -l does seem weird. On my Galaxy S (not quite the
 same thing, but close), I get this:

 drwxrwxr-x system sdcard_rw 2010-08-19 09:51 sdcard

 -- Kostya

 19.08.2010 0:52, john brown пишет:





  Hello,

  I have my application running on a Motorola droid. We have
  successfully used it in the intended enviornment for 2 days collecting
  340 readings. The app is not full featured but it is running. The data
  storage is complete and we store, create, delete... small data files
  on the sdcard. Our design team prefers, in this application, the small
  files on the external storage sdcard and does not want to use sqlLite.

  My beta tester purchased aATTSamsungCaptivate (SamsungSGH-i897).
  It seems to have two sdcards. In an earlier thread on this list, they
  were referred to as an internal sdcard and an external sdcard. Our
  test unit has both installed. I am having trouble accessing the
  external storage sdcard. I utilized the code from
 http://developer.android.com/guide/topics/data/data-storage.htmlto
  determine if the sdcard is installed and readable and writeable. The
  code is:

       public static boolean cksdcard(){
             boolean mExternalStorageAvailable = false;
             boolean mExternalStorageWriteable = false;
             String state = Environment.getExternalStorageState();
             if (Environment.MEDIA_MOUNTED.equals(state)) {
                     // We can read and write the media
             System.out.println(in cksdcard, MEDIA_MOUNTED);
                     mExternalStorageAvailable = true;
                     mExternalStorageWriteable = true;
             }
             else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
                     // We can only read the media
             System.out.println(in cksdcard, MEDIA_MOUNTED_READ_ONLY);
                     mExternalStorageAvailable = true;
                     mExternalStorageWriteable = false;
                     }
             else {
                     // Something else is wrong. It may be one of many other 
  states,
  but all we need
                     //  to know is we can neither read nor write
             System.out.println(in cksdcard, Something else is wrong);
                     mExternalStorageAvailable = false;
                     mExternalStorageWriteable = false;
             }
             return mExternalStorageWriteable;
       }

  This code returns False which means it is neither readable or
  writeable. It prints the else - in cksdcard, Something else is
  wrong.

  The app will not run on theSamsungCaptivate because it cannot access
  the data files on the sdcard.

  Strangely, when I mount the device on the desktop computer, windows
  explorer shows two (2) connected usb drives which it calls E: and F:.
  E: is blank. I can copy the files to F:\Android\data\lms\mpT..
  with windows explorer. Windows explored does not show /sdcard
  anywhere, it is probably using an Alias?

  android.os.Environment.getExternalStorageDirectory() returns /sdcard
  on BOTH the Moto droid and theSamsungCaptivate.

  ''adb shell works on theSamsungCaptivate. ls -l /sdcard returns
  access denied or something like that. ls -l does show /sdcard in
  the root directory with the following attributes: d- which
  means the owner, group, and user (everybody) have no rights at all.

  Any suggestions how I might get read and write access to the sdcard on
  theATTSamsungCaptivate?

  Thanks, John Brown

[android-developers] Re: ATT Samsung Captivate mExternalStorageAvailable == false;

2010-08-19 Thread john brown
Stephen,

 For theSamsungGalaxy phones, the internal flash memory is mounted at
 /sdcard, and the external SD card is mounted at /sdcard/sd

Your comment explains why /sdcard/Android/data/lms/mp would fail
if I had indeed copied the files to /sdcard/sd/Android/data/lms/mp

But my memory is that
android.os.Environment.getExternalStorageDirectory() returns /
sdcard
on BOTH the Moto droid and the Samsung Captivate.

Unfortunately, I have limited access (time) to that phone since it is
in use as a in case of emergency call 123-4567 type
situation. So I will have to wait to test this possible solution.

Thanks, John Brown




On Aug 19, 11:00 am, Stephen Lau st...@grommit.com wrote:
 For theSamsungGalaxy phones, the internal flash memory is mounted at
 /sdcard, and the external SD card is mounted at /sdcard/sd

 cheers,
 steve





 john brown wrote:
  Hello,

  I have my application running on a Motorola droid. We have
  successfully used it in the intended enviornment for 2 days collecting
  340 readings. The app is not full featured but it is running. The data
  storage is complete and we store, create, delete... small data files
  on the sdcard. Our design team prefers, in this application, the small
  files on the external storage sdcard and does not want to use sqlLite.

  My beta tester purchased aATTSamsungCaptivate (SamsungSGH-i897).
  It seems to have two sdcards. In an earlier thread on this list, they
  were referred to as an internal sdcard and an external sdcard. Our
  test unit has both installed. I am having trouble accessing the
  external storage sdcard. I utilized the code from
 http://developer.android.com/guide/topics/data/data-storage.htmlto
  determine if the sdcard is installed and readable and writeable. The
  code is:

       public static boolean cksdcard(){
             boolean mExternalStorageAvailable = false;
             boolean mExternalStorageWriteable = false;
             String state = Environment.getExternalStorageState();
             if (Environment.MEDIA_MOUNTED.equals(state)) {
                     // We can read and write the media
             System.out.println(in cksdcard, MEDIA_MOUNTED);
                     mExternalStorageAvailable = true;
                     mExternalStorageWriteable = true;
             }
             else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
                     // We can only read the media
             System.out.println(in cksdcard, MEDIA_MOUNTED_READ_ONLY);
                     mExternalStorageAvailable = true;
                     mExternalStorageWriteable = false;
                     }
             else {
                     // Something else is wrong. It may be one of many other 
  states,
  but all we need
                     //  to know is we can neither read nor write
             System.out.println(in cksdcard, Something else is wrong);
                     mExternalStorageAvailable = false;
                     mExternalStorageWriteable = false;
             }
             return mExternalStorageWriteable;
       }

  This code returns False which means it is neither readable or
  writeable. It prints the else - in cksdcard, Something else is
  wrong.

  The app will not run on theSamsungCaptivate because it cannot access
  the data files on the sdcard.

  Strangely, when I mount the device on the desktop computer, windows
  explorer shows two (2) connected usb drives which it calls E: and F:.
  E: is blank. I can copy the files to F:\Android\data\lms\mpT..
  with windows explorer. Windows explored does not show /sdcard
  anywhere, it is probably using an Alias?

  android.os.Environment.getExternalStorageDirectory() returns /sdcard
  on BOTH the Moto droid and theSamsungCaptivate.

  ''adb shell works on theSamsungCaptivate. ls -l /sdcard returns
  access denied or something like that. ls -l does show /sdcard in
  the root directory with the following attributes: d- which
  means the owner, group, and user (everybody) have no rights at all.

  Any suggestions how I might get read and write access to the sdcard on
  theATTSamsungCaptivate?

  Thanks, John Brown

 --
 stephen lau | st...@grommit.com |http://whacked.net| @stevel

-- 
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: ATT Samsung Captivate mExternalStorageAvailable == false;

2010-08-19 Thread john brown
I do appreciate the comments and suggestions. They give me new things
to try.

The good news it the app is working on the Samsung SGH-i897 now. The
bad news is I do not know why. Here is what happened:

1) I hard coded /sdcard/sd rather than getting the path
programatically. (I did not have much time.)
2) I got the same error, something like path not found
3) I went back into the code and removed the hard coded path.
4) I added a System.out.println(ext storage is  + myPathVariable)
5) I ran it one more time just to check what the output path was
again.
6) It ran, no errors.
7) The output was ext storage is /sdcard/Android/data/lms/mp

That is the same path it printed when it got the error. A satisfactory
explanation would be that my memory is wrong or I did not type what I
thought I typed, but I cannot find the error.

I do not know why. But it is working. :)

I will test some more tomorrow.
I will stop using - Environment.getExternalStorageState()
I will try - Environment.getExternalStoragePublicDirectory()

Right now I am thinking it has more to do with the phase of the moon
than with concrete facts. Like it does not work Friday through
Wednesday. But it does work on Thursday!

Again thanks for all the help. John Brown

On Aug 19, 3:19 pm, Stephen Lau st...@grommit.com wrote:
 Best I've found is to look at the device model and see if it's the
 Incredible or Galaxy.  If it is, then use /emmc or /sdcard/sd as a
 special case, otherwise use getExternalStorageDirectory()

 Lame, but doesn't seem like there is much else to be done.

 cheers,
 steve





 Indicator Veritatis wrote:
  The problem you are having is a good example of why this API,
  Environment.getExternalStorageState(), is deprecated. As the online
  reference says, This call should be deprecated as it doesn't support
  multiple volumes. 

  But this is exactly the problem you encountered: the Galaxy S has TWO
  volumes, which they happen to call '/sdcard' and /sdcard/sd' -- a
  regrettable choice.

  Even more regrettable is that the same reference that says should be
  deprecated, still shows sample code that matches yours very closely.
  Nor does it say what to use in place of the should be deprecated
  API, though it seems to suggest using
  Environment.getExternalStoragePublicDirectory() might help.

  But see
 http://groups.google.com/group/android-developers/browse_thread/threa...
  also.

  On Aug 18, 1:52 pm, john brownjohnbrowngreybe...@gmail.com  wrote:
  Hello,

  I have my application running on a Motorola droid. We have
  successfully used it in the intended enviornment for 2 days collecting
  340 readings. The app is not full featured but it is running. The data
  storage is complete and we store, create, delete... small data files
  on the sdcard. Our design team prefers, in this application, the small
  files on the external storage sdcard and does not want to use sqlLite.

  My beta tester purchased a ATT Samsung Captivate (Samsung SGH-i897).
  It seems to have two sdcards. In an earlier thread on this list, they
  were referred to as an internal sdcard and an external sdcard. Our
  test unit has both installed. I am having trouble accessing the
  external storage sdcard. I utilized the code 
  fromhttp://developer.android.com/guide/topics/data/data-storage.htmlto
  determine if the sdcard is installed and readable and writeable. The
  code is:

       public static boolean cksdcard(){
           boolean mExternalStorageAvailable = false;
           boolean mExternalStorageWriteable = false;
           String state = Environment.getExternalStorageState();
           if (Environment.MEDIA_MOUNTED.equals(state)) {
                   // We can read and write the media
                   System.out.println(in cksdcard, MEDIA_MOUNTED);
                   mExternalStorageAvailable = true;
                   mExternalStorageWriteable = true;
           }
           else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
                   // We can only read the media
                   System.out.println(in cksdcard, 
  MEDIA_MOUNTED_READ_ONLY);
                   mExternalStorageAvailable = true;
                   mExternalStorageWriteable = false;
                   }
           else {
                   // Something else is wrong. It may be one of many other 
  states,
  but all we need
                   //  to know is we can neither read nor write
                   System.out.println(in cksdcard, Something else is 
  wrong);
                   mExternalStorageAvailable = false;
                   mExternalStorageWriteable = false;
           }
           return mExternalStorageWriteable;
       }

  This code returns False which means it is neither readable or
  writeable. It prints the else - in cksdcard, Something else is
  wrong.

  The app will not run on the Samsung Captivate because it cannot access
  the data files on the sdcard.

  Strangely, when I mount the device on the desktop computer, windows

[android-developers] ATT Samsung Captivate mExternalStorageAvailable == false;

2010-08-18 Thread john brown
Hello,

I have my application running on a Motorola droid. We have
successfully used it in the intended enviornment for 2 days collecting
340 readings. The app is not full featured but it is running. The data
storage is complete and we store, create, delete... small data files
on the sdcard. Our design team prefers, in this application, the small
files on the external storage sdcard and does not want to use sqlLite.

My beta tester purchased a ATT Samsung Captivate (Samsung SGH-i897).
It seems to have two sdcards. In an earlier thread on this list, they
were referred to as an internal sdcard and an external sdcard. Our
test unit has both installed. I am having trouble accessing the
external storage sdcard. I utilized the code from
http://developer.android.com/guide/topics/data/data-storage.html to
determine if the sdcard is installed and readable and writeable. The
code is:

public static boolean cksdcard(){
boolean mExternalStorageAvailable = false;
boolean mExternalStorageWriteable = false;
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state)) {
// We can read and write the media
System.out.println(in cksdcard, MEDIA_MOUNTED);
mExternalStorageAvailable = true;
mExternalStorageWriteable = true;
}
else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
// We can only read the media
System.out.println(in cksdcard, MEDIA_MOUNTED_READ_ONLY);
mExternalStorageAvailable = true;
mExternalStorageWriteable = false;
}
else {
// Something else is wrong. It may be one of many other states,
but all we need
//  to know is we can neither read nor write
System.out.println(in cksdcard, Something else is wrong);
mExternalStorageAvailable = false;
mExternalStorageWriteable = false;
}
return mExternalStorageWriteable;
}

This code returns False which means it is neither readable or
writeable. It prints the else - in cksdcard, Something else is
wrong.

The app will not run on the Samsung Captivate because it cannot access
the data files on the sdcard.

Strangely, when I mount the device on the desktop computer, windows
explorer shows two (2) connected usb drives which it calls E: and F:.
E: is blank. I can copy the files to F:\Android\data\lms\mpT..
with windows explorer. Windows explored does not show /sdcard
anywhere, it is probably using an Alias?

android.os.Environment.getExternalStorageDirectory() returns /sdcard
on BOTH the Moto droid and the Samsung Captivate.

''adb shell works on the Samsung Captivate. ls -l /sdcard returns
access denied or something like that. ls -l does show /sdcard in
the root directory with the following attributes: d- which
means the owner, group, and user (everybody) have no rights at all.

Any suggestions how I might get read and write access to the sdcard on
the ATT Samsung Captivate?

Thanks, John Brown

-- 
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] cannot find yesterdays post with 5 responses

2010-08-12 Thread john brown
Hello,

I posted a question yesterday about connected device not recognized
by adb or something like that. I checked last night and this morning
from home and found responses. Now when I am at the office, I cannot
find the post. If I search for John Brown it shows all of my posts
except the missing one. There were suggestions that I want to try but
I was expecting to look at the suggestions while I tried them.

Do posts disappear from this list?

Thanks, John Brown

-- 
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: cannot find yesterdays post with 5 responses

2010-08-12 Thread john brown
YuviDroid,

I can see my post via your link. But I cannot see it in Adroid
Developers group list.

I cannot see it. I cannot find it with search john brown. Search john
brown does bring up all my other posts.

Thanks for your help. John Brown

On Aug 12, 9:08 am, YuviDroid yuvidr...@gmail.com wrote:
 Mmm I can still see your post...dunno.
 Anyway, you can read it 
 here:http://groups.google.com/group/android-developers/browse_thread/threa...

 On Thu, Aug 12, 2010 at 4:48 PM, john brown 
 johnbrowngreybe...@gmail.comwrote:





  Hello,

  I posted a question yesterday about connected device not recognized
  by adb or something like that. I checked last night and this morning
  from home and found responses. Now when I am at the office, I cannot
  find the post. If I search for John Brown it shows all of my posts
  except the missing one. There were suggestions that I want to try but
  I was expecting to look at the suggestions while I tried them.

  Do posts disappear from this list?

  Thanks, John Brown

  --
  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.comandroid-developers%2Bunsubs 
  cr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 YuviDroid
 Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget to
 quickly access your favorite apps and contacts!)http://android.yuvalsharon.net

-- 
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: cannot find yesterdays post with 5 responses

2010-08-12 Thread john brown
Now I see it. I could have missed it before, that is possible even
though I looked several times.

Search john brown would not bring it up.

Thanks, John Brown

On Aug 12, 10:43 am, john brown johnbrowngreybe...@gmail.com wrote:
 YuviDroid,

 I can see my post via your link. But I cannot see it in Adroid
 Developers group list.

 I cannot see it. I cannot find it with search john brown. Search john
 brown does bring up all my other posts.

 Thanks for your help. John Brown

 On Aug 12, 9:08 am, YuviDroid yuvidr...@gmail.com wrote:



  Mmm I can still see your post...dunno.
  Anyway, you can read it 
  here:http://groups.google.com/group/android-developers/browse_thread/threa...

  On Thu, Aug 12, 2010 at 4:48 PM, john brown 
  johnbrowngreybe...@gmail.comwrote:

   Hello,

   I posted a question yesterday about connected device not recognized
   by adb or something like that. I checked last night and this morning
   from home and found responses. Now when I am at the office, I cannot
   find the post. If I search for John Brown it shows all of my posts
   except the missing one. There were suggestions that I want to try but
   I was expecting to look at the suggestions while I tried them.

   Do posts disappear from this list?

   Thanks, John Brown

   --
   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.comandroid-developers%2Bunsubs
cr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en

  --
  YuviDroid
  Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget to
  quickly access your favorite apps and 
  contacts!)http://android.yuvalsharon.net

-- 
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] Connecting to ATT Samsung Captivate Galaxy

2010-08-12 Thread john brown
Hello,

Does anyone have experience connecting to a ATT Samsung Captivate
Galaxy (Samsung SGH 1897). It runs Android 2.1. I have USB debugging
connected and USB connected on the phone but I cannot get the
desktop computer to recognize the sdcard via Windows Explorer or get
the devices recognized with adb devices.

I have successfully connected to my Motorola Droid. I was in the same
situation with it yesterday but, thanks to this very helpful list, I
am now in control of that device. (and my app runs on it!)

Many thanks, John Brown

(P.S. My beta tester insisted on the ATT phone because he already has
his family plan working with ATT. One device, one version, 
that's just a dream.)


-- 
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] connected Motorola Droid not recognized by adb

2010-08-11 Thread john brown
Hello,

I am trying to connect a Verizon Motorola Droid (Android 2.1) to my
computer and Run my application on the device. I have followed the
instructions on developer.android.com about how to install the USB
driver and set up the device for development.

Specifically, I installed the Usb driver from whithin Eclipse
(galileo) using the Adnroid SDK and AVD Manager. (I checked adb at
this time and no recognition.) Then I installed the driver in windows
(XP) via Start  Control Panel  Add Hardware. The windows
installation seemed to work because during or after the installation
of the C:\android-sdk-windows\usb_driver some window came up and
announced that the adb bla.. bla. was installed successfully.

On the device I have enabled debugging via Settings  Applications 
Development  USB debugging is checked. I also bring down the tri fork
thing and mount the sdcard. I can successfully copy files to and
from the device sdcard.

My application successfully runs on the ADV and I can access the ADV
sdcard using adb push and adb shell.

With the moto droid connected, mounted, etc, if I run the command
prompt adb command adb devices the resulting list is empty. No
devices recognized.

With the ADV running and the moto droid connected, mounted, etc, if I
run the command prompt adb command adb devices the resulting list
shows only the emulator-5554   device. (this is the same thing it
shows if the moto droid is not connected and only the ADV is running).

If I Run from Ecipse with the device connected, debugging, and
mounted, an instance of the ADV is launched and the program runs on
the ADV, not the device.

I cannot get anything to recognize that the device is connected.

My conclusion is that the android debug bridge, adb, is not
recognizing the device.

I would appreciate any suggestions on how to get adb to recognize and
work with my device.

Thanks to all persons for previous favors and advice. John Brown

P.S.
Verizion website has a fix for device not recognized that is called
DriverBoost and will update all your USB driver to the official
version. I did not like the sound of Verizon fixing all my drivers
when I am only having trouble with Verizon's Moto droid but I
downloaded it anyway. this is the actual quote:
DriverBoost scans your PC and uniquely identifies each and every
device driver. Then using a sophisticated matching algorithm every
device driver on your PC is matched with the latest version of that
driver on our proprietary database. New drivers are then quickly
downloaded onto your computer.
I went to install DriverBoost and it quickly informs me that the first
thing it will do is install the latest version of Microsoft.net. I
DROPPED IT LIKE A HOT POTATO.

-- 
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: connected Motorola Droid not recognized by adb

2010-08-11 Thread john brown
Frank,

Yes. (I cannot check right now. That computer is at the office.) But
that sounds exactly like what I see on the droid. The debugging
connected notification requires no action. The other one, USB
connected, requires that I click it and then press button to mount
it on my computer.

Things seem to be working on the droid but the desktop computer, and
adb in particular, does not know that the droid is attached.

Thanks,  John Brown

On Aug 11, 7:17 pm, Frank Weiss fewe...@gmail.com wrote:
 I run Windows XP, have a Droid, and use Eclipse.

 When I plug the USB cable into the Droid, there are two notification
 icons: the forked USB icond and the exclamation mark in a triangle.
 When I open the notifications list, there's USB debugging connected
 and USB connected.

 Are you seeing these notification icons?

-- 
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: HTC Droid Eris - Accessing SD Card

2010-08-11 Thread john brown
I had a post on this subject recently. The solution suggested fixed my
problem. I was getting the exact same error message. I do not know for
sure if our problems are the same but I would sure try the solution
they gave me. Search for   on sdcard, File.canRead() = true,
File.canWrite() = false 

The solution was:

Did you add this to your application's manifest?
uses-permission
android:name=android.permission.WRITE_EXTERNAL_STORAGE /
-- Kostya

HTH, John Brown

On Aug 9, 7:51 pm, Justin Rich richma...@gmail.com wrote:
 I wrote an app that saves a camera picture to the SD card, then
 accesses the file later to display it into an ImageView.  This works
 fine for all devices except the HTC Droid Eris (maybe the version Eris
 is running?):

 ImageView img = (ImageView) findViewById(R.id.ImgProfile1);

 BitmapFactory.Options options = new BitmapFactory.Options();
 options.inSampleSize = 4;
 Bitmap bm = BitmapFactory.decodeFile(sdcard/ + filename, options);
 img.setImageBitmap(bm);

 Is there a different method of referring to the sdcard location on
 1.5, 1.6, or the Eris itself?  Any help would be great.

-- 
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: connected Motorola Droid not recognized by adb

2010-08-11 Thread john brown
Frank,

I do not see that on this machine and I do not think it is on my main
machine.

just to make sure I understand what you are saying:

 On my machine
This is the desktop computer?

 in Device Manager
In Eclipse? Android SDK and AVD Manager?

 Android Composite ADB Interface
under Virtual Devices? Installed Packages?

Thanks, John Brown

On Aug 11, 8:25 pm, Frank Weiss fewe...@gmail.com wrote:
 On my machine, in Device Manager, there's Android Composite ADB Interface.

-- 
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] on sdcard, File.canRead() = true, File.canWrite() = false

2010-08-09 Thread john brown
Hello,

Documentation source  
http://developer.android.com/guide/topics/data/data-storage.html

Every Android-compatible device supports a shared external storage
that you can use to save files. This can be a removable storage media
(such as an SD card) or an internal (non-removable) storage. Files
saved to the external storage are world-readable and can be modified
by the user when they enable USB mass storage to transfer files on a
computer.

PROBLEM: I cannot write to a file on the sdcard.
QUESTION: Is it possible to write to a file on the sdcard?

If YES, what do I need to do to make File.canWrite = true?

I am using Android 2.1 update 1, API level 7, Eclipse, and HVGA skin.

I am running my app / troubleshooting on the Android SDK ADV.

When the AVD is running, I check settings  sdcard total 49.21MB,
available 49.07MB.

Environment.getExternalStorageState() yields  MEDIA_MOUNTED

getExternalStorageDirectory() to establish the sdcard root directory.

I copied the files to the sdcard with adb push source destination

I am able to successfully read other files in that directory.

psudo code:
// __
File fFile = new File(pathFile);
if (fFile.exists()){ ... // returns true
if (fFile.canRead()){ ... // returns true
if (fFile.canWrite()){ ... // returns false
try{
FileWriter Fw = new FileWriter(fFile, true);
BufferedWriter Bw = new BufferedWriter(Fw);
PrintWriter outPw = new PrintWriter(Bw, true);
outPw.println(strRec);
outPw.close();
}

catch(IOException ex){
System.out.println(IO Error -  + ex.toString());
System.exit(0);
}

// 

System.out shows:
IO Error - java.io.FileNotFoundException
but we know the file is there from the preceding checks:
if (fFile.exists()){ ... // returns true
if (fFile.canRead()){ ... // returns true

What do I need to do to make the file writable?
Or
I want to write to the file. What am I doing wrong?

Thanks, John Brown

P.S.
I got a command prompt via c:\Program Files\Android-SDK\tools adb
shell

# ls -l /sdcard/Android/data/lms
rwxr-x systemsdcard_rw63   2010-07-19 15:17
mpReadAbDdx201006.txt
rwxr-x systemsdcard_rw 45211   2010-07-19 15:17
mpTranAbDdx201006.txt

The way I read this is that the owner's rights are ---, group is rwx,
others is r-x. I'm just guessing, the application is others?

But I cannot get chmod to change the attributes, i.e.:

# chmode o-rwx /sdcard/Android/data/lms/mpReadAbDdx201006.txt
Bad mode

(I get the same file attributes when I copy file to sdcard via  DDMS
File Explorer.)

Where can I find documentation to the Android linux (?) commands? (I
mean the command line commands)

-- 
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: on sdcard, File.canRead() = true, File.canWrite() = false

2010-08-09 Thread john brown
SOLVED! THANK YOU Android-Developers group!

Thank you so much for your help. It is wonderful to have someplace to
go for answers.

John Brown

On Aug 9, 11:59 am, john brown johnbrowngreybe...@gmail.com wrote:
 Hello,

 Documentation source 
 http://developer.android.com/guide/topics/data/data-storage.html

 Every Android-compatible device supports a shared external storage
 that you can use to save files. This can be a removable storage media
 (such as an SD card) or an internal (non-removable) storage. Files
 saved to the external storage are world-readable and can be modified
 by the user when they enable USB mass storage to transfer files on a
 computer.

 PROBLEM: I cannot write to a file on the sdcard.
 QUESTION: Is it possible to write to a file on the sdcard?

 If YES, what do I need to do to make File.canWrite = true?

 I am using Android 2.1 update 1, API level 7, Eclipse, and HVGA skin.

 I am running my app / troubleshooting on the Android SDK ADV.

 When the AVD is running, I check settings  sdcard total 49.21MB,
 available 49.07MB.

 Environment.getExternalStorageState() yields  MEDIA_MOUNTED

 getExternalStorageDirectory() to establish the sdcard root directory.

 I copied the files to the sdcard with adb push source destination

 I am able to successfully read other files in that directory.

 psudo code:
 // __
 File fFile = new File(pathFile);
 if (fFile.exists()){ ... // returns true
 if (fFile.canRead()){ ... // returns true
 if (fFile.canWrite()){ ... // returns false
 try{
         FileWriter Fw = new FileWriter(fFile, true);
         BufferedWriter Bw = new BufferedWriter(Fw);
         PrintWriter outPw = new PrintWriter(Bw, true);
         outPw.println(strRec);
         outPw.close();

 }

 catch(IOException ex){
         System.out.println(IO Error -  + ex.toString());
         System.exit(0);

 }

 // 

 System.out shows:
 IO Error - java.io.FileNotFoundException
 but we know the file is there from the preceding checks:
 if (fFile.exists()){ ... // returns true
 if (fFile.canRead()){ ... // returns true

 What do I need to do to make the file writable?
 Or
 I want to write to the file. What am I doing wrong?

 Thanks, John Brown

 P.S.
 I got a command prompt via c:\Program Files\Android-SDK\tools adb
 shell

 # ls -l /sdcard/Android/data/lms
 rwxr-x system    sdcard_rw        63   2010-07-19 15:17
 mpReadAbDdx201006.txt
 rwxr-x system    sdcard_rw     45211   2010-07-19 15:17
 mpTranAbDdx201006.txt

 The way I read this is that the owner's rights are ---, group is rwx,
 others is r-x. I'm just guessing, the application is others?

 But I cannot get chmod to change the attributes, i.e.:

 # chmode o-rwx /sdcard/Android/data/lms/mpReadAbDdx201006.txt
 Bad mode

 (I get the same file attributes when I copy file to sdcard via  DDMS
 File Explorer.)

 Where can I find documentation to the Android linux (?) commands? (I
 mean the command line commands)

-- 
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] sdcard MEDIA_MOUNTED, File.canRead = true, File.canWrite = false

2010-08-06 Thread john brown
Hello,

I am using Android 2.1 update 1, API level 7, Eclipse, and HVGA skin.

When the AVD is running, I check settings  sdcard total 49.21MB,
available 49.07MB.

Programatically checking Environment.getExternalStorageState() equals
MEDIA_MOUNTED which I think means that the sdcard is available and
writeable.

I use getExternalStorageDirectory() to establish the sdcard root
directory.

I copied the files on the sdcard with adb push source destination.

I am able to successfully read other files in that directory.

code to write to file:
//*

File fFile = new File(pathFile);
if (fFile.exists()){ ... // returns true
if (fFile.canRead()){ ... // returns true
if (fFile.canWrite()){ ... // returns false

try{
FileWriter Fw = new FileWriter(fFile, true);
BufferedWriter Bw = new BufferedWriter(Fw);
PrintWriter outPw = new PrintWriter(Bw, true);
outPw.println(strRec);
outPw.close();
}
catch(IOException ex){
System.out.println(IO Error -  + ex.toString());
System.exit(0);
}

//
System.out shows:
IO Error - java.io.FileNotFoundException

but we know the file is there from the preceding checks:
if (fFile.exists()){ ... // returns true
if (fFile.canRead()){ ... // returns true

What do I need to do to make the file writable?
Or
I want to write to the file. What am I doing wrong?

Thanks, John Brown

-- 
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: sdcard MEDIA_MOUNTED, File.canRead = true, File.canWrite = false

2010-08-06 Thread john brown
I got a command prompt via c:\Program Files\Android-SDK\tools adb
shell

# ls -l /sdcard/Android/data/lms
rwxr-x systemsdcard_rw63   2010-07-19 15:17
mpReadAbDdx201006.txt
rwxr-x systemsdcard_rw 45211   2010-07-19 15:17
mpTranAbDdx201006.txt

The way I read this is that the owner's rights are ---, group is rwx,
others is r-x. I'm just guessing, the application is others?
But I cannot get chmod to change the attributes, i.e.:

# chmode o-rwx /sdcard/Android/data/lms/mpReadAbDdx201006.txt
Bad mode

Where can I find documentation to the Android linux (?) commands? (I
mean the command line commands)

Thanks, John

On Aug 6, 6:12 pm, DanH danhi...@ieee.org wrote:
 Sounds like you forgot to insert the write ring.  (Oops!  Wrong
 technology!)

 Is the file write-protected maybe?

 On Aug 6, 5:13 pm, john brown johnbrowngreybe...@gmail.com wrote:



  Hello,

  I am using Android 2.1 update 1, API level 7, Eclipse, and HVGA skin.

  When the AVD is running, I check settings  sdcard total 49.21MB,
  available 49.07MB.

  Programatically checking Environment.getExternalStorageState() equals
  MEDIA_MOUNTED which I think means that the sdcard is available and
  writeable.

  I use getExternalStorageDirectory() to establish the sdcard root
  directory.

  I copied the files on the sdcard with adb push source destination.

  I am able to successfully read other files in that directory.

  code to write to file:
  //*

  File fFile = new File(pathFile);
  if (fFile.exists()){ ... // returns true
  if (fFile.canRead()){ ... // returns true
  if (fFile.canWrite()){ ... // returns false

  try{
          FileWriter Fw = new FileWriter(fFile, true);
          BufferedWriter Bw = new BufferedWriter(Fw);
          PrintWriter outPw = new PrintWriter(Bw, true);
          outPw.println(strRec);
          outPw.close();}

  catch(IOException ex){
          System.out.println(IO Error -  + ex.toString());
          System.exit(0);

  }

  //
  System.out shows:
  IO Error - java.io.FileNotFoundException

  but we know the file is there from the preceding checks:
  if (fFile.exists()){ ... // returns true
  if (fFile.canRead()){ ... // returns true

  What do I need to do to make the file writable?
  Or
  I want to write to the file. What am I doing wrong?

  Thanks, John Brown- Hide quoted text -

 - Show quoted text -

-- 
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: AlertDialog changes sequence of events

2010-08-01 Thread john brown
Problem solved! (problem was how I thought the AlertDialog should act,
not the AlertDialog)

Thank Android Developers Group for advice and help. John Brown

On Jul 31, 1:31 am, Brad Gies rbg...@gmail.com wrote:
 Why not just use theAlertDialogthe way it is meant to be used? Even
 though it's not modal, it looks modal the way it works anyway, and you
 just need code a little differently and put all logic that happens after
 the Dialog closes into the ButtonListeners.

 What do you need to do that you think you can't accomplish using it
 properly? For a Yes, No confirmation just setup a listener for the
 positive and negative buttons (the same listener if you want).

 Brad

 On 30/07/2010 7:14 PM, john brown wrote:





 AlertDialogis not modal - the call to show() returns immediately, leaving
  the dialog on the screen and button callbacks active.

  Does this mean that:
  1) It is not possible for theAlertDialogto be made modal .
  2) My implementation of theAlertDialogis not modal. Solve problem
  withAlertDialog.IsModal = true; (or something like that)
  3) or maybe:
              boolean buttonPushedFlag = false;
             AlertDialog.show();
              ..
             do while buttonPushedFlag = false {
              }

  How do I accomplish what I need, a yes/no confirmation?

  Thanks, John Brown

  On Jul 30, 3:44 pm, Kostya Vasilyevkmans...@gmail.com  wrote:

 AlertDialogis not modal - the call to show() returns immediately, leaving
  the dialog on the screen and button callbacks active.

  This is the reason for the sequence change you're seeing.

  --
  Kostya Vasilyev --http://kmansoft.wordpress.com

  31.07.2010 1:37 пользователь TreKingtreking...@gmail.com  написал:

  On Fri, Jul 30, 2010 at 4:31 PM, john brownjohnbrowngreybe...@gmail.com
  wrote:

  What can I do ...

  Print after in response to clicking the dialog buttons.

  ---
   --
  TreKinghttp://sites.google.com/site/rezmobileapps/treking  - Chicago
  transit tracking app for Android-powered devices

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers...

 --
 Sincerely,

 Brad Gies
 ---
 Bistro Bot - Bistro 
 Blurbhttp://www.bgies.comhttp://www.bistroblurb.comhttp://www.ihottonight.com
 ---

 Never doubt that a small group of thoughtful, committed people can
 change the world. Indeed. It is the only thing that ever has - Margaret Mead

-- 
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] AlertDialog changes sequence of events

2010-07-30 Thread john brown
Hello,

The following code runs as I expect it to.: (cntr is an int with the
whole class as it's scope)

System.out.println(before saveReading, cntr =  +
Integer.toString(cntr));
saveReading(Integer.parseInt(etRead.getText().toString()));
System.out.println(after saveReading, cntr =  +
Integer.toString(cntr));

public void saveReading(int reading){
System.out.println(In saveReading before ++, cntr =  +
Integer.toString(cntr));
++cntr;
System.out.println(In saveReading, after ++, cntr =  +
Integer.toString(cntr));
}

after the code runs, LogCat shows the following System.out:

System.out  before saveReading, cntr = 0
System.out  In saveReading before ++, cntr = 0
System.out  In saveReading, after ++, cntr = 1
System.out  after saveReading, cntr = 1

This (above) is the sequence of System.out events that I am expecting.

//

If I change the code to include a AlertDialog Yes/No for confirmation
of the ++cntr, the code looks like this:

System.out.println(before saveReading, cntr =  +
Integer.toString(cntr));
saveReading(Integer.parseInt(etRead.getText().toString()));
System.out.println(after saveReading, cntr =  +
Integer.toString(cntr));

public void saveReading(int reading){
System.out.println(In saveReading before ++, cntr =  +
Integer.toString(cntr));
AlertDialog.Builder bldr = new AlertDialog.Builder(this);
bldr.setTitle(Confirmation Required) ;
bldr.setMessage(Save this reading?);
bldr.setPositiveButton(R.string.YesButton, new
DialogInterface.OnClickListener(){
//@Override
public void onClick(DialogInterface dialog, int which) {
///code for YES (increment cntr)
++cntr;
}
});

bldr.setNegativeButton(R.string.NoButton , new
DialogInterface.OnClickListener(){
//@Override
public void onClick(DialogInterface dialog, int which) {
// code for NO (do nothing, cntr remains the same)
System.out.println(no!!!);
}
});

bldr.show();
System.out.println(In saveReading, after ++, cntr =  +
Integer.toString(cntr));
}

When I run the code, the AlertDialog Yes/No routine looks like I want
it to look but the following LogCat output shows that the sequence of
events is not what I was expecting. It looks like all the code in the
code block containing the call for saveReading, including saveReading,
runs and then the code in saveReading runs.

after the code runs, LogCat shows the following System.out:

System.out  before saveReading, cntr = 0
System.out  after saveReading, cntr = 0
System.out  In saveReading before ++, cntr = 0
System.out  In saveReading, after ++, cntr = 1

What can I do to make the code with the yes/no confirmation run in the
sequence I am expecting, i.e. like the first LogCat output?

Thank you very much for your help. John Brown

-- 
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: AlertDialog changes sequence of events

2010-07-30 Thread john brown
 AlertDialog is not modal - the call to show() returns immediately, leaving
 the dialog on the screen and button callbacks active.

Does this mean that:
1) It is not possible for the AlertDialog to be made modal .
2) My implementation of the AlertDialog is not modal. Solve problem
with AlertDialog.IsModal = true; (or something like that)
3) or maybe:
   boolean buttonPushedFlag = false;
   AlertDialog.show();
   ..
  do while buttonPushedFlag = false {
   }

How do I accomplish what I need, a yes/no confirmation?

Thanks, John Brown

On Jul 30, 3:44 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 AlertDialog is not modal - the call to show() returns immediately, leaving
 the dialog on the screen and button callbacks active.

 This is the reason for the sequence change you're seeing.

 --
 Kostya Vasilyev --http://kmansoft.wordpress.com

 31.07.2010 1:37 пользователь TreKing treking...@gmail.com написал:

 On Fri, Jul 30, 2010 at 4:31 PM, john brown johnbrowngreybe...@gmail.com
 wrote:

  What can I do ...

 Print after in response to clicking the dialog buttons.

 --- 
 --
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers...

-- 
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] Confirmation routine

2010-07-29 Thread john brown
Hello,

What is the recommended best practice for a confirm routine? A toast
object is something like a visual basic MsgBox() routine but I have
not found any variations for a toast that returns a yes or no.

An example might be:

*
you have entered a bid amount of $0.01. Select YES to permanently
place the bid or NO to discard this entry

YES   NO

**

I searched for confirm and found that the notepad example does have
a confirm button. I did the exercise and found that this particular
confirm button does not exactly match what I am wanting. I did learn a
way of using an intent to create a confirm routine but I thought there
might be another (shorter) method that I have missed.

Thanks for your help. John Brown

(I posted this on beginners about 6 hours ago but it never appeared in
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] Re: AIDL, Binder, ResultReceiver, and Performance

2010-06-26 Thread john brown
While reading this thread, I mistakenly clicked report as spam. I
immediately hoped for a confirmation dialog but none appeared. I only
got the notice that it had indeed been reported as spam.

It was done in error. I apologize for my error.

Thanks, John Brown

On Jun 26, 10:36 am, Jeff Sharkey jshar...@android.com wrote:
  If the purpose of this code (and I haven't looked at it to know) is to send
  a command to the service and get told later when it is done, then this is a
  reasonable approach.

 Yep, that's exactly what I'm using it for.  I'm kicking off a heavy
 background sync, and use an optional ResultReceiver to pass back
 success/failure along with any Exception text for Toast'ing to the
 user.

  Not my team's app...  I've not looked at the code, either. :}

 The app was written by two engineers on the Android team, but not
 anyone specifically working on the framework.

 --
 Jeff Sharkey
 jshar...@android.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 specify which soft keyboard appears

2010-06-25 Thread john brown
if application has EditText widget and user clicks on it, a qwertysoft
keyboard appears. how do you get a numeric, 12key, or phone soft
keyboard to appear instead. (I have searched documentation but I
cannot find solution.)

thanks for your help, John Brown

-- 
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 control which soft keyboard appears

2010-06-25 Thread john brown
Using this EditText definition in res/main.xml:

EditText
android:text=
android:id=@+id/EditTextReading
android:layout_width=10mm
android:layout_height=wrap_content
android:inputType=numberSigned
/EditText

When user clicks on EditText widget, a numeric version of the qwerty
soft keyboard appears onscreen to allow input. In the enviornment this
application will run in, a 12key number keypad or even a phone keypad
with the larger keys would be better.

Is there a way to cause a 12 key number keypad or the phone keypad to
appear?

Thanks, John Brown

-- 
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