Re: [android-developers] Re: Compatibility mode issues on 4.x

2013-04-18 Thread Mark Murphy
On Thu, Apr 18, 2013 at 3:53 AM, user123 ivanschu...@gmail.com wrote:
 I did the work to optimize layout for xhdpi devices

Then you did it wrong. Layouts should be density-independent. The
layout of an Xperia Z (xxhdpi) should be the same as a Galaxy Nexus
(xhdpi), which should be the same as a Nexus S (hdpi), etc., as they
are all the same basic screen size, within fractions of an inch.

Screen size != screen density. In fact, there is no correlation between the two.

--
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 4.7 Available!

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




Re: [android-developers] Re: Compatibility mode issues on 4.x

2013-04-17 Thread Mark Murphy
If you read the documentation:

http://developer.android.com/guide/topics/manifest/supports-screens-element.html#largestWidth

it says:

Note: Currently, screen compatibility mode emulates only handset
screens with a 320dp width, so screen compatibility mode is not
applied if your value for android:largestWidthLimitDp is larger than
320.


On Wed, Apr 17, 2013 at 4:26 PM, user123 ivanschu...@gmail.com wrote:
 Ok, the issue is confirmed. I created a brand new project with a blank
 activity, and ran it on a tablet.

 The only modification I did was in the manifest, as follows:

 uses-sdk android:minSdkVersion=8 android:targetSdkVersion=8 /
 supports-screens android:largestWidthLimitDp=320 /


 Then the app goes in compatibility mode - Hello world! is zoomed. Fine.

 But if I change to 321 dp - It doesn't go into compatibility mode.


 I tested with a Nexus 7 tablet, Nexus 7 emulator, and 10.1 inches tablet
 emulator.

 Is this a bug?



 Am Dienstag, 19. März 2013 17:46:49 UTC+1 schrieb user123:

 I'm trying to force compatibility mode on tablets, for a certain app,
 because I don't work on it anymore - and currently it looks really really
 messed up on tablets.

 According to the documentation:
 http://developer.android.com/guide/practices/screen-compat-mode.html

 There are many different options to set up in the manifest, to make it
 possible, to the user, to enable compatibility mode. This is not exactly
 what I want, but anyways, maybe worth to mention, these options didn't work.
 I couldn't find anything on the device to switch to compatibility mode. I
 used a Nexus 7 with 4.2.

 Now there's the part which I need - and I also can't get it to work. To
 force compatibility mode, it I have to use this element:

 supports-screens android:largestWidthLimitDp=320 /

 When I let the value 320 there, my Galaxy Nexus smartphone goes in
 compatibility mode. That is unwanted.
 The Nexus 7 also does, this is good.
 So I have to use bigger dp - But starting at 321, for some reason I don't
 understand, the Nexus 7 doesn't go anymore in compatibility mode.

 Is this normal? According to what I read the dp of the shortest side of
 the Nexus 7 is more than 500, why then it stops on 321?

 I would let it on 320, but I have optimized layouts for this screen size
 and don't want these to go in compatibility mode.

 Thanks.




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





-- 
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 4.7 Available!

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




Re: [android-developers] How to keep WiFi on and let screen go to sleep?

2013-04-10 Thread Mark Murphy
On Wed, Apr 10, 2013 at 4:06 PM, plnelson pna...@gmail.com wrote:
 But it does.   As I said, it sends a FIN packet - that's a request to
 close the connection.   The server responds with an ACK and.a FIN of its own
 which Android ACKs.   This is the textbook-standard way to close a TCP
 connection, and it's initiated by Android when the display goes off. We
 watch it all on our network sniffers and it's 100% reliable and repeatable.

I'm no low-level WiFi expert, but if WiFi were powered down, I would
expect precisely zero of these packets. Are you sure nothing in your
app is closing the socket? Say, courtesy of an onPause() or onStop()
call when the screen turns off?

--
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 4.7 Available!

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




Re: [android-developers] Re: Proper documentation for SQLite usage missing - I need guidance

2013-04-05 Thread Mark Murphy
On Fri, Apr 5, 2013 at 9:58 AM, Jan Skarvall jan.skarv...@telia.com wrote:
 The statement that Android ships with SQLite 3.4.0 is still there, see
 http://developer.android.com/reference/android/database/sqlite/package-summary.html

This is incorrect.

 At the same time there are additions to the SQLiteDatabase in API level 11,
 e.g. enableWriteAheadLogging(), that hints at level 11 being based on SQLite
= 3.7.0, see http://www.sqlite.org/wal.html.
 Is it really possible that Android have implemented WAL on top of SQLite
 3.4.0?

No. API Level 11 is using SQLite 3.7.4:

http://stackoverflow.com/a/4377116/115145

 If not, why is there no information on the Android Developer site that
 specifies that you could rely on using SQLite 3.7.0 syntax when you are
 using level 11 as the minSdkLevel?

Because nobody typed up that portion of the documentation.

--
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 4.7 Available!

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




Re: [android-developers] Re: zygote preloading jars

2013-03-23 Thread Mark Murphy
On Sat, Mar 23, 2013 at 1:43 AM, miten imi...@yahoo.com wrote:
 You are suggesting that custom ROM is the only way to get apks share
 libraries ?

It is the only way to distribute a shared library. The recipe that
skink is having you follow is fine if you have one device (or
emulator), which you can root and change.

 I would like to see some simplified article showing how to
 achieve it in addition to google link you provided before I start in this
 custom rom direction.

Read skink's messages. Then ask yourself how you plan on forcing
everyone who uses your apps to follow skink's recipe.

--
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 4.7 Available!

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




Re: [android-developers] How to solve the issue with Dalvik compiler limitation on 64K methods?

2013-03-22 Thread Mark Murphy
I presume that there's a recipe for that, though I do not know what it is.

The right answer to your problem (the application architecture should
probably be restructured) is one you discarded. Any solution to work
around this problem temporarily may come with side effects, such as
having to drop debug/run builds within the IDE temporarily.
Software development does not require an IDE or debug builds.

On Fri, Mar 22, 2013 at 5:13 AM, Ricardo Amaral
mas...@ricardoamaral.net wrote:
 That's what I keep being told but how can I still use Eclipse and execute
 debug/run builds within the IDE and still run Proguard?


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





-- 
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 4.7 Available!

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




Re: [android-developers] Re: zygote preloading jars

2013-03-22 Thread Mark Murphy
On Fri, Mar 22, 2013 at 7:55 AM, miten imi...@yahoo.com wrote:
 It seems that this is google play store filter.  If I try to deploy to
 emulator by first pushing shared framework and then the using apk it
 complains on missing shared library.

That is because your emulator is not running your own version of
Android that adds in this library.

--
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 4.7 Available!

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




Re: [android-developers] Is there a way to dismiss the Contextual Action Bar (CAB) menu?

2013-03-22 Thread Mark Murphy
Call finish() on the ActionMode when you want to manually dismiss it.

On Fri, Mar 22, 2013 at 3:56 PM, Marty Rehder martyg...@gmail.com wrote:
 I have an app with a series of files in being shown via an Activity. Each
 file has a checkbox.
 If the user clicks any of the chedckboxes, I bring up the CAB menu for the
 user to operate
 on the file. My onClickListener starts things, and, I was hoping, could
 dismiss the CAB if
 the checkboxes are all unchecked.

 private OnClickListener clickChange = new OnClickListener() {
 public void onClick(View v) {
 // check to see if SelectAll checkbox was selected
 Boolean state = false;
 /*
snip
 */

  // Start the CAB using the ActionMode.Callback defined above if
 anything is selected
 if (anyChecked()) { //
 mActionMode =
 showFileActivity.this.startActionMode(mActionModeCallback);
 }
 else if (mActionMode != null) {
 mActionMode = null;

 }
 }
 };

 Simply setting mActionMode to null won't clear the CAB.  Any ideas on
 what/how to dismiss the CAB
 when the user has un-selected everything?


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





-- 
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 4.7 Available!

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




Re: [android-developers] Re: How to display Options Menu Vertically

2013-03-21 Thread Mark Murphy
You do not control the layout of the options menu/overflow menu.
Whether it is horizontal (I presume referring to the old-style
options menu) or not is up to the framework and will be dependent on
the OS version you are running on. Please allow the menu to render the
same for your app as it does for all other apps on the device, so the
user knows what to expect.


On Thu, Mar 21, 2013 at 5:26 AM, abhijit achakr...@gmail.com wrote:
 i also wanted that still there is no answar for this question.

 On Wednesday, November 11, 2009 12:00:29 PM UTC+5:30, Swati wrote:

 Hi,

 I was trying to display the Options Menu to be vertically stacked
 instead of the Horizontal one supported by the framework as of now.Can
 some one suggest me how to achive this.

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





-- 
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 4.7 Available!

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




Re: [android-developers] zygote preloading jars

2013-03-21 Thread Mark Murphy
On Thu, Mar 21, 2013 at 7:27 AM, miten imi...@yahoo.com wrote:
 If it is possible with zygote

Only if you are creating your own version of Android, from the source
code, and rolling that into your own ROM mod or device. Please visit
http://source.android.com for more information on the Android source
code.

--
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 4.7 Available!

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




Re: [android-developers] How to solve the issue with Dalvik compiler limitation on 64K methods?

2013-03-21 Thread Mark Murphy
ProGuard should get rid of many of the protobuf methods.

http://stackoverflow.com/questions/15508477/android-my-application-is-too-large-and-gives-unable-to-execute-dex-method-id

On Thu, Mar 21, 2013 at 6:51 PM, Ricardo Amaral
mas...@ricardoamaral.net wrote:
 My team and I have inherited a large Android project from another team. The
 whole application with all the included libraries is reported to have around
 35000 methods. We now have the task to implement a new service in the app
 where we need to use Protocol Buffers.

 The problem is that the generated .jar file with all the required .proto
 files creates another couple of 35000 methods, that's 7 methods. And if
 you are not aware, the Android compiler has a limitation of 65536 methods
 per .dex file. We are clearly over that limit and we are getting the
 following error trying to compile the app:

 Unable to execute dex: method ID not in [0, 0x]: 65536
 Conversion to Dalvik format failed: Unable to execute dex: method ID not in
 [0, 0x]: 65536

 Yes, the application architecture should probably be restructured but that
 will take time. And for now we are trying to figure out a solution to work
 around this problem temporarily.

 Any suggestions?

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





-- 
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 4.7 Available!

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




Re: [android-developers] version problem for xml themes ,

2013-03-16 Thread Mark Murphy
Use Theme.Light on those older devices.

If you created your project recently using the Eclipse new-project
wizard, much of that may already be set up for you. If not:

Step #1: In res/values/styles.xml, have something like this:

resources
style name=AppTheme parent=android:Theme.Light/
/resources

Step #2: In res/values-v11/styles.xml, have something like this:

resources
style name=AppTheme parent=android:Theme.Holo.Light/
/resources

Step #3: Use AppTheme in your manifest instead of Theme.Holo.Light


On Sat, Mar 16, 2013 at 3:10 PM, Kaushik Pendurthi
kaushiks...@gmail.com wrote:
 hi all,

  i am using  Theme.Holo.Light in android 4.2 (api level 17 ). But now i want
 to make it compatible to 2.3 (api level 10 ) . Can someone suggest a way i
 can do it?

 --
 ThanksRegards
 Kaushik Pendurthi

 http://kaushikpendurthi.blogspot.com/

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





--
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 4.6 Available!

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




Re: [android-developers] version problem for xml themes ,

2013-03-16 Thread Mark Murphy
That is because you changed your build target. Leave your build target
where it was. Set your android:minSdkVersion to 10 in your manifest.
Lint (Eclipse or command line) will point out to you when you use
classes and methods that are available from the build target but
exceed your minSdkVersion.

