Re: [android-beginners] How to set location information permanently in the emulator

2010-08-09 Thread Mark Murphy
On Mon, Aug 9, 2010 at 2:43 AM, sunny menon1...@gmail.com wrote:
 I am not sure how to set the location permanently in the emulator.

You can't.

 I use the
 ddms to push the location but I can only see it when I open the map. If I
 exit, it is gone.

Correct.

 Next time when my open my map, it says waiting for
 location details.

Correct. You need to simulate another GPS fix.

 Can someone advice me what is wrong.

Nothing is wrong. The emulator emulates GPS fixes, which are transient events.

 I am not clear how
 to setup location permanently.

You can't -- sorry.

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

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

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Howto integrate 3rd party app to tabhost

2010-08-09 Thread Mark Murphy
On Mon, Aug 9, 2010 at 7:59 AM, daph...@googlemail.com
daph...@googlemail.com wrote:
 I using android 2.2 and I want to integrate a third party application
 into the tabulator. Is that possible and how can I do that?

It is not possible, sorry.

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

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

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Opening the preferences.xml file

2010-08-07 Thread Mark Murphy
On Sat, Aug 7, 2010 at 2:28 PM, Bret Foreman bret.fore...@gmail.com wrote:
 The following code does not give the expected results:

                prefInputStream =
 getResources().openRawResource(R.xml.preferences);
                byte[] rawBytes = new byte[100];
                prefInputStream.read( rawBytes, 0, 100 );

 The bytes read are not printable ASCII characters. The start of the
 file looks like this:

 ?xml version=1.0 encoding=utf-8?
 PreferenceScreen xmlns:android=http://schemas.android.com/apk/res/
 android android:key=main_preferencescreen android:title=Settings


 What gets read is:

 [3, 0, 8, 0, -8, 43, 0, 0, 1, 0, 28, 0, 0, 15, 0, 0, 100, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, -84, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0,
 0, 24, 0, 0, 0, 42, 0, 0, 0, 70, 0, 0, 0, 94, 0, 0, 0, 116, 0, 0, 0,
 -114, 0, 0, 0, -88, 0, 0, 0, -70, 0, 0, 0, -54, 0, 0, 0, -36, 0, 0, 0,
 -12, 0, 0, 0, 8, 1, 0, 0, 26, 1, 0, 0, 114, 1, 0, 0]

 Any idea what might be wrong?

1. XML resources are converted into a binary XML format as part of
the build process.

2. XML resources are not raw resources.

Use getXml(), not getRawResource().

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

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

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Google map tiles missing with adb install

2010-08-04 Thread Mark Murphy
On Tue, Aug 3, 2010 at 11:34 PM, Bret Foreman bret.fore...@gmail.com wrote:
 Is it kosher to sign an apk file with a debug key or is that only for
 inside Eclipse?

That should be kosher. I suspect there's still something wrong with
your process here -- perhaps signed by both production and debug keys?
I don't know how else to explain your map symptoms.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Problem sending variable to java activity.

2010-08-03 Thread Mark Murphy
On Tue, Aug 3, 2010 at 6:00 AM, Justin justinbrett1...@gmail.com wrote:
 The error I get is The Application has stopped unexpectedly. Please
 try again, but it only happens as if I use tthe following 2 lines:
            Intent intent = getIntent();
            int position = intent.getIntExtra(ImagePosition, -1);

 If I create the variable in this activity and blank those lines out it
 works, but I need the variable bringing accross.

Use adb logcat, DDMS, or the DDMS perspective in Eclipse to examine
the Java stack trace associated with your error.

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

Android Development Wiki: http://wiki.andmob.org

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] ATTENTION: Android-Beginners will be permanently disabled on August 9 2010

2010-08-03 Thread Mark Murphy
On Tue, Aug 3, 2010 at 1:59 PM, Kevin Brooks bear35...@gmail.com wrote:
 I just joined the new group.  Hopefully Mark Murphy will decide to join as
 well an Volunteer to be a Moderator.

Personally, I would recommend people use StackOverflow.

For those who find StackOverflow to be ineffective, or find the
behavior of volunteers there to be morally reprehensible, or whatever,
use the [android-developers] Google Group. The dividing line between
that group and this one has been extremely blurry over the past 9-12
months.

There are other support resources as well (JavaRanch, anddev.org,
etc.). I do not try to participate in all of them, as I would never
get any sleep. :-)

If this list is discontinued, for the near term, I will be focusing on
StackOverflow and [android-developers], and we will see where things
go from there.

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

Android Development Wiki: http://wiki.andmob.org

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Changing WiFi network login

2010-08-03 Thread Mark Murphy
On Tue, Aug 3, 2010 at 2:41 PM, Kevin Brooks bear35...@gmail.com wrote:
 It is my understanding that the WiFi connection is based on only one user
 for the device. Here is my situation.  We have an Android device that can
 be used by different users.  We want to be able to track which data is
 entered by each user.  This requires a different login.  Is there a way I
 can access and change the network login?

What do you consider a network login to be?

A true multi-user Android environment would require substantial
firmware modifications, to the point where it may not resemble Android
anymore.

BTW, since you're one who is decrying the shutdown of this list --
IMHO, this is nowhere remotely near a beginner question.

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

Android Development Wiki: http://wiki.andmob.org

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Changing WiFi network login

2010-08-03 Thread Mark Murphy
On Tue, Aug 3, 2010 at 3:06 PM, Kevin Brooks bear35...@gmail.com wrote:
 I am not looking to create a true Multi-user Android environment.  My idea
 would be for my application to change the WiFi settings then connect.

Well, WifiManager has addNetworkConfiguration(),
getConfiguredNetworks(), disconnect(), and so on. It is not out of the
question you can use this for your aims. I do not know what
permissions you need, if any, and I do not know if the API is rich
enough for your needs.

However, I don't see where any of that will do you any good. Most WiFi
access points do not support multiple configurations, one per user,
regardless of what your device expects. Similarly, most households and
businesses do not have one WiFi access point per user. I don't know
where your other accounts are going to come from.

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

Android Development Wiki: http://wiki.andmob.org

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Google map tiles missing with adb install

2010-08-03 Thread Mark Murphy
On Tue, Aug 3, 2010 at 9:26 PM, Bret Foreman bret.fore...@gmail.com wrote:
 If I run my application on a physical phone from within the SDK then
 the Google MapView works perfectly.

What do you mean by from within the SDK? Do you mean from Eclipse?

 If I export to an apk file and
 install it to the same phone from the command line (adb install path/
 filename.apk) then the MapView shows the Google logo and the grid, but
 no map. Any ideas what might be going wrong?

If you are signing the APK with a different key (e.g., production
key), you need a different Maps API key to match.

The no-tiles symptom usually means one of the following:

-- you don't have an API key that matches the signing key

-- you don't have the INTERNET permission

-- your device/emulator does not have connectivity to the Internet
(e.g., airplane mode)

-- you are experiencing a tear in the fabric of space-time, and have
not recently looked out the window to notice that the world around you
is now a gray grid, and that in the distance the theme music to The
Twilight Zone is playing softly :-)

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

Android Development Wiki: http://wiki.andmob.org

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Closing the activity completely

2010-08-02 Thread Mark Murphy
On Mon, Aug 2, 2010 at 4:53 AM, Revathi K J Ramanan
revathiramana...@gmail.com wrote:
 I have a back button in my activity window on right corner of the
 title bar.

 I want to kill the activity completely on clicking the close button.
 Can I reuse the same function and will it have any major effect?

Just call finish(), please.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Problem launching another java file from app.

2010-08-02 Thread Mark Murphy
On Mon, Aug 2, 2010 at 6:06 AM, Justin justinbrett1...@gmail.com wrote:
 Which loads up the new page fine, but then causes a error and forces
 close.

Use adb logcat, DDMS, or the DDMS perspective in Eclipse to examine
the Java stack trace associated with your force close.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Plug for Beginning Android 2

2010-08-02 Thread Mark Murphy
On Mon, Aug 2, 2010 at 6:32 PM, brucko geoff.bruck...@gmail.com wrote:
 I agree with you Doug on all points.

 There is however another benefit. The Warescription model. Since I
 started with Android about 12mths ago we have gone from version 1.5 to
 1.6, 2.0, 2.1 and now 2.2.

 Books go out of date very quickly with Android.

Thanks!

To clarify, though, _Beginning Android 2_ isn't on the Warescription,
per se. _Beginning Android 2_ (published by Apress) is based on _The
Busy Coder's Guide to Android Development_, which is in the
Warescription and updated more frequently (though I'm a bit behind on
that specific title).

BTW, if anyone has questions on these books, the [cw-android] Google
Group is a better spot than here for them:

http://groups.google.com/group/cw-android

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