On Sat, Mar 16, 2013 at 3:34 PM, Kaushik Pendurthi
kaushiks...@gmail.com wrote:
 But when i do step 2 i get this error :

 error: Error retrieving parent for item: No resource found that matches the
 given name 'android:style/
  Theme.Holo.Light'.


 On Sat, Mar 16, 2013 at 3:20 PM, Mark Murphy mmur...@commonsware.com
 wrote:

 Use Theme.Light on those older devices.

 If you created your project recently using the Eclipse new-project
 wizard, much of that may already be set up for you. If not:

 Step #1: In res/values/styles.xml, have something like this:

 resources
 style name=AppTheme parent=android:Theme.Light/
 /resources

 Step #2: In res/values-v11/styles.xml, have something like this:

 resources
 style name=AppTheme parent=android:Theme.Holo.Light/
 /resources

 Step #3: Use AppTheme in your manifest instead of Theme.Holo.Light


 On Sat, Mar 16, 2013 at 3:10 PM, Kaushik Pendurthi
 kaushiks...@gmail.com wrote:
  hi all,
 
   i am using  Theme.Holo.Light in android 4.2 (api level 17 ). But now i
  want
  to make it compatible to 2.3 (api level 10 ) . Can someone suggest a way
  i
  can do it?
 
  --
  ThanksRegards
  Kaushik Pendurthi
 
  http://kaushikpendurthi.blogspot.com/
 
  --
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
  ---
  You received this message because you are subscribed to the Google
  Groups
  Android Developers group.
  To unsubscribe from this group and stop receiving emails from it, send
  an
  email to android-developers+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 



 --
 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 4.6 Available!

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





 --
 ThanksRegards
 Kaushik Pendurthi

 http://kaushikpendurthi.blogspot.com/

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





--
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 4.6 Available!

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




Re: [android-developers] Disable or Enable Applications through our Application.

2013-03-15 Thread Mark Murphy
On Fri, Mar 15, 2013 at 3:52 AM, Seshu s.seshu...@gmail.com wrote:
   Is there option Disable or Enable other Android Applications
 through our Application?

Fortunately, no.

-- 
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 4.6 Available!

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




Re: [android-developers] Re: OutofMemory Excepton error in android

2013-03-14 Thread Mark Murphy
On Thu, Mar 14, 2013 at 12:28 PM, Piren gpi...@gmail.com wrote:
 There's quite a big discussion of this bug somewhere hidden in the bug
 reports, i've come across the issue myself and found its rather easy to
 replicate.

 basically just write a loop that allocate a whole boat load of memory. run
 it till it poops on you then limit it to do a bit less iterations. that way
 the heap size will grow to very close to the top limit.
 then drop all the objects to free up the heap (you can even force a GC).

 wait a short while to see the heap is truely cleared, then allocate a big
 object (big enough to pass the difference between Total and Max heap size
 but smaller than the free heap space). see the world come down and say
 WTF?

 basically they check memory allocation against the total heap size instead
 of the free heap size.

Your scenario doesn't necessarily prove this claim.

Dalvik's garbage collector is a non-compacting garbage collector.
Hence, you can fragment your heap space, whereby while you have lots
of free heap, but there is no contiguous block big enough to satisfy a
particular request.

Your loop that allocate a whole boat load of memory is fragmenting
your heap space.

The only way that your scenario would prove your claim is if your
individual allocations in the whole boat load of memory are larger
than the request that then fails.

--
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 4.6 Available!

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




Re: [android-developers] Re: Can this variable become null?

2013-03-14 Thread Mark Murphy
On Thu, Mar 14, 2013 at 7:00 PM, user123 ivanschu...@gmail.com wrote:
 What is the problem with singleton?

http://stackoverflow.com/questions/7026507/why-are-static-variables-considered-evil
http://stackoverflow.com/questions/137975/what-is-so-bad-about-singletons

And, since they don't seem to emphasize the point quite enough for my
taste: static data members are, by definition, memory leaks. How *bad*
of a memory leak they are depends on what they are and how they are
used.

Like many programming techniques, singletons can be used as a scalpel
or a sledgehammer. The general advice against singletons is because
most people reading that advice are inexperienced and are likely to do
damage with either a scalpel or a sledgehammer.

On the whole, AFAICT, tolerance for singletons decreases with
increased production Java development experience, based on the
conversations that I have had on the topic over the past few years.

--
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 4.6 Available!

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




Re: [android-developers] Re: How to replace the ItemizedOverlay with onTap event

2013-03-13 Thread Mark Murphy
=wrap_content
 android:layout_width=fill_parent
 android:id=@+id/item_phone
 android:text=@string/item_phone
 android:textSize=16sp
 android:autoLink=phone
 android:textColor=#FF00/TextView
 TextView android:layout_height=wrap_content
 android:layout_width=fill_parent
 android:id=@+id/item_email
 android:text=@string/balloon_item_email
 android:autoLink=email
 android:textSize=16sp/TextView
 /LinearLayout
 ImageView android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:src=@drawable/icon_close_32
 android:id=@+id/close_img_button
 android:paddingLeft=12dip
 android:paddingBottom=12dip
 android:paddingRight=6dip
 android:paddingTop=6dip/ImageView
 /LinearLayout

 Many Thanks!




 On Wed, Mar 13, 2013 at 2:34 PM, Edward Lin edwardlinw...@gmail.com wrote:

 I will have a try and let you know the results.

 Thanks!




 On Wed, Mar 13, 2013 at 3:25 AM, Martin warwo...@gmail.com wrote:

 Can you use the InfoWindowAdapter and override it's GetInfoContent
 handler to supply your own custom View and in that custom View create the
 clickable Views you require?


 https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/GoogleMap.InfoWindowAdapter#getInfoContents%28com.google.android.gms.maps.model.Marker%29

 Martin.



 On Tuesday, March 12, 2013 9:29:00 PM UTC, elin wrote:

 According to the following link:
 https://developers.google.com/maps/documentation/android/v1/mapkey

 Note: Version 1 of the Google Maps Android API as been officially
 deprecated as of December 3rd, 2012. This means that from March 3rd, 2013
 you will no longer be able to request an API key for this version. No new
 features will be added to Google Maps Android API v1. However, apps using 
 v1
 will continue to work on devices. Existing and new developers are 
 encouraged
 to use Google Maps Android API v2.


 So I am trying to migrate my Android Map API to Google Map API V2. My
 Map application was using ItemsizedOverlay with onTap event so that user 
 can
 click the Overlay on different links, views or buttons to navigate to the
 destination or close the BalloonItem if user click the close button. But on
 API v2, the ItemizedOverlay is replaced as InfoWindow.  As a result, any
 listeners you set on the InfoWindow are disregarded and you cannot
 distinguish between click events on various parts of the view.

 I cannot believe migrate to Map API v2 is going to reduce the features
 of the Map application. Those features are something I cannot use without
 it. Can anyone let me know any alternative for getting onTap (or onClick)
 listener for the InfoWindow? Or what other control can provide the similar
 feature for InfoWindow.

 Many thanks!

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





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





--
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 4.6 Available!

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




Re: [android-developers] Re: How to replace the ItemizedOverlay with onTap event

2013-03-13 Thread Mark Murphy
On Wed, Mar 13, 2013 at 6:39 PM, Edward Lin edwardlinw...@gmail.com wrote:
 If I am using RelativeLayout to position the popup over the marker, is there
 any way I can get the location of the marker on the mapFragement when I
 click the marker?

Well, you know the latitude and longitude of the marker, as you
created it. You can get a Projection that will help you convert that
to an on-screen pixel coordinate.

-- 
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 4.6 Available!

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




Re: [android-developers] QR Code or NFC Tag: How to initiate download of a file

2013-03-09 Thread Mark Murphy
On Sat, Mar 9, 2013 at 4:36 PM, JavaSrvcs jvsr...@gmail.com wrote:
 if it is possible to program a NFC tag with an out of the box Android
 device, tap a NFC tag and have it download, install an app
 and start it running.

Only if you built your own edition of Android.

It is entirely possible to have an NFC tag point to a URL that, in
turn, points to an APK file. At best, all this will do is download the
file. The user will still have to manually indicate that they want to
install it, manually go through the installation steps, and manually
start the app once installed.

-- 
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 4.6 Available!

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




Re: [android-developers] Re: My BroadcastReceiver receiver not getting called after phone boots, any ideas?

2013-03-08 Thread Mark Murphy
 to set the real time at which the alarm
// should go off
Calendar alarmTime = Calendar.getInstance();
Calendar now = Calendar.getInstance();


alarmTime.setTimeInMillis(now.getTimeInMillis() + 1);
firstTime = alarmTime.getTimeInMillis();


// Repeat every day at 5pm
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, firstTime, interval,
pendingIntent);
 }
 catch(Exception e){
 }

 }

 };

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





--
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 4.6 Available!

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




Re: [android-developers] Re: My BroadcastReceiver receiver not getting called after phone boots, any ideas?

2013-03-08 Thread Mark Murphy
On Fri, Mar 8, 2013 at 3:11 PM, bob b...@coolfone.comze.com wrote:
 Also, shouldn't the broadcast receiver be for ACTION_BOOT_COMPLETED and not
 BOOT_COMPLETED?

No. In Java, we refer to it as Intent.ACTION_BOOT_COMPLETED. The
string value associated with that public static final data member is
android.intent.action.BOOT_COMPLETED.

That's not to say that the manifest has no other issues. For example,
the ALTERNATIVE stuff is downright bizarre.

--
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 4.6 Available!

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




Re: [android-developers] Enumerate sd cards

2013-03-08 Thread Mark Murphy
On Fri, Mar 8, 2013 at 4:21 PM, Yves Liu yves...@gmail.com wrote:
 Yes, have read the documentation. But that is not what I am looking
 for. The getExternalStorage() returns internal sd card (if there are
 both internal sd card and external sd card). I want to know how to
 find the external sd card path.

There is nothing in the Android SDK for this, at least at the present time.

-- 
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 4.6 Available!

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




Re: [android-developers] Why can't I do complete CTS test?

2013-03-07 Thread Mark Murphy
 receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.





--
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 4.6 Available!

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




Re: [android-developers] Handling SQLiteOpenHelper

2013-03-07 Thread Mark Murphy
On Thu, Mar 7, 2013 at 9:54 AM, Saurav to.saurav.mukher...@gmail.com wrote:
 How many SQLiteOpenHelper instances should be created? Should there be just
 one and should it be reused?

Ideally, yes, particularly if you are planning on accessing the
database from multiple threads. One SQLiteOpenHelper instance means
one SQLiteDatabase instance, and SQLiteDatabase is designed to manage
operations from multiple threads.

-- 
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 4.6 Available!

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




Re: [android-developers] API to access remove a device administrator

2013-03-07 Thread Mark Murphy
On Thu, Mar 7, 2013 at 12:48 PM, JavaSrvcs jvsr...@gmail.com wrote:
 I want to write an app that will do the following when run:

  remove a device administrator  (manually on the device can go to
 Settings-Security-Device Administrators) and uncheck

This is not possible via the SDK. The user is welcome to uncheck that
checkbox manually.

 Applications-clear cache

There's a hook for that somewhere, though I forget where off the top
of my head.

 drop/clear all application data

This is not possible via the SDK. Moreover, it is not necessary if you
are going to remove the application.

 force stop the application

This is not possible via the SDK. Moreover, it is not necessary if you
are going to remove the application.

 then remove the application

You can begin an uninstall from the SDK via startActivity() and an
appropriate UNINSTALL Intent, but the user has to be involved in the
process.

 I then want to download and re-install the application (from Google Play or
 a direct url to a .apk that I have).

You can download and begin an install from the SDK via startActivity()
and an Intent with the proper Uri (and MIME type for a local APK
file), but the user has to be involved in the process.

--
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 4.6 Available!

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




Re: [android-developers] Receiving Intent

2013-03-07 Thread Mark Murphy
On Thu, Mar 7, 2013 at 3:03 PM, TWProgrammers ip.progra...@gmail.com wrote:
 My app shows in the list for text files, I launch the file from a file
 manager such as ES File Explorer or IO File Manager: I click the file in the
 file manager at /mnt/sdcard/test.txt, the app list shows up, I click my app,
 it says it could not find /mnt/sdcard/mnt/sdcard/test.txt

Apparently there is a bug in your Java code where you are opening the file.

-- 
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 4.6 Available!

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




Re: [android-developers] Re: API to access remove a device administrator

2013-03-07 Thread Mark Murphy
On Thu, Mar 7, 2013 at 4:33 PM, JavaSrvcs jvsr...@gmail.com wrote:
 Thanks for all the help Mark:

 Is there a process to request things be put in the SDK, for example the
 things listed below that cannot now be accomplished?

You are welcome to do that engineering yourself, for your own ROM mods.

If you wish, in turn, to attempt to contribute those changes back to
the Android Open Source Project, instructions for doing so can be
found on http://source.android.com.

-- 
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 4.6 Available!

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




Re: [android-developers] How to programatically install an app (apk)

2013-03-07 Thread Mark Murphy
On Thu, Mar 7, 2013 at 5:52 PM, JavaSrvcs jvsr...@gmail.com wrote:
 Inside an activity, I want to be able to install an app
 From the Google Play Store
 From a url:  http://host/path_to/app.apk

These are mutually exclusive. One URL can *either* point to the Play
Store *or* point to your own Web site, not both.

Moreover, there is no way to point to the Play Store to trigger an
immediate download AFAIK.

 When the above code is run, I get this exception in the debugger
 // android.content.ActivityNotFoundException: No Activity found to
 handle Intent { act=android.intent.action.VIEW
 typ=application/vnd.android.package-arc

That's because you did not download the APK file. The installer will
not handle http: Uri values. You need to download the APK yourself to
external storage, then trigger an install of the downloaded APK.

 I am also looking for a way to install an app via the market URI, I have
 tried half a dozen examples and nothing works.

That's not supposed to work. You can lead the user to the Play Store
page for an app, but you cannot force the user to download it.

-- 
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 4.6 Available!

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




Re: [android-developers] How to block an Intent/Action until complete?

2013-03-07 Thread Mark Murphy
On Thu, Mar 7, 2013 at 7:28 PM, JavaSrvcs jvsr...@gmail.com wrote:
 I have an Activity that calls two methods:

   uninstallApp();
   installApp();

 The uninstallApp() runs and presents a confirmation dialog and then gets
 overlayed by an installation dialog.

 How do I block/pause the uninstallApp() dialog until that is complete before
 the app begins to install?

You can't. You will need to wait until you receive word from the OS,
from an ACTION_PACKAGE_REMOVED broadcast, that the uninstall was done
by the user, before you proceed trying to install the app.

--
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 4.6 Available!

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




Re: [android-developers] std::locale().name() returns C

2013-03-07 Thread Mark Murphy
You may be better served asking this on the android-ndk Google Group,
which is for NDK questions.

On Thu, Mar 7, 2013 at 7:49 PM, Shri shri.bo...@gmail.com wrote:
 std::locale().name() and std::locale().name() are both returning C on a
 JellyBean phone, instead of the expected En_US. Is it possible to get to
 the user's locale from C++ code?

 Thanks,
 Shri

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





--
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 4.6 Available!

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




Re: [android-developers] Tapping the overflow button make the action mode finish.

2013-03-06 Thread Mark Murphy
Action modes and the overflow menu do not work together, last I tried.
I have filed an issue on it:

https://code.google.com/p/android/issues/detail?id=23381

On Wed, Mar 6, 2013 at 3:13 AM, Hilda Chen hilda.chen0...@gmail.com wrote:
 Dear All:
  I have added some menu items to action mode of EditText, and two menu
 items gone to overflow. But when I tapped the overflow button,
 the action mode disappeared at once.
 Why?
 Thanks!
 Hilda

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





--
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 4.6 Available!

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




Re: [android-developers] Make a one app appliance (prevent quitting app)

2013-03-06 Thread Mark Murphy
You are welcome to make it be the home screen. There's the Home sample
in the SDK that demonstrates the intent-filter you need on your
activity:

intent-filter
action android:name=android.intent.action.MAIN /
category android:name=android.intent.category.HOME/
category android:name=android.intent.category.DEFAULT /
/intent-filter

Then, BACK and HOME lead to your app.

However:

- The user may be able to get to other things, depending on the
device, by means such as the notification drawer

- The user can simply reboot your phone in safe mode to nuke your app



On Wed, Mar 6, 2013 at 6:36 PM, Tobiah t...@tobiah.org wrote:
 I am going to hand out Android phones with an app on it
 that is geared to a large event.  I'd like to launch the app,
 and cause the user to be unable to quit it.  I don't want
 them messing around with other software on the phone.  We did
 this on our Blackberry app by making the program bring itself
 to the foreground every two seconds.  It was cheesy, but worked.
 If the user quit the app, it would come right back up.

 Any ideas as to how to get an Android program to always be
 the focused program?

 Thanks!

 Tobiah

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





--
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 4.6 Available!

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




Re: [android-developers] setAutoExposureLock method is not found in ICS

2013-03-06 Thread Mark Murphy
Why not set your build target to API Level 14 and just call the
method, wrapping your calls in a Build.VERSION.SDK_INT check? Why are
you messing around with reflection games?

On Wed, Mar 6, 2013 at 7:21 PM, Qianqian Fang fan...@gmail.com wrote:
 hi list

 I am working on a camera program where I want to call setAutoExposureLock()
 is supported. To make this backward compatible, I used some sample code I
 found online to check the presence of this method first. The code snippet is
 below:

 ...
 try{
Class c = Class.forName(android.hardware.Camera);

Method spcwb = null;
Method[] m = c.getMethods();
for (int i = 0; i  m.length; i++) {
   if (m[i].getName().compareTo(setAutoExposureLock) == 0) {
   spcwb = m[i];
   break;
   }
}
if (spcwb != null) {
   Object[] arglist = new Object[1];
   arglist[0] = tf;
   spcwb.invoke(cm, arglist);
   Log.i(TAG, setAutoExposureLock: Called method);
} else {
   Log.i(TAG, setAutoExposureLock: Did not find method);
}
 }catch(...){...}

 however, I tried this on both Nexus S (ICS 4.1) and Nexus 4 (ICS 4.2), the
 above code returned not found. Shouldn't setAutoExposureLock be supported
 by 4.0.3 and newer? I directly called this method for my Nexus 4, it worked.
 But I'd like to make this work for older phones.

 I changed the class name to android.hardware.Camera.Parameters, it did not
 help.

 did I miss anything?

 Qianqian

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





--
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 4.6 Available!

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




Re: [android-developers] Motorola Razr Maxx HD - freezes?

2013-03-05 Thread Mark Murphy
On Tue, Mar 5, 2013 at 7:31 PM, Nathan nathan.d.mel...@gmail.com wrote:
 After scrolling a custom view, the phone completely freezes and requires
 battery removal or special key sequence to reboot.

Almost by definition, that's gotta be a firmware bug, unless you are
doing something yourself in JNI.

 Where can I rent one of these devices?

It doesn't look like TestDroid Cloud or DeviceAnywhere have the RAZR
Maxx HD, just the Droid RAZR.

-- 
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 4.6 Available!

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




Re: [android-developers] Re: two activities running at same time

2013-03-02 Thread Mark Murphy
On Sat, Mar 2, 2013 at 6:57 PM, g...@deanblakely.com
g...@deanblakely.com wrote:
 It's a broadcast receiver it runs on receipt of an sms message and runs for
 less than a second.  Just sends the phone location back to the sender.

Which, as he noted, will not work on any Android 3.1+ device until the
user manually runs the app once, such as by launching an activity of
yours.

 You gressed it.  Broadcast receiver.  It's an activity that runs for about 
 600 - 700 mills.

AFAIK, `SmsManager` can be used by a `BroadcastReceiver`, and so
there's no obvious reason why you would need an activity in the first
place.

--
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 4.6 Available!

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




Re: [android-developers] Re: two activities running at same time

2013-03-02 Thread Mark Murphy
On Sat, Mar 2, 2013 at 7:30 PM, g...@deanblakely.com
g...@deanblakely.com wrote:
 not sure what you mean.

I mean that your BroadcastReceiver should not receive any broadcasts,
on Android 3.1+, until the user manually launches some activity of
yours once.

 If the user runs the app, it's a FlashLight app
 where the user can turn on the led to find his way around in the dark.

And so long as they use the FlashLight app at least once, then your
BroadcastReceiver will work, and should not until then.

 I have installed the app, never ran the flashlight, sent a sms message and
 it works.

Perhaps on an Android 3.0 or older device, or by reinstalling over top
of an existing installation that itself had run the activity.

This is covered in the Android 3.1 release notes:

http://developer.android.com/about/versions/android-3.1.html

(see Launch controls on stopped applications).

I suppose that it is conceivable that SMS broadcasts include
FLAG_INCLUDE_STOPPED_PACKAGES, though that would surprise me.

--
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 4.6 Available!

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




Re: [android-developers] Obfuscating code

2013-03-01 Thread Mark Murphy
On Fri, Mar 1, 2013 at 10:22 AM, dashman erjdri...@gmail.com wrote:
 but if the code is decompiled, will the decompiler be able to assign xxx to
 a PackageManager variable.

Yes, the person reading the decompiled code will see that what you
refer to as xxx is a PackageManager. The name xxx is obscured, but not
its type.

 packageInfo.signatures;

 i understand packageInfo will be modified by proguard - what about
 signatures property.

Since that class definition does not exist in your project, ProGuard
cannot change it.

 if nothing is done about that - the user could just search for that keyword.

Correct.

-- 
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 4.6 Available!

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




Re: [android-developers] Detect activity was started by the Android launcher

2013-02-28 Thread Mark Murphy
On Thu, Feb 28, 2013 at 7:46 AM, dashman erjdri...@gmail.com wrote:
 Any system launcher is fine.

What about users who download their own home screen app?

What about users who click on an entry in the recent-tasks list? Or
click on one of your notifications? Or click on one of your app
widgets?

 i.e. someone just wrapping my app and launching it.

 i want to disable that.

First, anyone who can wrap your app can disable your check.

Second, wrapping is sometimes done intentionally (e.g., by Amazon for
their AppStore DRM, IIRC).

Third, the way to check for wrappers is to confirm that your app's
package name is what you expect and that your app's signing key
matches what you expect. See http://stackoverflow.com/a/6203440/115145
for the latter. Again, all of these checks can be deactivated if
somebody puts their mind to them.

--
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 4.6 Available!

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




Re: [android-developers] Is there a way to speed up AVD?

2013-02-21 Thread Mark Murphy
Follow the instructions for using the x86 emulator images:

http://developer.android.com/tools/devices/emulator.html#accel-vm

On Sun, Feb 3, 2013 at 8:24 PM, justaguy lichunshe...@gmail.com wrote:
 Hi,

 I've tried several makers and models for AVD, each loads very slowly,
 from 4 to 6 minutes, going from one screen to another also take a long
 time (~1 or even 2), my Windows 7 computer has 4GB of RAM, so, I would
 think my machine isn't slow.  So, I wonder if we have a way to speed
 AVD loading.

 Thanks in advance.

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





--
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 4.6 Available!

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




Re: [android-developers] Setting Up the ADT Bundle Issue (Eclipse Error)

2013-02-21 Thread Mark Murphy
According to your error information, your Java is 1.4.2, which is
ancient, and will not work for Android development anyway. Please
upgrade to Java 6:

http://www.oracle.com/technetwork/java/javase/downloads/jdk6downloads-1902814.html

If you believe that you do have a newer Java installed, then check
your environment variables (e.g., JAVA_HOME) to ensure that you are
pointing at your newer Java.


On Thu, Feb 7, 2013 at 7:11 AM, Chris Church
accidentrep...@googlemail.com wrote:
 I have just downloaded the lastest version of the SDK and am trying to
 simply follow the instructions. I have unzipped the file and then gone to
 the eclipse directory and launched eclipse as it states. Instead of an
 installation or anythig else though I get an error:

 An error has occured. See the log file c:\xxx\xxx\xxx\342197325164.log

 The log then states the following:

 !SESSION 2013-02-07 12:08:57.104
 ---
 eclipse.buildId=unknown
 java.version=1.4.2_08
 java.vendor=Sun Microsystems Inc.
 BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
 Command-line arguments:  -os win32 -ws win32 -arch x86

 !ENTRY org.eclipse.osgi 4 0 2013-02-07 12:08:57.646
 !MESSAGE Application error
 !STACK 1
 java.lang.IllegalStateException: Unable to acquire application service.
 Ensure that the org.eclipse.core.runtime bundle is resolved and started (see
 config.ini).
 at
 org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74)
 at
 org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
 at
 org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
 at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
 at org.eclipse.equinox.launcher.Main.run(Main.java:1438)


 Does anyone have any ideas what is going wrong???

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