_Android Programming Tutorials_ Version 2.9 Available!

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

ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For 
more information about this change, please read [http://goo.gl/xkfl] or visit 
the Group home page.

Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: custom listview add button above listeview

2010-08-01 Thread Mark Murphy
Sorry for the delay in responding.

On Fri, Jul 30, 2010 at 10:01 PM, calmchess calmchesspla...@gmail.com wrote:
 yes i think this does what i'm looking for do I need to write it from
 scratch or can i modify this code to suite my needs and use it?

It is licensed under the Apache License 2.0.

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

Android Training...At Your Office: http://commonsware.com/training

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Pre-loading an SQLite database

2010-08-01 Thread Mark Murphy
On Sun, Aug 1, 2010 at 11:59 AM, Bret Foreman bret.fore...@gmail.com wrote:
 I'm going to investigate the option of using Amazon S3. There exists a
 Java library for S3 access along with methods to access all the AWS
 services: http://aws.amazon.com/sdkforjava/
 The question remains, if I just use the S3 objects and methods in this
 library, will it pull in a big fat tail of unrelated code that I don't
 want weighing down my mobile app.

S3 uses a REST-style interface; the library wrappers are mostly to
assist with authentication and URL construction and such. If the JAR
is too big, fall back to rolling the REST yourself with HttpClient.

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

Android 2.2 Programming Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Plug for Beginning Android 2

2010-08-01 Thread Mark Murphy
On Sun, Aug 1, 2010 at 1:05 PM, Doug Gordon gordo...@gmail.com wrote:
 For that purpose, I would highly recommend Beginning Android 2 by some guy
 named Mark Murphy who shows up in these forums on occasion :-).

I dunno. I hear he's balding. Can you really trust a book from a guy
who can't keep his hair?

Anyway, thanks for the vote of confidence!

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

Android 2.2 Programming Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Launching an About screen from Preferences

2010-07-30 Thread Mark Murphy
Yes, I think I barked up the wrong tree by suggesting to get rid of
the DEFAULT category. Glad to know this works!

On Fri, Jul 30, 2010 at 12:33 PM, Kostya Vasilyev kmans...@gmail.com wrote:
 Bret  Mark,

 Sorry for interrupting, but I also got curious about this. It seems like a
 neat way to bring up the About box without making the context menu too
 large.

 This works, no problems at all:

 values/prefs.xml:

 .
 Preference android:key=aboutPref
 android:title=About title
 android:summary=About summary
 intent android:action=ABOUT_ACTION/
 /Preference
 .

 the manifest:

 activity android:name=.AboutActivity
 android:label=@string/about_activity
 android:theme=@android:style/Theme.Dialog
 intent-filter
 action android:name=ABOUT_ACTION/
 category android:name=android.intent.category.DEFAULT /
 /intent-filter
 /activity

 -- Kostya

 30.07.2010 19:29, Bret Foreman пишет:

 Mark,

 Well, the manifest documentation is pretty sparse so it's not
 surprising that it doesn't mention this case. A good example is the
 screen of choices that face you when you look at the Application tab
 in the manifest editor in Eclipse and click on one of the activities
 or services. That calls up a form with about 25 choices, none of which
 include an action, by the way. A document that describes what all
 these choices mean would be very helpful. Note that there's a choice
 called clear task on launch, a phrase that you can search in vain
 for in the manifest documentation.

 It seems like people mostly build projects by copy-paste from other
 projects, which is a fine approach as far as it goes but it can grow
 into a nightmare if people start propagating unsupported hacks. Then
 you have hundreds of apps that break at the same time when a new
 release invalidates the hack.

 OK, down off my soapbox. The change you suggest below didn't work.
 Same exception in logcat. I can think of several approaches to take it
 from here:

 1) I build a simple test project that illustrates the problem and
 submit it as a bug.
 2) We decide that this approach is unsupported, in which case I submit
 a bug against the documentation.
 3) We take another swing at it, recognizing that we are implementing
 something that lives on shaky ground, since undocumented behavior can
 change at any time.

 What do you think?

 Bret

 On Jul 29, 7:02 pm, Mark Murphymmur...@commonsware.com  wrote:


 I can't find where what you're doing is documented, so I have no idea
 what the right behavior is. Do you have a link to where it describes
 thisintent  child element ofPreference?

 Regardless, I see where I went wrong before.

 Your error is:

 E/AndroidRuntime(  376): android.content.ActivityNotFoundException: No
 Activity
 found to handle Intent { act=com.shipmate.AboutShipMateActivity }

 Notice the act=com.shipmate.AboutShipMateActivity part. That says
 the Intent it is trying to use has an *action* of
 com.shipmate.AboutShipMateActivity. So, add anintent-filter  with an
 action  of com.shipmate.AboutShipMateActivity to your activity, and
 you should have better luck.






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

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

 NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
 android-beginners+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en




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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Launching an About screen from Preferences

2010-07-30 Thread Mark Murphy
On Fri, Jul 30, 2010 at 1:56 PM, Bret Foreman bret.fore...@gmail.com wrote:
 Now, how do we get this documented so the capability doesn't disappear
 in later releases? Ideally, this would become part of the Android
 regression tests. Any ideas?

File an issue on b.android.com, or submit a documentation patch and
see if it gets approved. Or implement the capability using a
documented means -- Kostya's suggestion of
setOnPreferenceClickListener() is probably simplest.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Launching an About screen from Preferences

2010-07-30 Thread Mark Murphy
On Fri, Jul 30, 2010 at 11:29 AM, Bret Foreman bret.fore...@gmail.com wrote:
 Note that there's a choice
 called clear task on launch, a phrase that you can search in vain
 for in the manifest documentation.

Ah, but if you remove the spaces, clearTaskOnLaunch is in the docs.

 It seems like people mostly build projects by copy-paste from other
 projects, which is a fine approach as far as it goes but it can grow
 into a nightmare if people start propagating unsupported hacks. Then
 you have hundreds of apps that break at the same time when a new
 release invalidates the hack.

Bingo. That's one of the reasons I've been jumping up and down more
recently when people use undocumented stuff.

In my case, I just figured there was some documentation that I had
missed somewhere.

 1) I build a simple test project that illustrates the problem and
 submit it as a bug.
 2) We decide that this approach is unsupported, in which case I submit
 a bug against the documentation.
 3) We take another swing at it, recognizing that we are implementing
 something that lives on shaky ground, since undocumented behavior can
 change at any time.

Try Kostya's sample, perhaps just by adding back in the DEFAULT
category I, um, had you remove. (sorry) I suspect we can get this
working.

That being said, if you keep a roster of things that might go 'boom'
in future releases for your apps, add this to the list, since for all
we know they'll dump this feature in favor of some other
implementation (e.g., dedicated IntentPreference class). In fact, if
you wanted to be super-safe, implementing an IntentPreference class
may not be that difficult, and you then aren't dependent on an
undocumented feature.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: custom listview add button above listeview

2010-07-30 Thread Mark Murphy
On Fri, Jul 30, 2010 at 8:55 PM, calmchess calmchesspla...@gmail.com wrote:
 I'm sorry i didn't try your code this isn't somthing that can be fixed
 by formatting XML

Yes, it can be. What you say you want is precisely what Nick and
Kostya have supplied in the answers.

 the button is always inside the  listview no matter
 what i do although yours came close to doing what i want.i want a
 button outside the listview and doesn't get highlighted by the list
 viewthankyou for your time.

Which is precisely what Nick and Kostya have supplied in the answers.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: custom listview add button above listeview

2010-07-30 Thread Mark Murphy
On Fri, Jul 30, 2010 at 9:16 PM, calmchess calmchesspla...@gmail.com wrote:
 for the billionth time i'm useing  a CUSTOM LISTVIEW it inflates the
 xml

Which has nothing to do with anything.

 and getview gets called as many times as there is items in the
 array...if you put a button in the xml no matter what way you format
 the XML the button gets displayed multiple times not 1 time multiple
 times

The XML that was supplied is not for the *row*. It is for the
*container around the ListView*.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: custom listview add button above listeview

2010-07-30 Thread Mark Murphy
On Fri, Jul 30, 2010 at 9:25 PM, calmchess calmchesspla...@gmail.com wrote:
 and now i think we are at the root of my problem...how do
 i seperate the row from the container??

Well, your source code got cut off, so it is difficult to answer.

Somewhere, your Activity is calling setContentView().

Ideally, particularly for this case, setContentView() is passed a
resource ID pointing to a layout resource (e.g., R.layout.main). This
is the layout file that Nick demonstrated and Kostya referred to. That
layout for your whole activity needs to have your Button and your
ListView, wrapped in a RelativeLayout or LinearLayout.

Here is an example project, albeit one with a TextView instead of a
Button above the ListView:

http://github.com/commonsguy/cw-android/tree/master/Selection/List/

Here is a variation on that sample project, using a custom ListAdapter:

http://github.com/commonsguy/cw-android/tree/master/FancyLists/Recycling/

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] how to self-close an Activity

2010-07-29 Thread Mark Murphy
Call finish():

http://developer.android.com/reference/android/app/Activity.html#finish()

On Thu, Jul 29, 2010 at 7:39 AM, cellurl gpscru...@gmail.com wrote:
 I want to auto-close my about-window after 10 seconds, but don't
 have a clue how to do it
 Any help appreciated.
 -jp


 -Translate.java---
 public class Translate extends Activity implements OnClickListener {
   public void onClick(View v) {
      switch (v.getId()) {
         case R.id.about_button1:
            Intent i1 = new Intent(this, About1.class);
            startActivity(i1);
            break;
 ...

 --About1.java---

 public class About1 extends Activity {
   �...@override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.submitting);
 ...
 ---




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

 NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
 android-beginners+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en




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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] read flat file from resources

2010-07-29 Thread Mark Murphy
On Thu, Jul 29, 2010 at 6:33 PM, Droid rod...@gmail.com wrote:
 I want to read words from a flat text file in res. Is that possible -
 snippet of code please?

getResources().openRawResource(R.raw.your_file_name)

 Also, can I write to a similar file in resources.

No, sorry.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Launching an About screen from Preferences

2010-07-29 Thread Mark Murphy
Try getting rid of the intent-filter.

On Thu, Jul 29, 2010 at 7:45 PM, Bret Foreman bret.fore...@gmail.com wrote:
 I changed the manifest to look as below and it still exits with the
 same error.

      activity android:name=.AboutShipMateActivity
                intent-filter
                        category
 android:name=android.intent.category.DEFAULT/
                /intent-filter
                /activity

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

 NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
 android-beginners+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en




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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Launching an About screen from Preferences

2010-07-29 Thread Mark Murphy
On Thu, Jul 29, 2010 at 9:15 PM, Bret Foreman bret.fore...@gmail.com wrote:
 I removed the intent filter and still got the FC with the
 ActivityNotFoundException. Is there a better way to debug this stuff
 rather than trial and error?

I can't find where what you're doing is documented, so I have no idea
what the right behavior is. Do you have a link to where it describes
this intent child element of Preference?

Regardless, I see where I went wrong before.

Your error is:

E/AndroidRuntime(  376): android.content.ActivityNotFoundException: No
Activity
found to handle Intent { act=com.shipmate.AboutShipMateActivity }

Notice the act=com.shipmate.AboutShipMateActivity part. That says
the Intent it is trying to use has an *action* of
com.shipmate.AboutShipMateActivity. So, add an intent-filter with an
action of com.shipmate.AboutShipMateActivity to your activity, and
you should have better luck.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] need help validating if application works on specific devices

2010-07-28 Thread Mark Murphy
On Wed, Jul 28, 2010 at 3:51 AM, Phone Pony phonep...@gmail.com wrote:
 you are invited to look at the code, and hopefully you can find
 what is wrong with these specific devices.

Uri SmsContentUri = Uri.parse(content://sms);

This is not part of the Android SDK. It is an undocumented feature of
an optional Android application. It will fail to work on some devices.
It may fail to work on future versions of Android. You were told not
to use it:

http://android-developers.blogspot.com/2010/05/be-careful-with-content-providers.html

 So much for write once, run anywhere

If you use undocumented unsupported APIs, you will have problems. Do
not use undocumented or unsupported APIs, and you will have better
luck.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Directory names

2010-07-28 Thread Mark Murphy
On Wed, Jul 28, 2010 at 11:39 AM, kypriakos demet...@ece.neu.edu wrote:
 I have been experimenting with the file system that the emulator
 presents and I noticed that although I can create files with 'normal'
 names (ex. test, src), I don't seem to be able to create dotted
 names, such as .test, .src. Is there a restriction on dir names
 (other than the common rules that apply on most OSs)?

You can create them. You can't see them. Directories with leading
periods are normally suppressed from directory listings. This has been
standard Linux behavior for a very long time.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Problems using AlertDialog in a onReceive() method

2010-07-28 Thread Mark Murphy
On Wed, Jul 28, 2010 at 7:24 PM, Brad Taylor djlm...@gmail.com wrote:
 I new to the SDK and have intermediate Java skills and I am having an issue
 with adding an AlertDialog to a Receiver I have created.

Try using a dialog-themed Activity and startActivity() instead.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Problems using AlertDialog in a onReceive() method

2010-07-28 Thread Mark Murphy
On Wed, Jul 28, 2010 at 8:26 PM, Brad Taylor djlm...@gmail.com wrote:
 Would I create a whole new
 Activity class that creates the AlertDialog.

No, you would create a whole new Activity class that displays what you
want to display. If you want it to look like an AlertDialog, add the
following attribute to your activity element in the manifest:

android:theme=@android:style/Theme.Dialog

http://developer.android.com/guide/topics/ui/themes.html#ApplyATheme

 Then in my receiver class call the startActivity()?

Yes.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Google Image on Google map

2010-07-28 Thread Mark Murphy
2010/7/28 NBS and...@gmail.com:
 The problem is it shows as blank space. Instead of drawing anything.
 Please have a look to the attached Image file.

Android is having difficulty loading that tile for some reason. It
should not be a problem in your code. With luck, the map server will
respond properly for that tile sometime in the future.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] OutputStream on assets file

2010-07-28 Thread Mark Murphy
On Thu, Jul 29, 2010 at 12:15 AM, Bret Foreman bret.fore...@gmail.com wrote:
 What happens if I open an OutputStream on a file in the assets folder?

It creates a rupture in the space-time continuum, exterminating all
life except for tax collectors (who are invincible).

Or, possibly, it just crashes, because assets are not modifiable.

Pick your poison.

:-)

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Language change to Hindi

2010-07-27 Thread Mark Murphy
http://developer.android.com/sdk/android-2.2.html#locs

The Android SDK does not support Hindi.

On Tue, Jul 27, 2010 at 8:07 AM, Shaista Naaz shaistanaa...@gmail.com wrote:
 Please some body kindly suggest...


 On Tue, Jul 27, 2010 at 11:31 AM, Shaista Naaz shaistanaa...@gmail.com
 wrote:

 Is there way of changing the phone language to Hindi. I am trying in
 eclipse.

 Please kindly suggest.

 Thanks,
 Shaista Naaz

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

 NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
 android-beginners+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en




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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Contents of dex

2010-07-27 Thread Mark Murphy
On Tue, Jul 27, 2010 at 11:50 PM, kypriakos demet...@ece.neu.edu wrote:
 is there a way to view what is enclosed (file list) in the dex file?

http://dedexer.sourceforge.net/

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Showing a screen from a preference selection

2010-07-23 Thread Mark Murphy
On Fri, Jul 23, 2010 at 12:21 PM, Bret Foreman bret.fore...@gmail.com wrote:
 I have an About screen defined in layout/about.xml.

 I have a menu inside my default preferences hierarchy with a title
 like Show About. Is there a way to specify in xml/preferences.xml
 that about.xml should be shown when the Show About menu item is
 selected? Any sample xml code around like that?

No, but you can add the relevant options menu methods to your
PreferenceActivity subclass, as with any other activity, then load
that layout into a dialog or separate activity.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Showing a screen from a preference selection

2010-07-23 Thread Mark Murphy
On Fri, Jul 23, 2010 at 12:37 PM, Bret Foreman bret.fore...@gmail.com wrote:
 So let's say the key for that preferences button is AboutPrefKey.

What is a preferences button? Your original question referred to a
menu item, which I interpreted as meaning a menu item. :-)

If you are looking for a Preference that launches another activity,
there isn't one in the SDK. You would have to write your own, or
possibly see if the Settings application has one that you can mooch
from the Android open source code.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: null intent returned in onActivityResult

2010-07-22 Thread Mark Murphy
On Wed, Jul 21, 2010 at 11:27 PM, Bret Foreman bret.fore...@gmail.com wrote:
 Mark, you scored again. That worked perfectly.

Great!

 I owe you lunch.

That's not necessary, but I appreciate the sentiment!

 Do you sit in the Bay Area?

Whenever I can. Standing all the time makes my feet hurt.

However, my home base is in Pennsylvania. I get out to Silicon Valley
a few times a year.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Calling back function

2010-07-21 Thread Mark Murphy
Call finish().

On Wed, Jul 21, 2010 at 7:14 AM, Bhaban N and...@gmail.com wrote:
 How can I go to the previous activity by pressing some
 button programmatically instead of pressing default back button on phone.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Spinners identical in XML but look different when run

2010-07-21 Thread Mark Murphy
On Wed, Jul 21, 2010 at 10:28 AM, jonboy1969 jgr...@grovegfx.com wrote:
 I placed two Spinners using XML inside my TableLayout.
 They both work, but they both look different. I gave the exact same
 properties only changing the Id.

That has nothing to do with it.

 the one spinner has larger padding with radio buttons on the right and
 the second one has almost no padding and no radio buttons.

That is determined by the adapters you put in the Spinners. The
adapters are responsible for the Views that go in the Spinners, both
for the selected item and for the available items in the dialog that
appears when the user presses the drop-arrow.

 How can I make them look the same

Use the same layouts in your adapters.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] null intent returned in onActivityResult

2010-07-21 Thread Mark Murphy
Use setResult(RESULT_OK, myIntent) and get rid of the
createPendingResult() call. Also, you probably do not need the action
or the class on that Intent.