--
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 4.6 Available!

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




Re: [android-developers] upgrade to 4.2.2 -- Eclipse sees device offline and unknown

2013-02-21 Thread Mark Murphy
Make sure you are on the latest SDK platform tools from the SDK Manager.

Android 4.2.2 added a long-needed bit of security on the USB debugging
access, and it requires a current edition of adb in order to work:

http://android-developers.blogspot.com/2013/02/security-enhancements-in-jelly-bean.html
(see Secure USB Debugging section towards the bottom)

On Thu, Feb 21, 2013 at 9:06 AM, alexdonnini alexdonn...@ieee.org wrote:
 Hello,

 Unfortunately, I foolishly proceeded with the upgrade of my nexus 4 from
 4.2.1 to 4.2.2

 Now, even though the device is configured for USB debugging and connected as
 a camera device, although it sees it Eclipse cannot access it as the device
 is reported to be offline.

 Does anyone have any information about this problem, ways to resolve it, or
 experienced the same problem?

 Any help would be greatly appreciated.

 If the problem is known and unnsolved, could anyone let me know how I can
 downgrade back to 4.2.1?

 Thanks,

 Alex Donnini

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





--
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 4.6 Available!

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




Re: [android-developers] Re: upgrade to 4.2.2 -- Eclipse sees device offline and unknown

2013-02-21 Thread Mark Murphy
On Thu, Feb 21, 2013 at 10:55 AM, Nobu Games dev.nobu.ga...@gmail.com wrote:
 As Mark's linked articles says, your device will pop up a dialog that asks
 for permission for that USB debugging access from your development PC.
 Unfortunately that popup was hidden to me because I created multiple user
 accounts on my tablet and the currently active account was not the main
 account that is apparently allowed to make these tough decisions. When I
 switched to the main account I could finally see that dialog. Surprise,
 surprise.

Did you happen to file an issue for this on http://b.android.com?

-- 
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 4.6 Available!

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




Re: [android-developers] loading SharedPreferences in Fragment

2013-02-21 Thread Mark Murphy
Using the exact same code, if you wish.

On Thu, Feb 21, 2013 at 7:40 PM, Marcelo Corvezola mcorvez...@gmail.com wrote:
 Normally I use something like the code below to load sharedPreference into
 an activity..

 loadPrefs();

 }


 private void loadPrefs() {

 SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);

 boolean cbValue = sp.getBoolean(CHECKBOX, false);

 String name = sp.getString(NAME, YourName);

 if(cbValue){

 cb.setChecked(true);

 }else{

 cb.setChecked(false);

 }

 et.setText(name);

 }



 How are preferences loaded in a fragment Acivity? thnx

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





--
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 4.6 Available!

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




Re: [android-developers] Re: upgrade to 4.2.2 -- Eclipse sees device offline and unknown

2013-02-21 Thread Mark Murphy
On Thu, Feb 21, 2013 at 8:14 PM, Nikolay Elenkov
nikolay.elen...@gmail.com wrote:
 This is most probably intentional -- whitelisting a host affects the
 whole system,
 and only the administrator (first) user should be able to do it. It is the 
 same
 with installing certificates, etc. You certainly wouldn't want anyone that you
 lent the device to to change the system configuration and open up potential
 security holes without you knowing about it.

I agree, a secondary account shouldn't be able to make the change.

However, *some* dialog should still appear, telling the person holding
the tablet sorry, you must be on the primary account to activate USB
debugging.

-- 
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 4.6 Available!

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




Re: [android-developers] Posts from new users not passing through moderation?

2013-02-20 Thread Mark Murphy
I haven't seen a moderation queue flush in some time, though they may
have less volume than before and therefore are not quite as
noticeable, at least to me. I was thinking about this just a few days
ago, when I was mentioning this group to some students.

On Wed, Feb 20, 2013 at 6:09 AM, Mark Carter mjc1...@gmail.com wrote:
 I posted a new topic here a couple of weeks ago using a new google account.
 Unfortunately it never appeared here :(

 Can anyone confirm the moderation queue is being actively processed?

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





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

Android Training in NYC: http://marakana.com/training/android/

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




Re: [android-developers] Re: Creating new intent with data android:scheme...

2013-02-20 Thread Mark Murphy
new Intent(Uri.parse(myapp://path))

On Wed, Feb 20, 2013 at 4:47 AM, ntt broken nttbro...@gmail.com wrote:
 is there anybody out there?

 On Thu, Feb 14, 2013 at 7:21 PM, ntt broken nttbro...@gmail.com wrote:

 can someone share more info on this one? thank you!


 On Mon, Jan 28, 2013 at 9:56 AM, ntt broken nttbro...@gmail.com wrote:

 Hi,

 How can i create an intent (Java code) that will be compatible with
 intent filter declared?

 for example, if this is the intent filter declared in the
 AndroidManifest.xml:

 activity android:name=.MyUriActivity intent-filter action
 android:name=android.intent.action.VIEW / category
 android:name=android.intent.category.DEFAULT / category
 android:name=android.intent.category.BROWSABLE / data
 android:scheme=myapp android:host=path / /intent-filter /activity


 How can i create a new intent that can be used to work with that intent
 filter?

 Intent myIntent = new Intent( ... ) ...

 the main gap is how to declare intent in java code with the 'data
 android:scheme=myapp android:host=path /' part.
 i mean, how to set the data of the scheme,host etc to a new intent.

 thanks!









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





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

Android Training in NYC: http://marakana.com/training/android/

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




Re: [android-developers] Posts from new users not passing through moderation?

2013-02-20 Thread Mark Murphy
There may be other problems, though. Jeff Sharkey -- a Googler, no
less -- appears to have had a post on Brill Pappin's MediaPlayer
thread delayed by a few days for some reason. It's from Jeff's normal
google.com account, so I would assume his post wasn't held up for
moderation.

On Wed, Feb 20, 2013 at 7:18 AM, Mark Murphy mmur...@commonsware.com wrote:
 I haven't seen a moderation queue flush in some time, though they may
 have less volume than before and therefore are not quite as
 noticeable, at least to me. I was thinking about this just a few days
 ago, when I was mentioning this group to some students.

 On Wed, Feb 20, 2013 at 6:09 AM, Mark Carter mjc1...@gmail.com wrote:
 I posted a new topic here a couple of weeks ago using a new google account.
 Unfortunately it never appeared here :(

 Can anyone confirm the moderation queue is being actively processed?

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





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

 Android Training in NYC: http://marakana.com/training/android/



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

Android Training in NYC: http://marakana.com/training/android/

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




Re: [android-developers] loading .swf file in webview, my code works for 2.3.3 but not working for 4.0.4

2013-02-20 Thread Mark Murphy
Bear in mind that Flash is no longer available for Android.

On Wed, Feb 20, 2013 at 4:39 AM, Gaurav Wable gswa...@gmail.com wrote:
 having a.swf file in assets folder.
 this code is working for os 2.3.3 but not for 4.0.4
 i have set the parameter android:hardwareaccelerated = true


 onCreate() {

 String html =
 object width=\250\ height=\200\  +
 param name=\movie\ value=\file:///android_asset/a.swf\ embed
 src=\file:///android_asset/a.swf\ width=\250\ height=\200\ /embed
 /object;
 String mimeType = text/html;
 String encoding = utf-8;

 WebView wv=(WebView) findViewById(R.id.presentation_webview);
 wv.getSettings().setJavaScriptEnabled(true);
 wv.getSettings().setPluginState(PluginState.ON);
 wv.loadDataWithBaseURL(null, html, mimeType, encoding,  );
 wv.setWebViewClient(new HelloWebViewClient());
 }

 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
 // Inflate the menu; this adds items to the action bar if it is present.
 getMenuInflater().inflate(R.menu.activity_main, menu);
 return true;
 }
 public class HelloWebViewClient extends WebViewClient {

 @Override
 public boolean shouldOverrideUrlLoading(WebView view, String url) {
 view.loadUrl(url);
 return true;
 }

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





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

Android Training in NYC: http://marakana.com/training/android/

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




Re: [android-developers] How use my app's notifications instead of calendar app's?

2013-02-20 Thread Mark Murphy
On Wed, Feb 20, 2013 at 12:15 PM, don rhummy donrhu...@yahoo.com wrote:
 The problem with that is it requires my app to wake up and poll frequently.

Use AlarmManager to get control at the event time. This does not
require your app to wake up and poll frequently.

 If instead, there was a way to register for
 something (a broadcast) or insert my own intent, that would work better. Is
 that possible?

No.

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

Android Training in NYC: http://marakana.com/training/android/

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




Re: [android-developers] How use my app's notifications instead of calendar app's?

2013-02-20 Thread Mark Murphy
On Wed, Feb 20, 2013 at 12:35 PM, don rhummy donrhu...@yahoo.com wrote:
 But that only works on the device they created the event on. What about if
 they have another device (a tablet for example) that also has my app? There
 wouldn't be a way for it to know that event was created unless it polls
 for it.

Write your own backend, and use something like GCM for updating all of
the user's devices, rather than relying on somebody else's backend
that you do not control.

Or poll, and let the user control the polling frequency, so they can
dial in the amount of battery life they are willing to spend.

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

Android Training in NYC: http://marakana.com/training/android/

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




Re: [android-developers] Automatied Environment for Android Building and Testing

2013-02-20 Thread Mark Murphy
It you really want a continuous integration server, there is a recipe
for Android app builds and tests using Jenkins:

https://wiki.jenkins-ci.org/display/JENKINS/Building+an+Android+app+and+test+project

On Wed, Feb 20, 2013 at 6:39 PM, Jaison Brooks jaisonbro...@gmail.com wrote:
 Hey fellow Android Guru's, Im starting this topic because im unsure of how
 to setup a continues, automated building environment for Android
 Development.

 First ill tell you what i have, Im using Eclipse on Mac OS X 10.7 with ADT
 and the SDK installed. Im using JGit for integration with my git repo's on
 my server. Now i've been developing like this just fine everything works
 perfect. The realm that im unsure about is integrating Unit Testing and
 Build Changes and automating these Unit tests and Builds of my application.
 Now i've only been developing for about a year now so this is all a new
 realm to me.

 I need thoughts and recommendations for basically doing the following:

 I have a Mac Mini setup with a Go Server. What i need to do is setup my
 Environment to do the following
 1. Pull project from Git Repo
 2. Execute some sort of script to Clean the project, then  Build apk via
 command line (adb)
 3. Execute Unit Test to the compiled apk
 4. Send a Smoke test and Regression Test

 Now i've been researching ANT and trying to figure how if this is more along
 the lines of creating my own build.xml file or ANT scripts or something but
 im very unsure. However if anybody has a similar environment/setup or any
 recommendations, Please Share.

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





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

Android Training in NYC: http://marakana.com/training/android/

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




Re: [android-developers] Re: MediaPlayer suddenly stopped working in Android 4.2

2013-02-19 Thread Mark Murphy
If you can create a sample project that reproduces the error, post it
and your description as an issue on http://b.android.com. If you think
of it, reply on this thread with the issue link.

On Tue, Feb 19, 2013 at 5:18 PM, Brill Pappin br...@pappin.ca wrote:
 So, for all of you paying attention to this thread or having a similar
 issues with MediaPlayer.

 It appears that the MediaPlayer is picky about what directly the files are
 stored in.

 This is the change I made that suddenly caused things to start working
 again:

 // File root = context.getExternalFilesDir(audio);
 File root = new File(context.getExternalCacheDir(), audio);
 root.mkdirs();


 If you are an Android OS dev reading this, this is broken!

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





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

Android Training in DC: http://marakana.com/training/android/

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




Re: [android-developers] DialogFragment

2013-02-18 Thread Mark Murphy
http://stackoverflow.com/questions/14803338/advantage-of-using-a-dialogfragment-over-simple-alertdialog/14803385#14803385

On Mon, Feb 18, 2013 at 10:45 AM, dashman erjdri...@gmail.com wrote:
 What's the advantage of DialogFragment?

 Over just creating AlertDialog in the Activity class.


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





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

In questi siti web puoi chiedere o rispondere a domande relative allo
sviluppo di applicazioni Android: http://www.andglobe.com

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




Re: [android-developers] DialogFragment

2013-02-18 Thread Mark Murphy
I have never used that code. Here is a sample project that just uses show():

https://github.com/commonsguy/cw-omnibus/tree/master/Dialogs/DialogFragment

On Mon, Feb 18, 2013 at 11:24 AM, dashman erjdri...@gmail.com wrote:

 Re-direct - but straight to the point. appreciate it.

 i copied this code from android docs to display a DialogFragment

 FragmentTransaction transaction =
 fragmentManager.beginTransaction();


 transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);

 // To make it fullscreen, use the 'content' root view as the
 container
 // for the fragment, which is always the root view for the
 activity
 //
 transaction.add(android.R.id.content,
 inputDialog).addToBackStack(null).commit();

 but it does not display it.

 do i need to do a .show() after the transaction.add()



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





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

In questi siti web puoi chiedere o rispondere a domande relative allo
sviluppo di applicazioni Android: http://www.andglobe.com

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




Re: [android-developers] import android.net.NetworkUtils;

2013-02-18 Thread Mark Murphy
It is not part of the Android SDK, so an SDK project cannot perform that import.

On Mon, Feb 18, 2013 at 5:16 PM, bob b...@coolfone.comze.com wrote:
 Can someone help me understand why the following import does not work in my
 app?

 import android.net.NetworkUtils;

 I noticed the WifiInfo class is doing that, so I'm pretty sure that class is
 there.



 Thanks.

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





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

In questi siti web puoi chiedere o rispondere a domande relative allo
sviluppo di applicazioni Android: http://www.andglobe.com

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




Re: [android-developers] Debugging beta apps

2013-02-17 Thread Mark Murphy
On Sun, Feb 17, 2013 at 5:59 PM, Guy Smith g...@multiniche.org wrote:
 ACRA is essentially being phased out (IMHO) -
 see
 https://github.com/ACRA/acra/wiki/Notice-on-Google-Form-Spreadsheet-usage.

You are welcome to your opinion, but there are plenty of ACRA
back-ends available, including ACRA's own Acralyzer, that do not
require the use of Google Spreadsheets.

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

Localized Android Question-and-Answer Sites: http://www.andglobe.com

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




Re: [android-developers] what versions of sqllite is used in android?

2013-02-16 Thread Mark Murphy
A Google search on:

android sqlite versions

turns up:

http://stackoverflow.com/questions/2421189/version-of-sqlite-used-in-android



On Sat, Feb 16, 2013 at 5:59 AM, Siva Kumar j.sivakumar...@gmail.comwrote:

 Dear All,



 http://stackoverflow.com/questions/14909502/what-versions-of-sqllite-is-used-in-android#


 Im developing a android application for a *tablet and mobiles*
 The application perform some DB operations (saving,deleting,etc in DB)
 My configuration details are *minimum sdk is 8 and target sdk is 17*
 Here i did not know what *sqllite version* is used in android from *version
 8 to latest version.*
 It is very usefull to db compatibility in my project
 So please provid the details where i get these details
 So please all are welcome to give their ideas


 --
 *Thanks  Regards,
 SIVAKUMAR.J http://stackoverflow.com/users/385138/sivakumar-j
 *

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






-- 
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 4.5 Available!

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




Re: [android-developers] Activity and Application life-cycle

2013-02-10 Thread Mark Murphy
On Sun, Feb 10, 2013 at 9:35 AM, dashman erjdri...@gmail.com wrote:
 I understand Activities can be paused and or destroyed
 when in the background or sleeping.

Activities are paused when they move to the background. Activities are
only called with onDestroy() when in the background as part of Android
terminating the process, and it is not guaranteed that onDestroy()
will be called.

 What happens to the Application object.

 Specifically - if the Activity is destroyed, is the Application
 object destroyed also.

The Application object is not called with onTerminate(). It simply
vanishes into the ether when the whole process does.

 And there doesn't seem to be a guarantee of getting called
 when the Application object IS destroyed.

It is guaranteed that you will not be called. The Application object,
at best, is the same as static data members: use them for a cache,
nothing more.

-- 
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 4.5 Available!

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




Re: [android-developers] Activity and Application life-cycle

2013-02-10 Thread Mark Murphy
On Sun, Feb 10, 2013 at 10:26 AM, dashman erjdri...@gmail.com wrote:
 When an activity is asleep, it could be destroyed by the os.

There is no concept of asleep.

 if destroyed, onDestroyed() will be called.

Not necessarily. The process can be terminated without onDestroy() being called.

 if not destroyed, it'll be resumed.

Not necessarily. The process can be terminated without onDestroy() being called.

 I have an Activity as well as an Application sub-class - i store
 some values there.

 I put the app to sleep and when i wake up

Apps are not asleep, so I do not know what you mean here.

 - the variables in the
 Activity are initialized to new whereas the values in the Application
 object are still there.

 So looks like on wakeup - a new instance of Activity was created
 but the old Application object was used.

 Make sense?

Off the cuff, no, but, then again, I do not know what I put the app
to sleep and when i wake up means.

--
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 4.5 Available!

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




Re: [android-developers] The method bindAppWidgetId(int, ComponentName) is undefined for the type AppWidgetManager error on Jellybean

2013-02-09 Thread Mark Murphy
if (Build.VERSION.SDK_INT=Build.VERSION_CODES.JELLYBEAN) {
// use bindAppWidgetIdIfAllowed()
}
else {
// use bindAppWidgetId()
}

On Sat, Feb 9, 2013 at 6:37 AM, Saqlain Abbas saqlain.abba...@gmail.com wrote:
 Hi,

 I got an Android application which was using bindAppWidgetId it has been
 working but on jellybean the same source code does not compile as the API is
 not available and i get error The method bindAppWidgetId(int,
 ComponentName) is undefined for the type AppWidgetManager, i need a
 solution which is backword compatible i.e. work with jellybean and earlier
 version of Android, i don't want to go for reflection is there any other way
 to achieve this?

 --
 Kind Regards,
 Saqlain Abbas.

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





--
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 4.5 Available!

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




Re: [android-developers] Google maps api v2 issue

2013-02-09 Thread Mark Murphy
On Sat, Feb 9, 2013 at 1:13 PM, g...@deanblakely.com
g...@deanblakely.com wrote:
 The problem may not be complexity of the framework.  Most tutorials for
 Android lack specificity and there is usually never a download working
 project option (as there is in your book).

Here's a whole directory of Maps V2 working projects, from the
aforementioned book:

https://github.com/commonsguy/cw-omnibus/tree/master/MapsV2

--
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 4.5 Available!

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




Re: [android-developers] onCreateOptionsMenu being hit too many times

2013-02-09 Thread Mark Murphy
You claim that your problem is in onCreateOptionsMenu(), yet you do
not appear to implement it.

On Sat, Feb 9, 2013 at 2:33 PM, FiltrSoft kri...@gmail.com wrote:
 I'm having some issue with using a ViewPager and two different layouts for
 my app.  My app has a listing and details view.  When the device is in
 potrait, I'm using a ViewPager, where the user can swipe between the
 different detail views and when the device is in landscape, I'm showing both
 view on the screen.  The issue I'm having is when the device is rotated from
 portait to landscape, the menu items in the Actionbar are duplicating and
 each time I rotate from portrait to landscape, they duplicate over and over
 so the entire Actionbar is full of icons.  When I put a breakpoint in
 onCreateOptionsMenu, the breakpoint is hit over and over and over when the
 device is rotated.  This is the applicable code:

 Starting activity:

 public class Main extends SherlockFragmentActivity{
 private static ListFragment fragments;

 @Override
 public void onCreate(final Bundle icicle)
 {
 setContentView(R.layout.main);
 }

 @Override
 public void onResume()
 {
 mViewPager = (ViewPager)findViewById(R.id.viewpager);

 if (mViewPager != null) //landscape layout doesn't user a viewpager
 {
 fragments = new ArrayListFragment();

 fragments.add(new MyListFragment()); //fragment with the
 ListView

 fragments.add(MyDetailFragment.newInstance(0));
 fragments.add(MyDetailFragment.newInstance(1));
 fragments.add(MyDetailFragment.newInstance(2));

 mMyFragmentPagerAdapter = new
 MyFragmentPagerAdapter(getSupportFragmentManager());
 mViewPager.setAdapter(mMyFragmentPagerAdapter);
 }
 }

 private static class MyFragmentPagerAdapter extends
 FragmentStatePagerAdapter  {

 public MyFragmentPagerAdapter(FragmentManager fm) {
  super(fm);
 }

 @Override
 public Fragment getItem(int index) {
 return fragments.get(index);
 }

 @Override
 public int getCount() {
  return 4;
 }

 @Override
 public int getItemPosition(Object object) {
 return POSITION_NONE;
 }
}
 }

 Main Layout (portrait):

 RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android;
 android:orientation=vertical
 android:layout_height=fill_parent
 android:layout_width=fill_parent


 android.support.v4.view.ViewPager
 android:id=@+id/viewpager
 android:layout_height=match_parent
 android:layout_width=match_parent
  /

  /RelativeLayout


 Main Layout (landscape):

 LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
 android:orientation=horizontal
 android:layout_height=fill_parent
 android:layout_width=fill_parent
 android:weightSum=3

 fragment android:name=com.app.MyListFragment
 android:id=@+id/fragmentList
 android:layout_weight=1
 android:layout_width=0dp
 android:layout_height=fill_parent
  /

 fragment android:name=com.app.MyDetailFragment
 android:id=@+id/fragmentDetail
 android:layout_width=0dp
 android:layout_weight=2
 android:layout_height=fill_parent
  /

 /LinearLayout

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





--
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 4.5 Available!

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

Re: [android-developers] onCreateOptionsMenu being hit too many times

2013-02-09 Thread Mark Murphy
If I had to guess, your problem is that you are creating extra
fragments. For example, at least on a complete rotation (portrait -
landscape - portrait), you will have two of everything. Remember that
your fragments will automatically be re-created on a configuration
change, so you do not want to create separate copies. Get your old
ones from the FragmentManager, and only create them if the
FragmentManager does not already have them.


On Sat, Feb 9, 2013 at 3:29 PM, FiltrSoft kri...@gmail.com wrote:
 On Saturday, February 9, 2013 2:39:17 PM UTC-5, Mark Murphy (a Commons Guy)
 wrote:

 You claim that your problem is in onCreateOptionsMenu(), yet you do
 not appear to implement it.


 Whoops, not sure what happened there, didn't paste Fragment:


 MyListFragment.class

 public class MyListFragment extends SherlockListFragment
 {
 @Override
 public void onCreate(Bundle savedInstanceState){
 super.onCreate(savedInstanceState);

 setHasOptionsMenu(true);
 }

 public static MyListFragment newInstance() {

 return new MyListFragment();
 }

 @Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container,
 Bundle savedInstanceState) {
 super.onCreateView(inflater, container, savedInstanceState);

 return inflater.inflate(R.layout.listing, container, false);
 }

 @Override
 public void onActivityCreated(Bundle savedState) {
 super.onActivityCreated(savedState);

 DisplayItems();
 }

 @Override
 public void onPrepareOptionsMenu(Menu menu) {
 super.onPrepareOptionsMenu(menu);
 }

 @Override
 public void onCreateOptionsMenu(final Menu menu, final MenuInflater
 inflater) {
 inflater.inflate(R.menu.listing_menu, menu);

 super.onCreateOptionsMenu(menu, inflater);
 }
 }

 MyDetailFragment.class

 public class MyDetailFragment extends SherlockListFragment
 {
 public int mId;

 @Override
 public void onCreate(Bundle savedInstanceState)
 {
 super.onCreate(savedInstanceState);
 setHasOptionsMenu(true);
 }

 public static MyDetailFragment newInstance(int id) {

 MyDetailFragment lf = new MyDetailFragment();
 Bundle bundle = new Bundle();
 bundle.putInt(id, id);
 lf.setArguments(bundle);

 return lf;
 }

 @Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container,
 Bundle savedInstanceState) {

 if (getArguments() != null)
 mId = getArguments().getInt(id);

 return inflater.inflate(R.layout.details, container, false);
 }

 @Override
 public void onActivityCreated(final Bundle icicle)
 {
 super.onActivityCreated(icicle);

 DisplayItems();
 }

 @Override
 public void onPrepareOptionsMenu(Menu menu) {

 super.onPrepareOptionsMenu (menu);
 }

 @Override
 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
 inflater.inflate(R.menu.details_menu, menu);

 super.onCreateOptionsMenu(menu, inflater);
 }
 }


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