On Wed, Jul 21, 2010 at 9:21 PM, Bret Foreman bret.fore...@gmail.com wrote:
 I'm getting a null Intent returned from onActivityResult. A summary of
 the code is listed below. Any ideas what I might be doing wrong?

 Code in calling Activity:

                Intent myIntent = new Intent( Intent.ACTION_VIEW );
                myIntent.setClass(this,TheCalledActivity.class);
                startActivityForResult( myIntent , SORT_PREFERENCES_CHANGED );

 Code in called Activity:
                commitButton.setOnClickListener( new View.OnClickListener() {
                        public void onClick(View v) {
                                Intent myIntent = new 
 Intent(Intent.ACTION_VIEW);
                                myIntent.setClass( v.getContext() , 
 TheCallingActivity.class );
                                setResult(Activity.RESULT_OK);
                                
 createPendingResult(0,myIntent,PendingIntent.FLAG_ONE_SHOT);
                                finish();
            }
                });


 Code in calling Activity:

       �...@override
        protected void onActivityResult(int requestCode, int resultCode,
 Intent data) {
                // data is coming back as null.
        }

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Source code

2010-07-20 Thread Mark Murphy
On Tue, Jul 20, 2010 at 3:20 PM, kypriakos demet...@ece.neu.edu wrote:
 is the Android 2.1 or 2.2 source code available somewhere?

http://source.android.com

 I was
 able to find the source code of what they called android 1.5 cupcake
 but I am not sure that is very recent.

Cupcake is from last year.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Calling an AlertDialog from inside onOptionsItemSelected

2010-07-20 Thread Mark Murphy
On Tue, Jul 20, 2010 at 10:14 PM, Bret Foreman bret.fore...@gmail.com wrote:
 That worked. Mark, you rock...and after 7pm too!

What? People are tracking my sleeping habits now?

:-)

I was probably a bit over the top by saying to delete all
getApplicationContext() calls, though there's so few cases where that
is the right method to use, I can't think of any of them off the top
of my head. Certainly if you're trying to do anything with the GUI,
getApplicationContext() is lobotomized -- your Activity is a far
better Context for methods that need one.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Including libraries in project

2010-07-18 Thread Mark Murphy
On Sat, Jul 17, 2010 at 11:45 PM, kypriakos demet...@ece.neu.edu wrote:
 But older postings and
 some
 sources supported that in general external jars may not work under
 Android

There are a multitude of reasons why an existing JAR may not work on Android:

-- It was compiled with Java 1.4.2 or a non-Sun/Oracle Java compiler
-- It assumes certain classes exist (from, say, JavaSE) that do not
ship with Android
-- It uses JNI (and therefore needs to be adjusted to work with the NDK)
-- It assumes certain platform binary programs exist, or exist at
certain paths, which may not be the case on Android
-- and so on

 and that their corresponding source should be compiled with its SDK
 before
 they can be used

That will directly resolve the compiled-with-wrong-compiler program
and will give you better error information for the
assumes-certain-classes-exist problem.

 In any
 case,
 then it makes no sense as to why the classes are not visible in the
 emulator
 even though I (finally) managed to include the jars in the apk -
 having them in
 the classpath does not do it.

Step #1: Put the JAR in libs/
Step #2: If using Eclipse, add it to your build path
Step #3: Code to the JAR's API and build your APK

and you're done...assuming the JAR is Android-friendly. For example,
here is a sample project using a re-compiled edition of the BeanShell
interpreter:

http://github.com/commonsguy/cw-android/tree/master/Java/AndShell/

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Including libraries in project

2010-07-18 Thread Mark Murphy
On Sun, Jul 18, 2010 at 4:52 PM, kypriakos demet...@ece.neu.edu wrote:
 Step #1: Put the JAR in libs/
 I did
 Step #2: If using Eclipse, add it to your build path
 I did
 Step #3: Code to the JAR's API and build your APK
 I did

 Even for the case of the jars that are Android-friendly they don't get
 included
 in the apk.

:: shrug ::

It works for many other developers, including hundreds of students of
mine. Since the non-Eclipse portion is pretty bulletproof, and since I
don't use Eclipse, my guess is that your problems stem from something
Eclipse-related, perhaps in the way you are putting it in your build
path.

 The libs dir is either in the src dir or the top level
 dir.

The libs/ dir is supposed to be in the root of the project dir. Now, I
have heard that you can have it located elsewhere when you are
building with Eclipse, but I have not tried that.

 Once I move
 it in the assets dir I can see it being wrapped inside the apk.

I suspect having it there will be useless.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] using intent to switch between a simple activity and a tab activity

2010-07-18 Thread Mark Murphy
On Sun, Jul 18, 2010 at 10:22 PM, Emmen Farooq farooq.em...@gmail.com wrote:
 Kindly help me with the following scenario ,

 I have activity A that is tab acitvity ,  I press a certain button and
 go to B that is a simple activity , now on clicking a certain button
 on B I should be allowed to go back to A but the app crashes , how
 ever if i go from B to a normal activity ,it  works perfectly well ,
 so the problem is in A being a tab activity , please help

Use adb logcat, DDMS, or the DDMS perspective in Eclipse to examine
the Java stack trace associated with your crash.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: ActivityNotFoundException and txt files

2010-07-16 Thread Mark Murphy
On Fri, Jul 16, 2010 at 8:26 PM, Harald harald.kron...@gmail.com wrote:
 Is there any way to fix it so that Android know how to open .txt
 files, or can I somehow in my code tell Android to use File Editor to
 open/edit .txt files.

I do not know what File Editor is. If that is some third party text
editor, contact the author to see how to integrate your code with
theirs.

There is no text editor built into Android.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] RTC vs RTC_WAKEUP

2010-07-15 Thread Mark Murphy
On Thu, Jul 15, 2010 at 8:20 AM, Jake Colman col...@ppllc.com wrote:
 What does it mean with RTC that the pending intent is fired but the
 device does not wake up as opposed to RTC_WAKEUP where device does wake
 up?  If the device does not wakeup does that mean, simply, that the
 screen does not turn on but that my code still executes?

No, it means that if the phone is asleep, the alarm does not fire. The
alarm will fire when the phone wakes up.

http://developer.android.com/reference/android/app/AlarmManager.html

This alarm does not wake the device up; if it goes off while the
device is asleep, it will not be delivered until the next time the
device wakes up.

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

_Android Programming Tutorials_ Version 2.9 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] intents

2010-07-15 Thread Mark Murphy
On Thu, Jul 15, 2010 at 5:41 PM, Raul Martinez raul5...@gmail.com wrote:
 i have a question can someone explain the syntax and fields of an Intent, i
 have this code but the area highlighted in red is underlined in red and says
 this: No enclosing instance of the type Category is accessible in scope
 what am i doing wrong?
 Intent intent = new Intent(Category.this.getApplication(),
          Category.class);
          startActivity(intent);

Two issues:

1. Delete .getApplication() -- you don't need or want it here.

2. If this code is not in the Category class, then Category.this
cannot work. If just this is insufficient, then the class reference
needs to be whatever Context class this code is in, such as the name
of the activity.

http://en.wikibooks.org/wiki/Java_Programming/Nested_Classes

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] intents

2010-07-15 Thread Mark Murphy
On Thu, Jul 15, 2010 at 6:05 PM, Raul Martinez raul5...@gmail.com wrote:
 do i have to modify the android manifest file as well to add the activity?

Your Category activity needs to be in the manifest file. Your current
activity presumably already is there.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] intents

2010-07-15 Thread Mark Murphy
On Thu, Jul 15, 2010 at 6:57 PM, Raul Martinez raul5...@gmail.com wrote:
 Ok thanks but what do I use instead of MAIN

You do not need an intent-filter if you are starting the activity
via the class (Category.class) in your Intent.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] onItemSelectListener or onItemClickListener, both or none???

2010-07-15 Thread Mark Murphy
On Thu, Jul 15, 2010 at 6:53 PM, kivy victoriasarabu...@gmail.com wrote:
 When I use the onClickItemListener together with openOptionsMenu();
 the menu opens, but the item doesn't get selected.

Correct.

 Now, when I use the onSelectedItemListener I cannot click on the item
 on the emulator's touchscreen to select it but have to use the
 phone's keys.

That's the definition of selection in Android.

 Is there any way to combine both things, so that I select a GridView
 item on the touchscreen

You don't select items in Android via the touchscreen.

http://developer.android.com/resources/articles/touch-mode.html

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] onItemSelectListener or onItemClickListener, both or none???

2010-07-15 Thread Mark Murphy
On Thu, Jul 15, 2010 at 7:49 PM, Victoria Busse
victoriasarabu...@gmail.com wrote:
 Okay I see :) Thank you Mark :) I will just stick with onClickItemListener
 then
 Then there is only my final question left: is it possible to e.g. choose the
 Email option in the menu and attach the item, which I used to open the menu
 with, to an email? If this is possible how would I best do that??

http://stackoverflow.com/questions/1247983/problem-sending-an-email-with-an-attachment-programmatically

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] onItemSelectListener or onItemClickListener, both or none???

2010-07-15 Thread Mark Murphy
On Thu, Jul 15, 2010 at 8:38 PM, Victoria Busse
victoriasarabu...@gmail.com wrote:
 Nice, thanks for the link...
 I just tried only to launch the email intent, but I get a force close error
 as soon as I press the button Email...if someone could help me find the
 error, that would be great..