--
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 4.5 Available!

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




Re: [android-developers] Re: onCreateOptionsMenu being hit too many times

2013-02-09 Thread Mark Murphy
Well, normally, you don't even need to do that.
FragmentPagerAdapter/FragmentStatePagerAdapter use the tag to
determine what fragment goes in what page. So your pages will
automatically reappear after the configuration change. This is why
most samples do not do what you are doing, creating fragments in the
activity and forcing them into the adapter. Instead, the adapter
creates fragments *on demand* only when needed in the call to
getItem().

On Sat, Feb 9, 2013 at 4:26 PM, FiltrSoft kri...@gmail.com wrote:
 Ah, that makes sense.  I knew it might have been related to something with
 Fragments I didn't understand as I am new to them.  The only thing I'm not
 sure if is, I can use findFragmentById to retrieve the MyListFragment, but
 the MyDetailFragment would have the same id, with a different argument,
 wouldn't it.  Would I have to use findFragmentByTag, instead?



 On Saturday, February 9, 2013 2:33:13 PM UTC-5, FiltrSoft wrote:

 I'm having some issue with using a ViewPager and two different layouts for
 my app.  My app has a listing and details view.  When the device is in
 potrait, I'm using a ViewPager, where the user can swipe between the
 different detail views and when the device is in landscape, I'm showing both
 view on the screen.  The issue I'm having is when the device is rotated from
 portait to landscape, the menu items in the Actionbar are duplicating and
 each time I rotate from portrait to landscape, they duplicate over and over
 so the entire Actionbar is full of icons.  When I put a breakpoint in
 onCreateOptionsMenu, the breakpoint is hit over and over and over when the
 device is rotated.  This is the applicable code:

 Starting activity:

 public class Main extends SherlockFragmentActivity{
 private static ListFragment fragments;

 @Override
 public void onCreate(final Bundle icicle)
 {
 setContentView(R.layout.main);
 }

 @Override
 public void onResume()
 {
 mViewPager = (ViewPager)findViewById(R.id.viewpager);

 if (mViewPager != null) //landscape layout doesn't user a
 viewpager
 {
 fragments = new ArrayListFragment();

 fragments.add(new MyListFragment()); //fragment with the
 ListView

 fragments.add(MyDetailFragment.newInstance(0));
 fragments.add(MyDetailFragment.newInstance(1));
 fragments.add(MyDetailFragment.newInstance(2));

 mMyFragmentPagerAdapter = new
 MyFragmentPagerAdapter(getSupportFragmentManager());
 mViewPager.setAdapter(mMyFragmentPagerAdapter);
 }
 }

 private static class MyFragmentPagerAdapter extends
 FragmentStatePagerAdapter  {

 public MyFragmentPagerAdapter(FragmentManager fm) {
  super(fm);
 }

 @Override
 public Fragment getItem(int index) {
 return fragments.get(index);
 }

 @Override
 public int getCount() {
  return 4;
 }

 @Override
 public int getItemPosition(Object object) {
 return POSITION_NONE;
 }
}
 }

 Main Layout (portrait):

 RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android;
 android:orientation=vertical
 android:layout_height=fill_parent
 android:layout_width=fill_parent
 

 android.support.v4.view.ViewPager
 android:id=@+id/viewpager
 android:layout_height=match_parent
 android:layout_width=match_parent
  /

  /RelativeLayout


 Main Layout (landscape):

 LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
 android:orientation=horizontal
 android:layout_height=fill_parent
 android:layout_width=fill_parent
 android:weightSum=3
 
 fragment android:name=com.app.MyListFragment
 android:id=@+id/fragmentList
 android:layout_weight=1
 android:layout_width=0dp
 android:layout_height=fill_parent
  /

 fragment android:name=com.app.MyDetailFragment
 android:id=@+id/fragmentDetail
 android:layout_width=0dp
 android:layout_weight=2
 android:layout_height=fill_parent
  /

 /LinearLayout

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





--
Mark Murphy (a Commons Guy)
http://commonsware.com | http

Re: [android-developers] Re: onCreateOptionsMenu being hit too many times

2013-02-09 Thread Mark Murphy
The tutorial you link to does what I described: it creates the
fragments on demand from getItem() of the adapter.

On Sat, Feb 9, 2013 at 5:22 PM, FiltrSoft kri...@gmail.com wrote:
 So, should I re-think how I'm setting up my ViewPager?  This is the first
 time I've implemented one, so I was a little in the dark on the best
 practices.

 I was using this tutorial as base for what I needed to do:
 http://tamsler.blogspot.com/2011/10/android-viewpager-and-fragments.html


 On Saturday, February 9, 2013 4:56:57 PM UTC-5, Mark Murphy (a Commons Guy)
 wrote:

 Well, normally, you don't even need to do that.
 FragmentPagerAdapter/FragmentStatePagerAdapter use the tag to
 determine what fragment goes in what page. So your pages will
 automatically reappear after the configuration change. This is why
 most samples do not do what you are doing, creating fragments in the
 activity and forcing them into the adapter. Instead, the adapter
 creates fragments *on demand* only when needed in the call to
 getItem().

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





--
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 4.5 Available!

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




Re: [android-developers] problem getting Google API V1 key

2013-02-09 Thread Mark Murphy
On Sat, Feb 9, 2013 at 6:59 PM, g...@deanblakely.com
g...@deanblakely.com wrote:
 So now I want to get an MD5 fingerprint, so I run the following command

 keytool -list -alias myAlias -keystore DBAPhoneStalker-release-key.keystore

 After entering my password, the keystore program proceeds to give me an SHA
 fingerprint!!  I need an MD5 fingerprint.  Why is this happening?

It is happening because you are running Java 7, and the keytool
command emits SHA-1 by default. Add -v to your command line switches
to get an MD5 fingerprint.

-- 
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 4.5 Available!

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




Re: [android-developers] Google maps api v2 issue

2013-02-08 Thread Mark Murphy
On Fri, Feb 8, 2013 at 7:08 PM, g...@deanblakely.com
g...@deanblakely.com wrote:
 I see that v2 appears an order of magnitude more complex

Actually, I found it to be simpler, at least for many operations, once
you get past the is the Play Services Framework installed? hassle.
Drag and drop, for example, is an order of magnitude easier to
implement.

 Since google play services are needed does that mean that my app will only
 be able to be distributed on google play and not, say, be distributed from
 my own web site?

No. It means that the device needs the Play Services Framework,
whether that is part of the firmware or installed off the Play Store.

 Is this a move by google to force apps to be distributed
 only via google play?

No.

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

In questi siti web puoi chiedere o rispondere a domande relative allo
sviluppo di applicazioni Android: http://www.andglobe.com

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




Re: [android-developers] Unable to obtain Google Maps Android v1 API Key

2013-02-07 Thread Mark Murphy
It just worked for me. Make sure that you are using MD5 -- if you have
Java 7 installed, you might be getting the SHA-1 hash instead, for
example.

On Thu, Feb 7, 2013 at 10:28 AM, Simon Giddings mr.s.giddi...@gmail.com wrote:
 I have followed the instructions to create a private key and then obtain the
 MD5 signature.
 I paste this signature into the signup input field and click submit.

 I then get a page which says that the MD5 signature is incorrect !
 Tried with and without the colons (:).

 Has the key generation been disabled, even though documentation states that
 it will be open until 3 Mars ?

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





--
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 4.5 Available!

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




Re: [android-developers] Unable to obtain Google Maps Android v1 API Key

2013-02-07 Thread Mark Murphy
Add -v to your list of command-line switches.

On Thu, Feb 7, 2013 at 11:13 AM, Simon Giddings mr.s.giddi...@gmail.com wrote:
 Yep, you are right, I am getting the SHA-1 hash.
 Looked at the command line options and cannot see how I can force MD5
 output.
 Can you help here ?


 On Thursday, 7 February 2013 17:02:50 UTC+1, Mark Murphy (a Commons Guy)
 wrote:

 It just worked for me. Make sure that you are using MD5 -- if you have
 Java 7 installed, you might be getting the SHA-1 hash instead, for
 example.

 On Thu, Feb 7, 2013 at 10:28 AM, Simon Giddings mr.s.g...@gmail.com
 wrote:
  I have followed the instructions to create a private key and then obtain
  the
  MD5 signature.
  I paste this signature into the signup input field and click submit.
 
  I then get a page which says that the MD5 signature is incorrect !
  Tried with and without the colons (:).
 
  Has the key generation been disabled, even though documentation states
  that
  it will be open until 3 Mars ?
 
  --
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-d...@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
  ---
  You received this message because you are subscribed to the Google
  Groups
  Android Developers group.
  To unsubscribe from this group and stop receiving emails from it, send
  an
  email to android-developers+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 



 --
 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 4.5 Available!

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





--
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 4.5 Available!

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




Re: [android-developers] External video output (USB/HDMI/etc)

2013-01-31 Thread Mark Murphy
Prior to Android 4.2, there was no API for this.

Now, you can take a look at the DisplayManager and see if it will give
you the info that you need.

On Thu, Jan 31, 2013 at 1:24 PM, Larry Meadors larry.mead...@gmail.com wrote:
 I've been looking for information on how to determine if a device can
 do this or not - is there a standard API for this or is it all
 device/vendor specific?

 Larry

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





-- 
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 4.5 Available!

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




Re: [android-developers] is Google going to ship Chrome as a default browser for next OS release

2013-01-30 Thread Mark Murphy
We will find out when the next version of Android ships. I will be
reasonably surprised if we find out before then. And, bear in mind
that the choice of browsers is really up to the device manufacturer.

On Wed, Jan 30, 2013 at 9:12 PM, DroidMaster lyseng.ta...@gmail.com wrote:
 Hi, All

 With Nexus 7, Google has shipped Google Chrome as stock Browser. Is Google
 going to eliminate regular browser for the next release of android OS?


 Thanks,

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





-- 
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 4.5 Available!

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




Re: [android-developers] ArrayAdapter in background thread

2013-01-28 Thread Mark Murphy
On Sun, Jan 27, 2013 at 7:36 PM, dashman erjdri...@gmail.com wrote:
 You can modify the ArrayList directly from a background thread.

 How can i do that - i don't see any api for this.

java.util.ArrayList has been around for, what, 15 years? Yes, it has
an API to allow the list to be modified.

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

Här kan du ställa och svara på frågor om applikationsutveckling på
Android: http://www.andglobe.com

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




Re: [android-developers] ArrayAdapter in background thread

2013-01-27 Thread Mark Murphy
On Sun, Jan 27, 2013 at 6:26 PM, dashman erjdri...@gmail.com wrote:
 Can an ArrayAdapter (holding data for a ListView) be modified
 in a background thread.

 I'd like to modify the array and then call

 adapter.notifyDataSetChanged()

You cannot modify the *adapter* in a background thread if it is
already attached to an AdapterView.

You can modify the ArrayList directly from a background thread (not
via the ArrayAdapter), then call notifyDataSetChanged() on the main
application thread when that work is done.

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

Localized Android Question-and-Answer Sites: http://www.andglobe.com

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




Re: [android-developers] End user ANR stack trace has no line number

2013-01-24 Thread Mark Murphy
On Wed, Jan 23, 2013 at 9:52 PM, Peri Hartman pe...@kotatko.com wrote:
 Ok, I've done that and did something to cause my app to crash.  It gives the
 message unfortunately, X has stopped, but nothing gives me an option to
 send a stack trace.  Any other wise words?

Plug the device into your development machine and examine LogCat.

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

Android Training in NYC: http://marakana.com/training/android/

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


Re: [android-developers] End user ANR stack trace has no line number

2013-01-24 Thread Mark Murphy
On Thu, Jan 24, 2013 at 10:23 AM, Peri Hartman pe...@kotatko.com wrote:
 Please keep in mind I'm trying to test whether I've setup Proguard
 correctly.  Thus, I need to see a stack trace sent by the end user to the
 developer console.

The stack trace is the same no matter where it comes from LogCat, the
Developer Console, BugSense, etc. AFAIK. So long as you are testing
your production APK on the device, the stack trace as seen in LogCat
should be the same as what would show up in the Developer Console.

If you have any evidence to the contrary, please post a link.

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

Android Training in NYC: http://marakana.com/training/android/

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


Re: [android-developers] End user ANR stack trace has no line number

2013-01-24 Thread Mark Murphy
On Thu, Jan 24, 2013 at 10:42 AM, Peri Hartman pe...@kotatko.com wrote:
 That makes sense - I can simply look at the log file and see if the stack
 trace contains line numbers.  From that I should know whether I setup
 Proguard correctly, right?

Presumably. It depends a bit on what you did with your ProGuard setup
-- you may need to use ReTrace to translate the stack trace into
something usable.

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

Android Training in NYC: http://marakana.com/training/android/

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


Re: [android-developers] referencing a nested class in xml

2013-01-24 Thread Mark Murphy
If MyView is static inner class of MyFragment, with a public
constructor following the two-parameter form for View subclasses, use
com.example.test.MyFragment$MyView.



On Thu, Jan 24, 2013 at 1:46 PM, dashman erjdri...@gmail.com wrote:
 i've got a nested View sub-class class

 In a xml file, i have a reference to it

 Layout
 com.example.test.MyFragment.MyView/
 /Layout

 Where MyView is a sub-class of View.

 I'm getting run-time error for class not found.

 do i need to delimit using $ instead of .


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





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

Android Training in NYC: http://marakana.com/training/android/

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




Re: [android-developers] Click events doesn't work on a button after Animation

2013-01-23 Thread Mark Murphy
On Tue, Jan 22, 2013 at 11:46 PM, Ansh yourans...@gmail.com wrote:
 - Do not use TranslateAnimation, but instead switch to the newer
 ViewPropertyAnimator framework (and NineOldAndroids for a backport),

 I can't use ViewPropertyAnimator framework because i need to support
 for below 3.0 API level.

If you take the time to read what I wrote, you will notice that I
pointed you to the NineOldAndroids backport of the
ViewPropertyAnimator framework. NineOldAndroids works going back to
API Level 1.

--
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 4.5 Available!

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


Re: [android-developers] View SQLite database files possible with external DB. Software?

2013-01-23 Thread Mark Murphy
On Wed, Jan 23, 2013 at 12:42 PM, Boyd Speer bsp...@shaw.ca wrote:
 I would like to be able to see and manipulate the database files externally 
 as I develop the app and I need to root the phone to do so. I have the Galaxy 
 Ace GT-S5830D (Android 2.3.4 Gingerbread DTLK14.

 I followed the rooting instructions but do not see any option to update from 
 sd card - just a black screen with the Samsung logotype and a text box in 
 upper left of screen that says Emergency Dload Mode (ARM9 mode).  I have 
 the update zip on the sd card.

Contact the people who supplied you with the rooting instructions,
which I am reasonably certain did not come from this list.

 Sorry for the off topic post but it is related to a problem with a table not 
 being created when it should be there - I get an error - No such table ...

Test on the emulator, where you have access to internal storage.

Or, add a database backup feature to your app that copies the database
to external storage.

Or, put the database on external storage in the first place during
early development.

-- 
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 4.5 Available!

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


Re: [android-developers] End user ANR stack trace has no line number

2013-01-23 Thread Mark Murphy
On Wed, Jan 23, 2013 at 5:04 PM, Peri Hartman pe...@kotatko.com wrote:
 I made a change to my Proguard setup, but haven't figured out how to test it
 without publishing. Anyone know how to test the change locally?

Test what? You can install your modified APK via adb install or any
number of other means.

In terms of testing whether you can now get access to the lines from
the stack trace, divide by zero somewhere to force a crash and then go
through the process of examining the log.

--
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 4.5 Available!

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


Re: [android-developers] Click events doesn't work on a button after Animation

2013-01-22 Thread Mark Murphy
This is expected behavior. Either:

- Do not use TranslateAnimation, but instead switch to the newer
ViewPropertyAnimator framework (and NineOldAndroids for a backport),
or

- Do not bother with setFillAfter(true), but instead attach an
AnimationListener that will adjust the layout so the widget is in its
new position when the animation ends

On Tue, Jan 22, 2013 at 7:27 AM, Ansh yourans...@gmail.com wrote:
  Hi guys , i am facing a weird problem.I have a layout and there is a button
 inside that layout.On clicking of the button i need to translate that layout
 towards up say for example 30%.I am able to achieve this but when animation
 ends i loose click event on the button which a very weird and known issue to
 all the forums and stack overflow.I searched every where but could not find
 a solution.I have read that When layout is animated it looks that it has
 been animated but it is View resides at there original position .Then how
 can i perform onClick of a button which is now placed to the new postion?

 Thanks

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



-- 
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 4.5 Available!

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


Re: [android-developers] [Google Maps API v2] Info windows Title

2013-01-22 Thread Mark Murphy
Probably. If I understand correctly, what is shown in the info window
is not the actual widgets, but rather a Bitmap created from those
widgets. If so, that would explain why animated effects will not work.

On Tue, Jan 22, 2013 at 11:19 AM, Filipe Batista
batista.fil...@gmail.com wrote:
 Hello,


 I am using a custom InfoWindowAdapter to show a custom InfoWindow. In my
 layout i have the following TextView:

 TextView android:id=@+id/balloon_item_title

 android:layout_width=match_parent android:layout_height=wrap_content
 android:text=My Title android:singleLine=true android:maxWidth=200dip
 android:ellipsize=marquee android:marqueeRepeatLimit=marquee_forever
 android:scrollHorizontally=true

 android:textColor=@android:color/primary_text_light
 android:textSize=16sp /



 Although I set the ellipsize to marquee, the text does not move. Is this a
 limitation of the InfoWindowAdapter?
 Thanks
 Best Regards



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



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

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

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


Re: [android-developers] End user ANR stack trace has no line number

2013-01-22 Thread Mark Murphy
http://stackoverflow.com/questions/14466838/anr-has-no-line-number

Which itself is a duplicate of:

http://stackoverflow.com/questions/4619301/proguard-retrace-tools-output

On Tue, Jan 22, 2013 at 5:58 PM, Peri Hartman pe...@kotatko.com wrote:
 I have received an ANR from an end user, but the top line (in my code) has
 no line number. Why is that, and how am I supposed to identify the error?
 The code is obfuscated using progaurd.

 More specifically, the first few lines of my stack trace are:

 java.lang.NullPointerException
 at com.perinote.perinote.main.MainActivity.onOptionsItemSelected(Unknown
 Source)
 at android.app.Activity.onMenuItemSelected(Activity.java:2502)
 at
 com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:950)

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



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

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

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


Re: [android-developers] Menus handled differently in 4.2 on phone and tablet?

2013-01-21 Thread Mark Murphy
On Mon, Jan 21, 2013 at 7:44 AM, Matthew Fleming mgf...@gmail.com wrote:
 I'm trying to adapt a phone app for tablets and have run into a problem.
 When the menu button is pressed, it displays the context menu in the usual
 way at the bottom of the screen, for phone AVD's but not tablets.

That is the options menu, not a context menu.

 I
 confirmed this with a simple test application, created with the Android
 Application template. If I set the target SDK to 10 or less, then I get the
 bottom menu for both phone and tablet, but I want to target 17 for other
 reasons.

I am aware of exactly zero phones running 4.x for which a
targetSdkVersion of 17 will give you the legacy menu affordance in the
navigation bar. Do not rely upon it existing on phones.

 The only way to show the menu items, on the tablet running 4.2, is
 in the action bar. But this would break compatibility with 2.x, and I hadn't
 been planning on using it.

Use ActionBarSherlock for an action bar that works back to Android 2.1.

 Any clarifications as to why I should be seeing this behavior and
 suggestions for a work-around would be much appreciated.

Either use the action bar or get rid of your options menus, using
something inside the UI of your activity as a replacement.

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

Här kan du ställa och svara på frågor om applikationsutveckling på
Android: http://www.andglobe.com

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


Re: [android-developers] LocationManager RequestLocation Updates issue

2013-01-20 Thread Mark Murphy
Quoting the documentation for requestLocationUpdates():

Prior to Jellybean, the minTime parameter was only a hint, and some
location provider implementations ignored it. From Jellybean and
onwards it is mandatory for Android compatible devices to observe both
the minTime and minDistance parameters.

On Sun, Jan 20, 2013 at 12:28 PM, g...@deanblakely.com
g...@deanblakely.com wrote:
 in the onCreate event for my Service I setup locationlistener...

 locMgr = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
 locLstnr = new MyLocationListener();
 debugLog(Instantiated new Location listener, false);
 locMgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1, 10,
 locLstnr);

  The 1 is supposed to mean that I want the event to go off approx every
 10 seconds. My class statement is . . .

 public class MyLocationListener implements LocationListener
 {
 GeoPoint LastGeoPoint;
 . .. . .

 But the onLocationChanged event is going off approx twice per second. Why?
 Thanks, Gary

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



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

Android Training in NYC: http://marakana.com/training/android/

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


Re: [android-developers] Re: how to distribute a Library Project WITHOUT source code (as jar file) as some sort of SDK?

2013-01-20 Thread Mark Murphy
On Sun, Jan 20, 2013 at 12:42 PM, iDeveloper kaplan.d...@gmail.com wrote:
 Any news on this issue ?

Well, so long as the JAR does not contain an R class, you should be
OK, if that's what you mean. The Google Play Services library project
is distributed with a JAR instead of source code, and it does not
contain an R class.

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

Android Training in NYC: http://marakana.com/training/android/

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


Re: [android-developers] Re: how to distribute a Library Project WITHOUT source code (as jar file) as some sort of SDK?

2013-01-20 Thread Mark Murphy
On Sun, Jan 20, 2013 at 1:42 PM, Joe Bowbeer joe.bowb...@gmail.com wrote:
 The feature that we're awaiting is the .aar binary packaging for libraries,

Which hopefully will be ready by next International Talk Like a Pirate Day.

:-)

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

Android Training in NYC: http://marakana.com/training/android/

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


Re: [android-developers] GCM

2013-01-19 Thread Mark Murphy
On Sat, Jan 19, 2013 at 11:23 AM, Goutom goutom.sust@gmail.com wrote:
 I want to build a GCM like service for android of my own.

Please define what a GCM like service is.

Also, you might consider explaining what it is that is driving you to
create your own, rather than use GCM itself.

You might also wish to explain whether you plan to create a GCM like
service as part of a customized Android OS, as a system app for use
on rooted devices, or if you are attempting to pull this off as an
ordinary SDK app.

--
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 4.5 Available!

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


Re: [android-developers] Re: intel-accelerated emulator + maps API with SDK v21

2013-01-18 Thread Mark Murphy
On Fri, Jan 18, 2013 at 7:57 AM, lbendlin l...@bendlin.us wrote:
 At the risk of sounding dour - why are you looking at stuff that will stop
 being developable after March 1 ?