Use adb logcat, DDMS, or the DDMS perspective in Eclipse to examine
the Java stack trace associated with your force close error.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] intents

2010-07-15 Thread Mark Murphy
On Thu, Jul 15, 2010 at 8:31 PM, Raul Martinez raul5...@gmail.com wrote:
 mark for some reason i keep getting a force close, any idea why, maybe i
 dont get the concepts of activitys and class i have this as my first
 activity

:: snip ::

 public class home extends Activity {
     /** Called when the activity is first created. */
    �...@override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         setContentView(R.layout.main);

         Button word = (Button) findViewById(R.id.word);
         word.setOnClickListener(new Button.OnClickListener(){
          public void onClick(View v){
          Intent intent = new Intent(null,Category.class);

You cannot have a null Context when creating an Intent like this. Use
home.this (minus the quotes) to reference your Activity -- this is
why I supplied you with the following link earlier in this thread:

http://en.wikibooks.org/wiki/Java_Programming/Nested_Classes

In the future, use adb logcat, DDMS, or the DDMS perspective in
Eclipse to examine the Java stack trace associated with your force
close.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Keep accelerometer active

2010-07-15 Thread Mark Murphy
On Thu, Jul 15, 2010 at 8:41 PM, Bret Foreman bret.fore...@gmail.com wrote:
 Well, I implemented something as an experiment, using the PowerManager
 and acquiring a PARTIAL_WAKE_LOCK in the onStartCommand method of my
 service. I try to release the lock in the onDestroy method of the
 service but the wakelock object is null. Both the power manager object
 and the wakelock object are class variables of the service. And since
 I can't release the wakelock (because I've somehow lost the object) I
 get a WakeLock finalized while still held exception when the service
 is destroyed.

 This is the weirdest thing yet - an object just disappearing like
 that. Any ideas?

FWIW, take a look at my WakefulIntentService to see if it gives you any ideas:

http://github.com/commonsguy/cwac-wakeful

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] onItemSelectListener or onItemClickListener, both or none???

2010-07-15 Thread Mark Murphy
On Thu, Jul 15, 2010 at 9:30 PM, Victoria Busse
victoriasarabu...@gmail.com wrote:
 I just did that and at first I thought it was because I forgot to give the
 activity an intent filter within the manifest.xml, but after I have done
 that now,
 I still got the problem
 I attached the output to this mail.

You are missing some key pieces of information, like the thing to send.

http://www.androidguys.com/2009/11/02/a-call-to-action-action_send-that-is/

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Map Overlay Image refresh

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 7:58 AM, Bhaban N and...@gmail.com wrote:
 I try to use invalidate method. But I have one more problem when I use
 invalidate.
 If I invalidate the map, my location overlay image is gone, and it takes few
 seconds to fix my location overlay Image.
 So I want is not to clear the my location overlay image. when i clear the
 overlay image, I can clear without my location overlay image.
 is there any way to invalidate without clearing my location overlay image.

One possibility is to use versions of the invalidate() method that
take a rectangle, and use that for each of your OverlayItems.

I have not combined MyLocationOverlay with invalidate() before, so I
do not know what other options there might be.

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

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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: I/O

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 2:59 PM, kypriakos demet...@ece.neu.edu wrote:
 I noticed that using the standard Java to create the new file stalls:

 File UIDfile = new File(/data/local/tmp/myUID.txt);
 UIDfile.createNewFile();

 Is this something that should not be used in Android?

You cannot write to arbitrary paths on hardware. Please use
getFilesDir() to find a safe spot to write files on the on-board flash
for your application, or Environment.getExternalFilesDir() for the
root of the external storage (SD card).

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

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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: I/O

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 3:20 PM, kypriakos demet...@ece.neu.edu wrote:
 The Environment.getExternalFilesDir() does return /sdcard and although
 empty it still stalls on writing the file out.

I have no idea what stalls means in this context. You need an SD
card (or SD card image for the emulator), and you need the
WRITE_EXTERNAL_STORAGE permission.

 What package carries the getFilesDir()?

That is a method on Context, and therefore is available to all
subclasses of Context, like Activity.

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

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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: I/O

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 3:42 PM, kypriakos demet...@ece.neu.edu wrote:
 When the app reaches the createNewFile() method it quits

OK, then I have no idea what quits means in this context. I am going
to guess you mean it had an unhandled exception. If so, use adb
logcat, DDMS, or the DDMS perspective in Eclipse to examine the Java
stack trace associated with the exception.

 How would I go about creating/finding an SD card image for the
 emulator?

There's a field for that when you create your AVD in the AVD Manager.

---

You are asking an awful lot of questions. In the grand scheme of
things, that is what this list is for. But I suspect you will have
better luck if you either spend more time with the Android
documentation:

http://developer.android.com

or pick up a book:

http://wiki.andmob.org/books

Now, I wrote some of those books, but I really don't care what book
you get, so long as you get more Android knowledge in bulk form,
rather than asking a whole bunch of questions that take time for us to
answer.

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

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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners]

2010-07-14 Thread Mark Murphy
You presumably do not have a res/layout/main.xml file in your project.
Either that, or Eclipse is having problems otherwise processing your
resources -- check your console for errors.

On Wed, Jul 14, 2010 at 5:29 PM, Raul Martinez raul5...@gmail.com wrote:


 public class home extends Activity {
     /** Called when the activity is first created. */
    �...@override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         setContentView(R.layout.main);

         Button word=(Button)findViewById(R.id.button1);
     }
 }
  i have this code but eclipse keeps telling me R.layout.main cannot be
 resolved, any ideas what might be wrong?

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

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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] buttons

2010-07-14 Thread Mark Murphy
Use ImageButton.

On Wed, Jul 14, 2010 at 8:13 PM, Raul Martinez raul5...@gmail.com wrote:
 i want to replace a button with an image, and i tried doing it through xml
 with android:src=@drawable/icon but its not working what should i do, or
 is there another way of replacing a button with an image

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

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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] downloadable tutorial resources?

2010-07-13 Thread Mark Murphy
On Tue, Jul 13, 2010 at 2:31 AM, Operand Zombie operandzom...@gmail.com wrote:
 I'm heading to the airport tomorrow, and will be travelling for about
 14 hours.  Was hoping to use that boring time to start reading more
 about Android... but without internet access, most of the existing
 resources out there will be unavailable to me.

 Does anybody know of downloadable tutorials oriented towards people
 with some programming experience, but no experience with the Android
 SDK - videos, pdfs, docs, etc?

At the risk of being self-serving and commercial:

http://commonsware.com/AndTutorials/

PDF, EPUB, and Kindle formats included. Full source code to the
tutorial answers is also available:

http://github.com/commonsguy/cw-andtutorials

I confess, though, that when I wrote the tutorials, I assumed Internet
access, and so much of the second half of the book is about creating
an identi.ca client (formerly a Twitter client), so that may limit its
usefulness while you are on your flight.

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

Android 2.2 Programming Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Error when adding gdata jar library to Android

2010-07-13 Thread Mark Murphy
On Mon, Jul 12, 2010 at 9:13 PM, Jennifer Francois
jennalexfranc...@gmail.com wrote:
 I am trying to display word
 documents in the app.

Uh, OK.

 Maybe upload is not a good word. create an app that
 reproduces a Word document and help me interact with the pages, reading the
 word document, zooming and all. The word document is on my computer and I
 need a way to reproduce the word document in the app.

The right answer: use an existing program, like DocumentsToGo or QuickOffice.

The wrong answer: try to do this yourself, unless you have a large
development team, a decade, or both.

The possibly-tolerable answer: on some server, convert the Word
document to HTML, and try rendering the HTML in WebView.

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

Android 2.2 Programming Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] downloadable tutorial resources?

2010-07-13 Thread Mark Murphy
On Tue, Jul 13, 2010 at 8:46 AM,  c...@comcast.net wrote:
 I am still very much in learning mode and always interested in reading good
 tutorials.

 As such I'm wondering if each tutorial explains clearly what is being done
 and why?

It explains what is being done, in part by telling you what to be typing in.

It is a bit light on why, as that is covered extensively in the
other books you get in the Warescription. There are pointers from each
tutorial to the corresponding chapter(s) in the other books.

Additional questions regarding these books are better asked over on
the cw-android Google Group, as I don't want to clutter this list with
too much CommonsWare-specific stuff:

http://groups.google.com/group/cw-android

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

Android 2.2 Programming Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Emulator

2010-07-13 Thread Mark Murphy
On Tue, Jul 13, 2010 at 12:44 PM, kypriakos demet...@ece.neu.edu wrote:
 You can?? That's super - where can I find documentation on that? Or is
 it straight
 forward?

You just run the app.

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

Android 2.2 Programming Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Application monitoring

2010-07-13 Thread Mark Murphy
On Tue, Jul 13, 2010 at 1:48 PM, kypriakos demet...@ece.neu.edu wrote:

 The applications I am importing into Android make use of out.println
 in many places. That was one of the way we could monitor them at
 runtime. I don't suppose this would be the case with Android - how
 would I be able to monitor the execution of these apps here?

LogCat, though ideally you would change those to use the android.util.Log class.

 These
 apps are primarily background services - they run and wait for input
 from the user to route the messages through the network. What would
 the best way to debug them be?