It will still be developable after March 1. It becomes progressively
more risky, since you cannot get new API keys. And it will put the
kibosh on certain models, such as consultants creating unique signing
keys (and Maps V1 API keys) as part of a customer deliverable. But
since, in my testing, getting Maps V2 to work on Android 2.x is far
from bulletproof, some developers may elect to stick with Maps V1
through 2013.

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

Aqui estão alguns sites onde você pode perguntar ou responder dúvidas
sobre desenvolvimento de aplicações para Android:
http://www.andglobe.com

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


Re: [android-developers] Re: Application.onCreate Method Randomly Called?

2013-01-18 Thread Mark Murphy
On Fri, Jan 18, 2013 at 8:58 AM, Jake Colman col...@ppllc.com wrote:
 When an app get *re*created via a second kills to
 onCreate (following a kill) does it get the same context?

No. Objects cannot live beyond their process, and by definition, your
process was terminated. Hence, by definition, all objects in the new
process are different instances that any objects from the old process.

 If that is
 not guaranteed then should I not be using context-based preferences to
 persist my data?

I have no idea what you consider context-based preferences to be. If
you mean static data members, they should be used as a cache for
persistent data or for transient purposes only.

 Is there something other than
 PreferenceManager.getDefaultSharedPreference to do this?

SharedPreferences are persistent, assuming that you use commit() or apply().

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

Aqui estão alguns sites onde você pode perguntar ou responder dúvidas
sobre desenvolvimento de aplicações para Android:
http://www.andglobe.com

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


Re: [android-developers] Permissions Security Exception

2013-01-18 Thread Mark Murphy
On Fri, Jan 18, 2013 at 9:11 AM, Jake Colman col...@ppllc.com wrote:
 My app crashed with the following stack trace:

 java.lang.RuntimeException: Unable to start receiver
 com.jnc.zmanminder.ZMAppWidget: java.lang.SecurityException: Provider
 network requires ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION
 permission

 I request these permissions in the Manifest.  When the user installs my
 app doesn't that mean it is granted those permissions?

Normally, yes.

 If so, how/why
 would this crash be triggered?

The user could have attacked your app with one of those apps that
removes permissions from your manifest and repackages the app.

Or, the user could be running your app on a ROM mod where they blocked
permissions. The good ROM mods do this in a way that is largely
transparent to apps (e.g., for locations, you just never seem to get a
fix), but it's not out of the question that a sloppy ROM mod might
just suppress the permission entirely and cause this sort of crash.

Or, your app could have been pirated, and for whatever reason the
pirated copy lacks these permissions.

 And if it is up to me to protect against
 it, where do I do that in the app?

First, unless this is happening to a significant percentage of your
legitimate users, I wouldn't worry about it. If this occurs to more
than 0.1% of your legitimate users, I'll be stunned.

Beyond that, you can catch the SecurityException (which is a
RuntimeException) the first place you try using something that
theoretically should be fine but might not be due to hacks like I
mentioned.

If location tracking is not essential to your app, and you think that
a worthwhile number of people are going to object to your requesting
these permissions, consider removing location tracking from your app,
perhaps isolating it into a plugin that users can opt into.

 Is there a way to check up-front
 that I have been granted all the necessary permissions?

See above.

 Somehow it does
 not seem like I should have to deal with this.

You shouldn't. Until and unless you have evidence to the contrary,
this is most likely a user problem, IMHO.

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

Aqui estão alguns sites onde você pode perguntar ou responder dúvidas
sobre desenvolvimento de aplicações para Android:
http://www.andglobe.com

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


Re: [android-developers] Re: Application.onCreate Method Randomly Called?

2013-01-18 Thread Mark Murphy
On Fri, Jan 18, 2013 at 10:11 AM, Jake Colman col...@ppllc.com wrote:
 Am I making a fundamental mistake in how this is supposed to be done?

No, that all seems OK.

 You've already told me that when the application is recreated it gets a
 new context.  If so, how are preferences persisted across recreations of
 my application if the key to those preferences are the context?

The key to those preferences is the package name. An easy way to get
the package name is by calling getPackageName() on a Context. The
key to those preferences is not the Context itself.

In this case, the key is used as the basis of a filename, for the
XML file which contains the persisted SharedPreferences.

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

Aqui estão alguns sites onde você pode perguntar ou responder dúvidas
sobre desenvolvimento de aplicações para Android:
http://www.andglobe.com

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


Re: [android-developers] Re: Application.onCreate Method Randomly Called?

2013-01-18 Thread Mark Murphy
On Fri, Jan 18, 2013 at 11:42 AM, Jake Colman col...@ppllc.com wrote:
 The key is committed in the
 Service's onDestroy method.

Please apply() the change when you make it. onDestroy() is not always
called on components.

 The Service is started by my AppWidget every time the app widget needs
 to do some work.  I do not explicitly stop the Service, relying on
 Android to stop it if/when needed (that is not bad practice as I
 understand it).

Correct, but then onDestroy() is not necessarily called. Please
apply() the change when you make it.

 In other words, would multiple calls to Application.onCreate cause the
 Service.onCreate to be called a second time without an intervening
 Service.onDestroy?

Yes, if onDestroy() was not called on the service.

 If this is the problem, is it expensive to persist a key as soon as it
 is changed?

It is equally as expensive as doing it in onDestroy(), because it is
the same code. Using apply() does the save in a background thread.

 Or should calls to commit be bundled and done as
 infrequently as possible?

Things that you do not apply() are not persisted. You need to persist
them at some point and feel confident that some point will be
reached.

Persistence involves disk I/O. Doing a million disk I/O operations is
more expensive than doing one. Hence, to some degree, bundling may
be useful. Only you can draw the line at where you cannot afford to
lose data. This is no different than choosing appropriate transaction
bounds in database operation.

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

Aqui estão alguns sites onde você pode perguntar ou responder dúvidas
sobre desenvolvimento de aplicações para Android:
http://www.andglobe.com

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


Re: [android-developers] Launching play store for specific product

2013-01-17 Thread Mark Murphy
On Thu, Jan 17, 2013 at 1:26 PM, JPS jp_sem...@hotmail.com wrote:
 This is what I'm currently doing but this causes a dialog to pop-up asking
 if this action should be done using the browser or playstore.

The AOSP Browser app does not respond to market:// Uri values, at
least in current versions of Android. You can see its manifest here:

https://github.com/android/platform_packages_apps_browser/blob/master/AndroidManifest.xml

I am not aware that the AOSP Browser app has ever supported the
market:// Uri value.

There may be other apps, though, that support market:// Uri values.

 This is not acceptable in this situation.

Yes, it is. It is not your device. It is the user's device. The user
can, if the user wishes, indicate in the chooser a default app, so
they do not have to be bothered by the chooser anymore for this
specific sort of request. But if the user wishes to have other apps
around that respond to market:// requests, that is the user's choice,
and the user can use those apps. The choice is the user's, not yours.

--
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 4.5 Available!

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


Re: [android-developers] Application.onCreate Method Randomly Called?

2013-01-17 Thread Mark Murphy
I assume widget means app widget.

In that case, is your app widget being updated, via
android:updatePeriodMillis or AlarmManager?

if the answer is yes, then your process is being terminated in
between updates, then recreated on the next update, triggering a new
Application object and onCreate(). This is perfectly normal and
generally beneficial to the user.

On Thu, Jan 17, 2013 at 3:40 PM, Jake Colman col...@ppllc.com wrote:

 My application extends the Application class so that I can initialize
 ACRA in the onCreateMethod.  My application consists primarily of a
 widget that monitors something and sends a notification when a condition
 exists.  If the application or widget is installed and that condition
 already exists at the time of installation, the notification is
 triggered.

 I've started getting reports that the notification will trigger at
 random even after it has already triggered correctly.  I had the user
 send me my Debug Log with an email telling me when the notification was
 triggered.  Based on the timestamps the notification was triggered
 because Application.onCreate was invoked.  Why would
 Application.onCreate be invoked by Android after the application and
 widget were already installed and without the user doing anything?

 --
 Jake Colman -- Android Tinkerer

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



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

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

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


Re: [android-developers] Re: Application.onCreate Method Randomly Called?

2013-01-17 Thread Mark Murphy
On Thu, Jan 17, 2013 at 5:07 PM, Jake Colman col...@ppllc.com wrote:
 Yes, I meant an app widget and, yes, the app widget is being updated
 via android:updatePeriodMillis and the AlarmManager.  The onCreate
 method is NOT being called following an APPWIDGET_UPDATE since I see
 those happening elsewhere in my debug log.

That will depend upon whether or not your process was terminated
between updates. Sometimes it will, sometimes it will not.

 Since the alarm is triggering so often, it sounds unlikely that the
 widget was swapped out of memory since it was quiescent and then
 recreated on account of the alarm having triggered.  Having said that,
 the timestamps for both events (onCreate and the alarm) are identical.

Are you messing around with android:process attributes in the
manifest? If so, each process gets its own Application instance. Also,
if so, please reconsider.

--
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 4.5 Available!

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


Re: [android-developers] Integrate Wireless printer(via Bluetooth/WiFi) with Android Application.

2013-01-16 Thread Mark Murphy
Step #1: Find a wireless printer.

Step #2: Ask the wireless printer manufacturer how to integrate their
device with your Android application.

On Wed, Jan 16, 2013 at 9:19 AM, Vaibhav Ajay Gupta
vaibhav.ajaygu...@gmail.com wrote:
 I want to make an android application that can print forms which are created
 by same application with wireless printer which is connected via via
 Bluetooth/WiFi.
 Any idea how to integrate Wireless printer(via Bluetooth/WiFi) with Android
 Application.???

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



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

Här kan du ställa och svara på frågor om applikationsutveckling på
Android: http://www.andglobe.com

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


Re: [android-developers] Retrieving current URL from chrome (or browser). Use ContentProvider? Or, other method?

2013-01-16 Thread Mark Murphy
On Wed, Jan 16, 2013 at 1:02 PM, xrd xrdaw...@gmail.com wrote:
 Is there a way to retrieve the URL for the current webpage in Chrome in
 another fashion?

AFAIK, there is no documented and supported API for the Chrome browser
app. Fortunately, I also do not see any obvious script kiddie
approach, either.

 I don't see that ContentProvider for browser provides anything with respect
 to the current URL. Would the last item in the history
 (getAllVisitedUrls(...)) tell me this?

AFAIK, Chrome does not use that ContentProvider.

--
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 4.5 Available!

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


Re: [android-developers] Re: Toast not showing on Samsung Galaxy S3 (latest update 4.1.2)

2013-01-15 Thread Mark Murphy
Wow. That's an important find. Thanks for pointing this out!

On Tue, Jan 15, 2013 at 4:31 PM, Harri Smått har...@gmail.com wrote:
 Hi,

 There's a bug filed on Android bug database;

 http://code.google.com/p/android/issues/detail?id=35013

 In other words, if you disable application notifications, Toasts also are 
 disabled for that particular application. Could this be the reason for 
 behaviour Tobias is facing?

 --
 H

 On Jan 15, 2013, at 11:18 PM, bob b...@coolfone.comze.com wrote:

 I have also tried this with the Galaxy S3 and 4.1.1, and the Toast shows 
 fine.


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



-- 
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 4.5 Available!

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


Re: [android-developers] Toast not showing on Samsung Galaxy S3 (latest update 4.1.2)

2013-01-14 Thread Mark Murphy
What Context are you using? Is it the Activity, or something else? If
it is not the Activity, try switching to that and see if the behavior
changes.

I wouldn't expect that to have an impact, but, then again, I wouldn't
expect your problem, either.


On Mon, Jan 14, 2013 at 8:06 AM, Tobias tobias.e.lindb...@gmail.com wrote:
 I have a toast displayed in the following way:

 Toast.makeText(context, The message, Toast.LENGTH_LONG).show();


 I am 100% I am displaying the toast from the UI thread and I can add that it
 worked fine for many devices including older updates of Galaxy S3 but after
 latest update no one of my toasts are being displayed.

 Have anyone else experienced this and have a solution?

 Thanks,
 Tobias

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



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

Localized Android Question-and-Answer Sites: http://www.andglobe.com

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


  1   2   3   4   5   6   7   8   9   10   >