You can access LogCat via adb logcat, DDMS, or the DDMS perspective in
Eclipse. Or, just Eclipse's debugger. Etc.

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

Android 2.2 Programming Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] MapController.setCenter misbehaving

2010-07-13 Thread Mark Murphy
I haven't used zoomToSpan(). setCenter() certainly works everywhere
I've tried it, and your use does not seem unusual. Try this app:

http://github.com/commonsguy/cw-android/tree/master/Maps/NooYawk/

On Tue, Jul 13, 2010 at 7:50 PM, Bret Foreman bret.fore...@gmail.com wrote:
 I'm having some trouble with this method. It doesn't seem to center
 the map at the correct place. Here's my code:

       �...@override
        protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView( R.layout.eventmapview );
                MapView mapView = (MapView) findViewById(R.id.mapview);
            mapView.setBuiltInZoomControls(true);
            MapController myController = mapView.getController();
            int myLat = (int) (1e6 *
 getIntent().getDoubleExtra(com.android.shipmate.lat,0.0));
            int myLon = (int) (1e6 *
 getIntent().getDoubleExtra(com.android.shipmate.lon,0.0));
            android.util.Log.d( getString(R.string.app_name) , Setting
 center to lat= + myLat +  lon= + myLon );
            GeoPoint centerPoint = new GeoPoint( myLat , myLon );
            myController.setCenter(centerPoint);
            myController.zoomToSpan(10, 10);
        }

 Inspecting in the debugger, the value of myLat = 37,062,500 and myLon
 = -95,677,706, which should be centered on San Francisco. But instead,
 the map remains centered on Kansas, which I think is the default.

 I got the geo locations for testing purposes by going to
 maps.google.com and entering San Francisco, then generating a string
 intended for emailing, then picking the lat/lon values from that
 string. As far as I know, the GeoPoint passed to setCenter is just
 those values multiplied by 1e6.

 Any ideas why it's not working?

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

Android 2.2 Programming Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Emulator

2010-07-12 Thread Mark Murphy
On Mon, Jul 12, 2010 at 2:59 PM, kypriakos demet...@ece.neu.edu wrote:
 I am assuming that you cannot perform software reloading on the
 emulator
 without restarting it (i.e. OSGi containers).

AFAIK, Android does not support OSGi containers.

You can reload software on the emulator without restarting it, though.

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

Android App Developer Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Calling localhost web service from emulator

2010-07-12 Thread Mark Murphy
On Sat, Jul 10, 2010 at 6:17 AM, NIK nikolaos.katsa...@gmail.com wrote:
 So, the only way of calling a localhost web service from the emulator
 is by using the actual network IP address?

http://developer.android.com/guide/developing/tools/emulator.html#networkaddresses

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

Android App Developer Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] add view programmatically - crash

2010-07-12 Thread Mark Murphy
On Mon, Jul 12, 2010 at 5:13 PM, theresia freska
theresia.fre...@gmail.com wrote:
 I'm using Android API 8, AVD 2.2. I'm trying to add simple view
 programmatically, but everytime I try to run it in the simulator, the
 app crashes. It gives me error msg the app xxx has stopped
 unexpectedly with the force close button. When I comment this code,
 the app works fine. Can anyone give me a hint on where I code wrong?

Nothing in the LogCat dump you provide is a Java stack trace
associated with your error. Errors are noted with the word ERROR. In
DDMS, they are colored in red.

Your error, in this case, is that course_main is null, since you did
not assign any value to it.

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

Android App Developer Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] is doable with android 2.1 and upper ?

2010-07-12 Thread Mark Murphy
On Mon, Jul 12, 2010 at 5:49 PM, jean francois pion
jean.francois.p...@free.fr wrote:
 is it possible to make a software to read the incoming mail, read the
 subject and play a sound fonction of the characters string
 the sound must be different and customisable.

Only if the developer is writing the mail client. Different devices
will have different email programs, few (if any) of which have a
public documented/supported API.

 by the way if somebody knows why all the notifications get the same sound, I
 think it is silly to have the same sound for mail, sms.

Get a different email program, one that lets you configure the
notification sound. There are a few email programs on the Market
(e.g., K-9).

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

Android App Developer Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: add view programmatically - crash

2010-07-12 Thread Mark Murphy
On Mon, Jul 12, 2010 at 7:48 PM, theresia freska
theresia.fre...@gmail.com wrote:
 Thanks for pointing that out! But the same problem is still there. The
 app crashes, even closes itself before I click the force close
 button. Logcat doesn't give error msg. Any idea?

If you get a force close dialog saying your application has crashed,
then LogCat will have a Java stack trace. Please check again.

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

Android App Developer Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Gallery

2010-07-12 Thread Mark Murphy
On Mon, Jul 12, 2010 at 8:01 PM, Emmen Farooq farooq.em...@gmail.com wrote:
 Hi , Can I make an image gallery appear vertical ? The

     android:orientation=vertical

 thing doesn't work. It still appears horizontal . Thanks a lot in advance

If you look at the documentation for Gallery:

http://developer.android.com/reference/android/widget/Gallery.html

you will see that there is no android:orientation attribute available.
A Gallery can only be horizontal, AFAIK.

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

Android App Developer Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Error when adding gdata jar library to Android

2010-07-12 Thread Mark Murphy
On Mon, Jul 12, 2010 at 9:03 PM, Jennifer Francois
jennalexfranc...@gmail.com wrote:
 I am building an app that lets me upload a .doc document

Upload it...where?

 I was hoping to do this with gdoc but
 when i tried to add the gdata jar library and I get this message:
 Warning: Ignoring InnerClasses attribute for an anonymous inner class that
 doesn't come with an associated EnclosingMethod attribute. (This class was
 probably produced by a broken compiler.)
 What am I doing wrong?

Get the source code and recompile the JAR with your own compiler, or
integrate the source code into your project.

 Is there another way to upload and display a .doc
 document in Android?

Upload it...where?

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

Android App Developer Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Tabacitivty

2010-07-11 Thread Mark Murphy
On Sat, Jul 10, 2010 at 10:59 PM, Emmen Farooq farooq.em...@gmail.com wrote:
 In my app if I extend my activity from TabAcitivty and then include
 tabs , the app works fine , but if I remove the tabs and main activity
 is still extended from Tabactivty ,the app crashes ? Any advice ?

Have at least one tab.

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

Android Training...At Your Office: http://commonsware.com/training

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Restricting the input in an edit text

2010-07-11 Thread Mark Murphy
On Sat, Jul 10, 2010 at 10:54 PM, Emmen Farooq farooq.em...@gmail.com wrote:
 How do I

 a ) Restrict special characters from being entered into an edit text ?

I have no idea what special characters are.

Take a look at android:inputType and setKeyListener().

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

Android Training...At Your Office: http://commonsware.com/training

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners]

2010-07-10 Thread Mark Murphy
On Sat, Jul 10, 2010 at 1:14 PM, Raul Martinez raul5...@gmail.com wrote:
 i have a list view and i want to click one of the items and i want it to
 open up another list view what should i do to make this happen?

If you are using ListActivity, override onListItemClick(), then in
there call startActivity() to start up your activity with the next
ListView.

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

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

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Consolidating two SharedPreferences issues.

2010-07-09 Thread Mark Murphy
On Fri, Jul 9, 2010 at 1:58 PM, Bret Foreman bret.fore...@gmail.com wrote:
 First SharedPreferences.getInt and SharedPreferences.getFloat are both
 throwing ClassCastException.

That is because the preferences in question are not integers or
floats. The ClassCastException will tell you what the actual type of
data is that you are dealing with (probably a string). Retrieve the
preference in its native format, then convert it as needed in Java
code.

 In addition, ListPreference is stopping with an uncaught
 exception when I attempt to set the preference from the screen, but
 only if there is a defaultValue set.

AFAIK, you cannot have a ListPreference of an integer-array.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Consolidating two SharedPreferences issues.

2010-07-09 Thread Mark Murphy
string-array

On Fri, Jul 9, 2010 at 2:37 PM, Bret Foreman bret.fore...@gmail.com wrote:
 If not an integer-array, what should be the type of the parallel
 array for the ListPreference?

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] changing the shape of buttons

2010-07-09 Thread Mark Murphy
On Fri, Jul 9, 2010 at 5:51 PM, TreKing treking...@gmail.com wrote:
 On Fri, Jul 9, 2010 at 2:29 PM, Justin Anderson janderson@gmail.com
 wrote:

 You would need to make your own to do that.

 Or simply change the image shown on it to make it appear that way ...

Actually, it would have to be the background that is changed, to make
it appear non-rectangular. Since the background is a StateListDrawable
defined via an XML drawable resource, this is eminently doable, but
not something you can do in five minutes.

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] framelay out

2010-07-09 Thread Mark Murphy
Because TabHost expects a FrameLayout to hold the contents of the tabs.

On Fri, Jul 9, 2010 at 7:21 PM, Emmen Farooq farooq.em...@gmail.com wrote:
 why does removing framelayout block  from the main.xml  in the
 following app crashes it

 http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
 , thanks in advance for any help

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

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Exception when using a BroadcastReceiver for battery-change events

2010-07-08 Thread Mark Murphy
Agreed. When you get an exception, scan down the stack trace and look
for the Caused by: stanza, as that is where the real problem lies.

On Thu, Jul 8, 2010 at 12:35 AM, Yousuf Faheem
yousuf.syed@gmail.com wrote:
 I guess its because you are either using String for some other data type or
 using some other data type instead of String. Possibly in the
 CommonTempLogic();

 Place CommonTempLogic in the try catch block and see.

 Caused by: java.lang.ClassCastException: java.lang.String

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

Android App Developer Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Access to Download Manager?

2010-07-08 Thread Mark Murphy
On Wed, Jul 7, 2010 at 6:07 PM, Florp sgoff...@gmail.com wrote:
 The Market and Web-Browser apps seem to share a nice download manager;
 is there a way to use that in my own Apps?

No, sorry, that is not part of the Android SDK at this time.

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

Android App Developer Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Screen problem

2010-07-08 Thread Mark Murphy
On Thu, Jul 8, 2010 at 2:48 PM, Saket Srivastav
saketsrivasta...@gmail.com wrote:
 i want them to appear in landscape as well as portrait view.

Use onSaveInstanceState() and onRestoreInstanceState(), or use
onRetainNonConfigurationInstance() and
getLastNonConfigurationInstance() to propagate  your data from the old
activity to the newly-created one in the new orientation.

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

Android App Developer Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Relationship between bindService and onServiceConnected

2010-07-07 Thread Mark Murphy
On Tue, Jul 6, 2010 at 11:43 PM, Bret Foreman bret.fore...@gmail.com wrote:
 I think I may be confused about how these two methods are related. My
 bind code looks something like this:

 bindService(new Intent(myActivity.this,
                    myService.class), myServiceConnection,
 Context.BIND_AUTO_CREATE));

 Now, when I call this, the onServiceConnected method of
 myServiceConnection is never getting called, despite the fact that
 bindService is returning a true value as if it was successful. I know
 that these activities are asynchronous but I'm not see
 onServiceConnected getting called even after some time has passed.

 Any ideas on where I should look for the problem?

Look for LogCat messages in adb logcat, DDMS, or the DDMS perspective
in Eclipse.

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

_Android Programming Tutorials_ Version 2.8 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Exception when using a BroadcastReceiver for battery-change events

2010-07-07 Thread Mark Murphy
There should be more to your stack trace, showing you the true cause
of the error.

On Wed, Jul 7, 2010 at 6:13 PM, Bret Foreman bret.fore...@gmail.com wrote:
 I want to monitor battery temperature, if available. I create a
 Receiver like this:

    private BroadcastReceiver myTempReceiver = new BroadcastReceiver()
 {

               �...@override
                public void onReceive(Context ctx, Intent myIntent ) {
                        int temp = myIntent.getIntExtra( 
 BatteryManager.EXTRA_TEMPERATURE ,
 0 );
                        commonTempLogic( (float) temp );
                }


 And I register it like this:

                registerReceiver(myTempReceiver, new
 IntentFilter(Intent.ACTION_BATTERY_CHANGED));

 When onReceive gets the first Intent, it fails with an exception:

 07-07 22:10:01.186: ERROR/AndroidRuntime(777):
 java.lang.RuntimeException: Error receiving broadcast Intent
 { act=android.intent.action.BATTERY_CHANGED flg=0x4000 (has
 extras) } in com.shipmate.sensorservic...@43d1b250

 Any idea why this might be happening?

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

 NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
 android-beginners+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en




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

_Android Programming Tutorials_ Version 2.8 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Exception when using a BroadcastReceiver for battery-change events

2010-07-07 Thread Mark Murphy
On Wed, Jul 7, 2010 at 7:02 PM, Bret Foreman bret.fore...@gmail.com wrote:
 Here's the full stacktrace from traces.txt:

No, I meant from LogCat. Use adb logcat, DDMS, or the DDMS perspective
in Eclipse. Below your Error receiving broadcast Intent should be
another exception indicating the root cause.

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

_Android Programming Tutorials_ Version 2.8 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] UI Question - ListView and Relative View

2010-07-06 Thread Mark Murphy
On Tue, Jul 6, 2010 at 4:06 AM, Daniel Favela dfav...@gmail.com wrote:
 Hello, Android beginners!
 I've completed all of the tutorials under the Hello, Views section.
  However, I'm unsure if what I want to do is possible.
 I want the top of my UI to be a edit box and a button (much like in the
 Relative layout tutorial), and then everything following that should be a
 ListView.
 At first, I thought, Hm.  It might not work, but maybe I can mix the XML.
  Something like RelativeLayout ... ... /RelativeLayout followed by a
 ListView ... /ListView.  The problem I came across was that ListView is
 not created through XML;  instead, the code for it is within an activity.

It is not created through XML in that specific example. There are
other examples:

http://github.com/commonsguy/cw-android/tree/master/Selection/List/

 So... how can I get my UI to have these two layouts?

RelativeLayout holds everything else, including the ListView. You use
RelativeLayout rules (e.g., android:layout_alignParentTop,
android:layout_below) to position the widgets relative to each other
and the bounds of the RelativeLayout.

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

_Android Programming Tutorials_ Version 2.8 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Designing a UI, need help

2010-07-06 Thread Mark Murphy
On Mon, Jul 5, 2010 at 11:40 PM, ocdtrekkie jtn...@gmail.com wrote:
 I've tried to post both in the Google Groups in Android Developers and
 Android Beginners as well as Stack Overflow before on how to create a
 specific UI element and gotten no response from either

And the links to these would be...?

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

_Android Programming Tutorials_ Version 2.8 Available!

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Application not scrolling

2010-07-05 Thread Mark Murphy
On Mon, Jul 5, 2010 at 5:09 PM, Tanay M. Kapoor tmkap...@gmail.com wrote:
 Ok this is probably a stupid question but,
 i have an activity in my application, its a form with lots of
 editTexts and buttons
 and it is longer than the screen can show in one time...
 and in my emulator when a click the down button to move to the next
 editText the screen does now scroll with it...

 I have confirmed that i can input in the text filed and even click the
 buttons...but hte screen does not move down to show these
 elements ...?
 is there any setting i have to do to make this happen???

Wrap everything in a ScrollView.

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

Android Consulting: http://commonsware.com/consulting

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Application still consumes battery even tough it is closed

2010-07-04 Thread Mark Murphy
On Sat, Jul 3, 2010 at 7:42 PM, Indicator Veritatis mej1...@yahoo.com wrote:
 That may be true, but if so, there is a serious problem with the
 online Android documentation. For as I have already shown, the
 documentation clearly states that there is a possible transition
 direct from the started state to the stopped state, one that does not
 call onPause() first.

That would occur in fairly rare cases, when something occurs on the
device after onStart() and before onResume(). Since those methods are
invoked in rapid succession, something else taking over the screen
(e.g., phone call comes in) during that window is rather unlikely.
Developers should not be worrying about that particular scenario very
much, if at all.

 So other than your own authority, on what grounds do you say that the
 docs are wrong?

The docs are not wrong. However, my previous post was covering the
99.999% case, not every possible scenario.

On Sat, Jul 3, 2010 at 7:50 PM, Indicator Veritatis mej1...@yahoo.com wrote:
 This is certainly wrong.

No, it is certainly correct.

 Pressing the Back key does NOT cause
 onDestroy() to be called.

Yes, it does.

 It causes onPause() to be called.

And onStop(), and onDestroy().

 I have run
 this in the emulator too many times myself to believe that it does.

I even had to run my own test, just to confirm I hadn't slid into some
parallel dimension, before writing my previous post. onDestroy() is
called after the BACK button is pressed, just like it is supposed to.
It has behaved this way for over two years.

If you are unable to replicate this, there is a problem in your
development environment.

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

Android Consulting: http://commonsware.com/consulting

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Application still consumes battery even tough it is closed

2010-07-04 Thread Mark Murphy
On Sun, Jul 4, 2010 at 7:21 PM, Indicator Veritatis mej1...@yahoo.com wrote:
 Do you
 really want to encourage, for example, Android programmers to fail to
 handle correctly the case where onStop() is called without a
 preceding, corresponding call to onPause()? Such programming sounds
 very careless to me.

Generally, I'd recommend the implementations be independent. Wherever
possible, onStop() should not care whether or not onPause() preceded
it, even though most of the time, it will. That's pretty basic state
machine design.

 Even if most of the time (even your 99.999% is an overstatement), the
 programmer can ignore this scenario, he should be aware that it
 exists, so then when he needs to take care of it, he knows that he
 needs to do so.

I'm not arguing that it'd be nice if the docs explained the
circumstances of all of these corner cases better.

 Similarly with the second issue: even Google violates the rule [that
 onBackPressed() should cause onDestroy() to be called] often enough
 that your readers are going to be confused if they forget that some
 apps really do override onBackPressed(), they don't all call
 onDestroy().

I am sincerely hoping that somebody who overrides onBackPressed() will
notice that their fingers typed those keystrokes and will therefore
consider that, gee, maybe onBackPressed() might have something to do
with what happens when BACK is pressed. I am not aware of any supplied
Activity implementation (e.g., ListActivity) that overrides
onBackPressed(), so such behavior will not be hidden too often.

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

Android Consulting: http://commonsware.com/consulting

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Unable to start service

2010-07-03 Thread Mark Murphy
On Sat, Jul 3, 2010 at 1:45 PM, Bret Foreman bret.fore...@gmail.com wrote:
 OK, so let me state where we stand at the moment. Current code to
 start service:

                                        Intent myIntent = new Intent();
                                        myIntent.setClass(MainActivity.this, 
 SensorService.class);
                                        startService( myIntent );

 I have a breakpoint at the top of the onStartCommand method of
 SensorService and it's never getting hit.

Because your problem is in your constructor or initializer:

 E/AndroidRuntime(  221): Caused by: java.lang.NullPointerException
 E/AndroidRuntime(  221):        at
 android.content.ContextWrapper.getApplication
 Context(ContextWrapper.java:100)
 E/AndroidRuntime(  221):        at
 com.shipmate.SensorService.init(SensorServi
 ce.java:26)

Go to line 26 of SensorService.java. You are attempting to do
something there that cannot be done in a constructor or initializer.
Move that code to onCreate() of your service, and you should be in
better shape.

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

Android 2.2 Programming Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] How to install and run Python on Adroid?

2010-07-03 Thread Mark Murphy
On Sat, Jul 3, 2010 at 12:31 PM, Rick Liu totoroliu1...@gmail.com wrote:
 I have a software application written in Python.

 How to install Python interpreter and run Python program on Android?

See the Android Scripting Environment:

http://code.google.com/p/android-scripting/

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

Android 2.2 Programming Books: http://commonsware.com/books

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] back button when in ListActivity causes runtime exception

2010-07-02 Thread Mark Murphy
On Fri, Jul 2, 2010 at 11:50 AM, Bret Foreman bret.fore...@gmail.com wrote:
 When my ListActivity is active and I press the back button (in the
 Droid simulator), my application stops with a runtime exception. The
 stack trace looks like this:

 ActivityThread.performDestroyActivity(IBinder, boolean, int, boolean)
 line: 3421
 ActivityThread.handleDestroyActivity(IBinder, boolean, int, boolean)
 line: 3487
 ActivityThread.access$2800(ActivityThread, IBinder, boolean, int,
 boolean) line: 119
 BinderProxy(ActivityThread$H).handleMessage(Message) line: 1896
 ActivityThread$H(Handler).dispatchMessage(Message) line: 99
 Looper.loop() line: 123
 ActivityThread.main(String[]) line: 4363
 Method.invokeNative(Object, Object[], Class, Class[], Class, int,
 boolean) line: not available [native method]
 Method.invoke(Object, Object...) line: 521
 ZygoteInit$MethodAndArgsCaller.run() line: 860
 ZygoteInit.main(String[]) line: 618
 NativeStart.main(String[]) line: not available [native method]

There is probably more to your stack trace than this. Usually stack
traces have an exception, for example.

 I verified with breakpoints in the debugger that the ListActivity
 onDetroy method is never being called. What should be my next
 debugging step?

Continue reading your stack trace. Look for the Caused by: line to
find out the actual exception.

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

Android Training...At Your Office: http://commonsware.com/training

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Unable to start service

2010-07-02 Thread Mark Murphy
On Fri, Jul 2, 2010 at 12:01 PM, Bret Foreman bret.fore...@gmail.com wrote:
 I'm try to start a service like this:

                                                try {
                                                        Intent myIntent = new 
 Intent();
                                                        
 myIntent.setClass(cb.getContext(), SensorService.class);
                                                        startService( myIntent 
 );
                                                } catch( Exception e ){
                                                        android.util.Log.e( 
 getString(R.string.app_name) , Unable to
 start sensor service , e );
                                                }

Try replacing cb.getContext() with this.

 And I see a runtime exception like this:

 ActivityThread.handleCreateService(ActivityThread$CreateServiceData)
 line: 2764
 ActivityThread.access$3200(ActivityThread, ActivityThread
 $CreateServiceData) line: 119
 ActivityThread$CreateServiceData(ActivityThread
 $H).handleMessage(Message) line: 1917
 ActivityThread$H(Handler).dispatchMessage(Message) line: 99
 Looper.loop() line: 123
 ActivityThread.main(String[]) line: 4363
 Method.invokeNative(Object, Object[], Class, Class[], Class, int,
 boolean) line: not available [native method]
 Method.invoke(Object, Object...) line: 521
 ZygoteInit$MethodAndArgsCaller.run() line: 860
 ZygoteInit.main(String[]) line: 618
 NativeStart.main(String[]) line: not available [native method]

That is not an exception. It is a stack trace. You are missing the
exception part, and the Caused by: portion.

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

Android Training...At Your Office: http://commonsware.com/training

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] SQLiteOpenHelper.getWritableDatabase ambiguous documentation

2010-07-02 Thread Mark Murphy
On Fri, Jul 2, 2010 at 12:09 PM, Bret Foreman bret.fore...@gmail.com wrote:
 I'm looking at this page:

 http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html

 Note that in the section about getWritableDatabase there is the
 phrase: Create and/or open a database

 But getWritableDatabase is not calling the SQLiteOpenHelper.onCreate
 method which is where the DB gets created.

Then you already have a database.

 How can I cause onCreate to
 be called?

Delete the existing database (e.g., using DDMS's File Manager). Then
call getWritableDatabase().

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

Android Training...At Your Office: http://commonsware.com/training

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Unable to start service

2010-07-02 Thread Mark Murphy
On Fri, Jul 2, 2010 at 1:02 PM, Bret Foreman bret.fore...@gmail.com wrote:
 Intent.setClass needs a Context for the first argument. Replacing
 cb.getContext with this causes a compiler error. Do you mean I
 should call getApplicationContext?

No, I mean you should use the proper value of this.

Your code is:

try {
   Intent myIntent
= new Intent();

myIntent.setClass(cb.getContext(), SensorService.class);
   startService( myIntent );
   } catch( Exception e ){

android.util.Log.e( getString(R.string.app_name) , Unable to
start sensor service , e );
   }

Do you see your call to startService()? That is a method on Context.
Whatever object you are in, it is a Context. If this gives you a
compiler error, yet startService() does not, that means this code
snippet comes from an inner class, and so you need to scope your
this to the proper outer class (e.g., MyActivity.this).

 Here's the full trace:

Perhaps Eclipse considers that to be a trace. It is useless to me and,
presumably, to you.

If you continue execution past this point, your exception, with a full
exception message and two-tier stack trace, will be written to logcat.
This will be accessible from Eclipse via the DDMS perspective, in the
LogCat tab, in red.

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

Android Training...At Your Office: http://commonsware.com/training

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: back button when in ListActivity causes runtime exception

2010-07-02 Thread Mark Murphy
Please see my answer for your other question for some thoughts on how
to get a real stack trace.

On Fri, Jul 2, 2010 at 12:55 PM, Bret Foreman bret.fore...@gmail.com wrote:
 Here's the full trace from the debugger.

 com.shipmate.MainActivity [Android Application using Studio for
 Android]
        DalvikVM[localhost:8610]
                Thread [3 main] (Suspended (exception RuntimeException))
                        ActivityThread.performDestroyActivity(IBinder, 
 boolean, int,
 boolean) line: 3421
                        ActivityThread.handleDestroyActivity(IBinder, boolean, 
 int,
 boolean) line: 3487
                        ActivityThread.access$2800(ActivityThread, IBinder, 
 boolean, int,
 boolean) line: 119
                        BinderProxy(ActivityThread$H).handleMessage(Message) 
 line: 1896
                        ActivityThread$H(Handler).dispatchMessage(Message) 
 line: 99
                        Looper.loop() line: 123
                        ActivityThread.main(String[]) line: 4363
                        Method.invokeNative(Object, Object[], Class, Class[], 
 Class, int,
 boolean) line: not available [native method]
                        Method.invoke(Object, Object...) line: 521
                        ZygoteInit$MethodAndArgsCaller.run() line: 860
                        ZygoteInit.main(String[]) line: 618
                        NativeStart.main(String[]) line: not available [native 
 method]
                Thread [13 Binder Thread #2] (Running)
                Thread [11 Binder Thread #1] (Running)
                Thread [15 Binder Thread #3] (Running)

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

 NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
 android-beginners+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en




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

Android Training...At Your Office: http://commonsware.com/training

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: SQLiteOpenHelper.getWritableDatabase ambiguous documentation

2010-07-02 Thread Mark Murphy
On Fri, Jul 2, 2010 at 1:19 PM, Bret Foreman bret.fore...@gmail.com wrote:
 I'm in the DDMS file manager now and can't see anything related to
 SQLite. Do you know the exact path and filename for the datafle?

Sorta. /data/data/your.package.name/databases/your.database.name

where your.package.name is the package you gave your application in
the manifest, and your.database.name is the name you gave the
database.

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

Android Training...At Your Office: http://commonsware.com/training

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

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


  1   2   3   4   5   6   7   8   9   10   >