Re: [android-developers] LOg in form

2011-06-05 Thread Knutsford Software
I should have said that I now have my login form working - I needes an 
onresstart


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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Problems with main.xml after uncritical sourcecode changes

2011-06-05 Thread Zsolt Vasvari
I take that back.  It's still happening with the newest tools.  Though
it's now improved in that a single Clean/Rebuild will actually fully
build the project now instead of having to do it 2-3 times before.

This is on Helios SR2, Windows Vista X64.


On Jun 5, 1:00 pm, Zsolt Vasvari  wrote:
> Yes, it's a known issue.  I believe the new beta tools resolve this.
>
> On Jun 5, 10:40 am, J Handal  wrote:
>
>
>
> > "refresh project, restart did also not work"
>
> > try  project-clean
>
> > or delete gen folder
>
> > Also go to properties try  a newer version like 2.2 or higher
>
> > Sometimes the eclipse debug.keystore expires.- Hide quoted text -
>
> - Show quoted text -

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


[android-developers] Re: Market link without "related apps" garbage

2011-06-05 Thread amir
Hi
We have encountered the same problem when sharing via Facebook.
have you found a solution for the random icon problem?

Does any one know if I can set a specific icon as default so he will
have priority over other images/icons? does changing the icon name can
make him be the first one selected?



On May 30, 11:24 pm, CelluDrive  wrote:
> You are right about one thing "given how poorly most things related to
> the Android Market are implemented"!!!
>
> I am thinking about creating my own page that would look like android
> Market andsharethat, instead of original link.
>
> On May 30, 12:52 am, Zsolt Vasvari  wrote:
>
>
>
> > While I am not 100% sure, of course, given how poorly most things
> > related to the Android Market are implement, I would bet any money in
> > the world that you cannot do what you are asking.
>
> > That said, if FB randomly picks some image off the page to show as the
> >icon, what gurantees you that it won't be, for example, the Twitter
> > logo that's on the page?
>
> > On May 29, 7:16 am,CelluDrive wrote:
>
> > > Hey ya'll,
> > >  I'am trying to figure out how to create a link to my market app
> > > WITHOUT showing other related apps. So if this is my 
> > > linkhttps://market.android.com/details?id=com.Smoothdrive there will be
> > > like 10-15 other apps displayed on the left side. Now, some of you can
> > > ask me - why this is a problem? The answer is very simple - when I
> > > post this link toFacebooktoshare,Facebookwill parse the link and
> > > extract images to show right next to the post. If there are other
> > > related apps displayed - there is not guarantee that the picture from
> > > my app will show up next to the link. So far - I've mostly seen
> > > pictures from related apps showing up.
>
> > > Thanks fellas!- Hide quoted text -
>
> - Show quoted text -

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


[android-developers] Re: JSON OR SOAP ?

2011-06-05 Thread Zsolt Vasvari
Cool, that would make a good addition to the compatibility library, as
I'd assume, it's fairly self-contained.

On Jun 5, 8:21 am, Dianne Hackborn  wrote:
> On Mon, May 30, 2011 at 6:28 PM, Streets Of Boston
> wrote:
>
> > Personally, I would choose XML because Android already includes pull and
> > push parsing of XML data from the server. Pull and push parsing allows you
> > to only read the parts of the REST response in which your app is interested
> > and skip the rest: somewhat better performance, much better memory usage for
> > larg REST responses.
>
> Android does now have a pull JSON parser:
>
> http://developer.android.com/reference/android/util/JsonReader.html
>
> Also a writer:
>
> http://developer.android.com/reference/android/util/JsonWriter.html
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

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


Re: [android-developers] lg optimus freezing

2011-06-05 Thread Raghav Sood
I have an LG Optimus P500. It frezes quite often but that was because one of
my apps had some bug in it. (I wrote it.) It never rebooted though. Which
Optimus do you have?

On Sat, Jun 4, 2011 at 11:51 PM, TreKing  wrote:

> On Sat, Jun 4, 2011 at 12:57 PM, bob  wrote:
>
>> I have an LG Optimus that I do dev work on, and it locks up and reboots
>> itself about 3-5 times a day.  Anyone know how to make it stop doing that?
>>
>
> I would ...
>
> 1 Uninstall apps, 1 by 1 in order of installation, until it stops to
> identify if it's an app causing it.
> 2 If that don't work, factory reset the device.
> 3 If that don't work, contact LG support for a replacement.
>
>
> -
> TreKing  - Chicago
> transit tracking app for Android-powered devices
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Raghav Sood
http://www.raghavsood.com/
http://www.androidappcheck.com/
http://www.telstop.tel/

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

[android-developers] Re: Communication with Flash (swf)

2011-06-05 Thread sleith
Hi,
really thanks for your answer :)
Did you ever tried this before?
So the android app will continuously looping every x second to read a
file for any input right?
Is it really possible? i mean for swf to write and read a file in
android platform.

Maybe if you have a trial source code, it would be great if you can
send it to me for sample :)
Thanks

On Jun 2, 10:44 pm, ankur chaudhry 
wrote:
> One way you can do is via a text-file..
> write and read from text-file in android code...and you can do same with
> your flash swf for communication..
> i think direct way is not possible as 2 are very different technologies.. :)
>
> Any prob..do tell.. :)

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


[android-developers] Repeating alarm service

2011-06-05 Thread Simon Platten
I have an alarm service runnining in Android 2.1, there is a problem with
the service in that for some reason unknown to me it starts to exception
after a period of time.

To try and capture the reason why, I have scheduled the service to run at 1
second intervals.  I can see in the debugged when the exception is raised,
but I cannot view it, the debug session stops before I have time to analysis
the problem, is there something I can do to pause the state of the system so
I can debug it?

Thank you,
Simon

-- 
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] Uri.fromFile() returning different results on identical phones

2011-06-05 Thread Kostya Vasilyev
The path you're feeding to Uri.fromFile is not absolute.

Make it so (by calling file.getAbsolutePath or file.getCanonicalPath) and
you should get consistent, predictable results.

-- Kostya

2011/6/5 eehouse 

> I've tracked a crash in my app that's only reproducible on one phone
> (that I've seen) to a strange return from Uri.fromFile().
>
> I have two identical T-Mobile LG G2X devices.  They were purchased at
> the same time.  Software version strings in Settings/About phone are
> identical.  I've hard-reset both to eliminate config differences.
> When I run my app on one, it crashes immediately 100% of the time.
> Run on the other it's fine (as it is on every other device I've tested
> on.)
>
> The function that shows the problem looks like this, after I add
> logging:
>
>public static void launchGame( Activity activity, String path )
>{
>File file = new File( path );
>Utils.logf( "file: %s", file.getPath() );
>Uri uri = Uri.fromFile( file );
>Utils.logf( "Uri.fromFile=>%s", uri.toString() );
>[...]
>}
>
> On the device where there's no crash the logs look like this:
>
> D/XW4 ( 7107): [22:59:40]-1-file: Game 1.xwg
> D/XW4 ( 7107): [22:59:40]-1-Uri.fromFile=>file:///Game%201.xwg
>
> while on the device that's about to crash I see this:
>
> D/XW4 ( 4234): [23:00:36]-1-file: Game 1.xwg
> D/XW4 ( 4234): [23:00:36]-1-Uri.fromFile=>file:///data/data/
> com.lge.providers.flex/databases/Game%201.xwg
>
> Has anybody seen this before?  Is there any chance that it's other
> than a weird bug in the phone itself?
>
> Thanks,
>
> --Eric
>
> --
> 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 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] Repeating alarm service

2011-06-05 Thread Kostya Vasilyev
Use the logcat to see the stack trace. You might want to run it in a command
line window to see it more clearly.

The debugging session stops because the broadcast for your alarm times out,
and Android kills the process.

You could also use Handler.post() / sendMessage() to immediately return
control to Android from onReceive / onStart, and then pick up debugging in
the dispatch for whatever you posted (Runnable / Message).

Looking at the stack trace is logcat should do it, though.

-- Kostya

2011/6/5 Simon Platten 

> I have an alarm service runnining in Android 2.1, there is a problem with
> the service in that for some reason unknown to me it starts to exception
> after a period of time.
>
> To try and capture the reason why, I have scheduled the service to run at 1
> second intervals.  I can see in the debugged when the exception is raised,
> but I cannot view it, the debug session stops before I have time to analysis
> the problem, is there something I can do to pause the state of the system so
> I can debug it?
>
> Thank you,
> Simon
>
> --
> 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 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] Repeating alarm service

2011-06-05 Thread Simon Platten
I think I may have fixed it, I looked around for some information on 
BroadcastReciever 'onRecieve' routines.  I suspected it was that I was 
spending to much time in this routine, but I couldn't find anything to 
back this up.


What I have done now is to create a worker thread when the onRecieve is 
called, this allows the onRecieve to return almost instantly and so far, 
since doing this I haven't had any problems.


Thank you,
Simon

On 05/06/2011 1:37 PM, Kostya Vasilyev wrote:
Use the logcat to see the stack trace. You might want to run it in a 
command line window to see it more clearly.
The debugging session stops because the broadcast for your alarm times 
out, and Android kills the process.
You could also use Handler.post() / sendMessage() to immediately 
return control to Android from onReceive / onStart, and then pick up 
debugging in the dispatch for whatever you posted (Runnable / Message).

Looking at the stack trace is logcat should do it, though.
-- Kostya

2011/6/5 Simon Platten >


I have an alarm service runnining in Android 2.1, there is a
problem with the service in that for some reason unknown to me it
starts to exception after a period of time.

To try and capture the reason why, I have scheduled the service to
run at 1 second intervals.  I can see in the debugged when the
exception is raised, but I cannot view it, the debug session stops
before I have time to analysis the problem, is there something I
can do to pause the state of the system so I can debug it?

Thank you,
Simon
-- 
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 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 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] Repeating alarm service

2011-06-05 Thread Mark Murphy
On Sun, Jun 5, 2011 at 9:27 AM, Simon Platten
 wrote:
> I think I may have fixed it, I looked around for some information on
> BroadcastReciever 'onRecieve' routines.  I suspected it was that I was
> spending to much time in this routine, but I couldn't find anything to back
> this up.
>
> What I have done now is to create a worker thread when the onRecieve is
> called, this allows the onRecieve to return almost instantly and so far,
> since doing this I haven't had any problems.

A manifest-registered BroadcastReceiver cannot safely fork threads.
Once onReceive() is done, Android can terminate the process at any
time, and it might well do that before your thread is finished.

The typical pattern for a manifest-registered BroadcastReceiver that
is doing any significant work is for it to call startService() on an
IntentService, with the IntentService doing the "real work". If the
alarm for your AlarmManager is a _WAKEUP alarm, you will also need to
think about WakeLocks, perhaps using my WakefulIntentService or
something else following that pattern:

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

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

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

-- 
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] Repeating alarm service

2011-06-05 Thread Simon Platten

Thanks Mark,

I have that sample application from a previous query, I'll take another 
look.


Regards,
Simon

On 05/06/2011 2:38 PM, Mark Murphy wrote:

On Sun, Jun 5, 2011 at 9:27 AM, Simon Platten
  wrote:

I think I may have fixed it, I looked around for some information on
BroadcastReciever 'onRecieve' routines.  I suspected it was that I was
spending to much time in this routine, but I couldn't find anything to back
this up.

What I have done now is to create a worker thread when the onRecieve is
called, this allows the onRecieve to return almost instantly and so far,
since doing this I haven't had any problems.

A manifest-registered BroadcastReceiver cannot safely fork threads.
Once onReceive() is done, Android can terminate the process at any
time, and it might well do that before your thread is finished.

The typical pattern for a manifest-registered BroadcastReceiver that
is doing any significant work is for it to call startService() on an
IntentService, with the IntentService doing the "real work". If the
alarm for your AlarmManager is a _WAKEUP alarm, you will also need to
think about WakeLocks, perhaps using my WakefulIntentService or
something else following that pattern:

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



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


[android-developers] NullPointerException in java.io.File.fixSlashes?

2011-06-05 Thread Derek
Hi all,

We get crash reports with the following error:
java.lang.NullPointerException
at java.io.File.fixSlashes(File.java:234)

It appears on File file = new File("path/subfolder");
on some devices only.

We cannot reproduce it. Where could this problem from from?

Cheers.


-- 
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] NullPointerException in java.io.File.fixSlashes?

2011-06-05 Thread Mark Murphy
Well, line 234 of File.java is not in the fixSlashes() method in the
latest stuff in the repo, based on what Google Code Search is telling
me.

What are the models of devices that are giving you this problem?

On Sun, Jun 5, 2011 at 10:21 AM, Derek  wrote:
> Hi all,
>
> We get crash reports with the following error:
> java.lang.NullPointerException
> at java.io.File.fixSlashes(File.java:234)
>
> It appears on File file = new File("path/subfolder");
> on some devices only.
>
> We cannot reproduce it. Where could this problem from from?
>
> Cheers.
>
>
> --
> 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 3.0 Programming Books: http://commonsware.com/books

-- 
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] NullPointerException in java.io.File.fixSlashes?

2011-06-05 Thread Kostya Vasilyev
I've seen this crash in development, caused by "new File(null)".

Perhaps you could check how your code comes up with the path fed into the
constructor?
-- Kostya
2011/6/5 Mark Murphy 

> Well, line 234 of File.java is not in the fixSlashes() method in the
> latest stuff in the repo, based on what Google Code Search is telling
> me.
>
> What are the models of devices that are giving you this problem?
>
> On Sun, Jun 5, 2011 at 10:21 AM, Derek  wrote:
> > Hi all,
> >
> > We get crash reports with the following error:
> > java.lang.NullPointerException
> > at java.io.File.fixSlashes(File.java:234)
> >
> > It appears on File file = new File("path/subfolder");
> > on some devices only.
> >
> > We cannot reproduce it. Where could this problem from from?
> >
> > Cheers.
> >
> >
> > --
> > 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 3.0 Programming Books: http://commonsware.com/books
>
> --
> 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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Fragment Compatibility support down to Android 1.1

2011-06-05 Thread Peli
I've modified the "Android Compatibility support v4, revision
2" ( http://developer.android.com/sdk/compatibility-library.html )
slightly so that it can be used on Android 1.5 or Android 1.1 as well.
The only modification so far was to support Build.VERSION.SDK_INT on
versions earlier than 1.6.

The aim is not to port back all functionality, but at least not to let
an existing application crash in Android 1.1 or Android 1.5 if one
wants to use Fragments or other Honeycomb features.

This is work in progress, and we have not released a jar file yet. So
far it is only available via SVN as an Android Library Project that
can be included in any other project:
http://code.google.com/p/openintents/source/browse/#svn%2Ftrunk%2Fcompatibility%2FAndroidSupportV2

Feel free to use this in your projects, but beware that most of the
functions may actually not yet be compatible with Android 1.1 or
Android 1.5 (we only fixed what we needed so far). Feedback and
patches are welcome, to make this even more useful.

Peli
www.openintents.org

-- 
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] Bundle.putSerializable not calling custom writeObject(ObjectOutputStream) method?

2011-06-05 Thread Emanuel Moecklin
Hi Dianne


   1. Everything I try to persist is UI state, some UIs are just a little 
   more complex than others.
   Persisting it some other way doesn't make sense because it is indeed just 
   part of the UI and not needed anywhere else.
   2. I'm not persisting objects of 100 different classes at once but only a 
   couple of them at a time, depending on what is displayed.
   But if I had to change everything to Parcelable instead of Serializable I 
   would have to touch 100 classes because any of these could potentially be 
   used on this particular screen.
   3. The problem is not the amount of objects I try to persist but the 
   recursive structure. Standard Java serialization keeps a record of every 
   object written to a stream. If the same object is encountered a second time, 
   only a reference to it is written to the stream, and not a second copy of 
   the object; so circular references aren't the problem here. The real problem 
   is the deeply nested structure of the objects (a-->b-->c-->d etc.) which 
   will be serialized recursively with standard Java serialization and requires 
   a stack frame for each recursive call.
   4. But the actual question is if or why the Bundle doesn't use the 
   standard Java serialization if an object is put into with with 
   putSerializable?
   I would expect my custom writeObject method to be called if I use the 
   putSerializable. Why would Android not use the standard serialization 
   mechanism? What other way do I have to prevent the StackOverflowError?
   5. (ok there is one other way: write everything into a byte[] using 
   ObjectOutputStream.writeObject() on top of a ByteArrayOutputStream and then 
   put the byte[] into the Bundle, but I'm looking for a more elegant solution 
   and one that answers my question why the writeObject method isn't called by 
   the Bundle/Parcel classes).

Emanuel Moecklin
1gravity LLC

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

[android-developers] Re: Android LifeCycle and Singleton Instances

2011-06-05 Thread DulcetTone
Mark, thanks so much for that.  I had overlooked those pages in my
focus on the Javadoc.
It would be great if the germ of those nuggets were placed into the
Javadoc.

I think I have the tools to resolve these lifecycle issues.

tone

-- 
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] Bundle.putSerializable not calling custom writeObject(ObjectOutputStream) method?

2011-06-05 Thread Mark Murphy
On Sun, Jun 5, 2011 at 11:43 AM, Emanuel Moecklin <1gravity...@gmail.com> wrote:
> What other way do I have to prevent the StackOverflowError?

I'd start by testing your serialization code in a unit test and
confirm that it works, independent of its use with Bundle. Perhaps you
have done this already -- it's not clear from your posts.

If you conclude that it is indeed Bundle that is the source of your
woe, hold onto this specific object via
onRetainNonConfigurationInstance(). That object will be retained on a
configuration change (e.g., screen rotation) but will be lost for
other onSaveInstanceState() scenarios.

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

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

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


[android-developers] Re: Amazon AppStore, are you earning something from there?

2011-06-05 Thread Adam Ratana
I've been thrilled and surprised with my modest results in the Android
Market for my photography geek app ("Sun Surveyor") so far; in the
Amazon App Store, though, when my sales recently tripled(!) to 3
copies sold, it was listed as #10 in the Top Paid Apps for
Photography, a week or so ago.  Which, if this is a list based on
sales, means that many apps had not sold many copies at all, other
than the very top.  I think it's starting to pick up though.  For a
while there were no downloads of my free version, and now there's been
a few, but it's extremely low compared to 1000s in the Android Market.

I think what others have said is acute, the Amazon App Store is
probably going to mainly be used by the most involved of Android users
at the moment, so if your apps are popular with that demographic, then
they are more likely to purchase via Amazon, since they're more likely
to have it installed.  Just think, how many phones have the Amazon App
Store installed on them?  Cut out the rest of the world, except for
the US, and then take a segment of that population, subtracting a
carrier or two.  It's a much smaller potential user base.

The Amazon App Store seems to have a big investment behind it, with
the free app per day, etc.  It remains to be seen if there's going to
be an consumer anxiety if it soon becomes revealed that the Amazon App
Store will be on devices which the Android market is not, and vice
versa.  As a consumer, I want my purchases on a platform to follow me
to whatever device I have.  If this is not the case with Android/
Amazon it'll be interesting to see how consumer behavior changes, and
what the overall response is.  I can't see it killing the platform,
but if purchases become inaccessible because Android device X isn't
playing nice (or chooses not to) with google, it's not going to be a
pleasant consumer experience IMO.

On Jun 4, 10:50 am, sblantipodi  wrote:
> As title,
> my apps sells quite good on the android market, haven't sold anything
> on the amazon appstore and you?

-- 
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: A tricky but simple solution for who requires modal dialog

2011-06-05 Thread Qi Luo
I've tried this, but I didn't figure out how to build a real dialog-like and
modal activity. Here's 2 issues I ran into,
1. I created a dialog-themed activity, but the background of  it was always
black, and the main activity under it was totally invisible.
2. activity could be started and expect a result back, but there's no sync
response.

On Sat, Jun 4, 2011 at 10:33 AM, Simon Jackson  wrote:

> Any droid developer would consider an activity, with a check for the modal
> activity in the app being displayed, and so switch to it, and finish.
>
>  --
> 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 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: A tricky but simple solution for who requires modal dialog

2011-06-05 Thread Mark Murphy
On Sun, Jun 5, 2011 at 12:28 PM, Qi Luo  wrote:
> I've tried this, but I didn't figure out how to build a real dialog-like and
> modal activity. Here's 2 issues I ran into,
> 1. I created a dialog-themed activity, but the background of  it was always
> black, and the main activity under it was totally invisible.

http://android-coding.blogspot.com/2011/05/make-you-app-looked-like-dialog.html

> 2. activity could be started and expect a result back, but there's no sync
> response.

You don't need "sync response".

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

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

-- 
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] Background services and notifications.

2011-06-05 Thread Edam
Hi,

Thanks for the info.
I'll update my app to use the alarm manager to wake the service.
The service will then get the location, (possibly connect to web service) 
and check if a notification should be sent.

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

[android-developers] Re: Uri.fromFile() returning different results on identical phones

2011-06-05 Thread eehouse
Thanks for the suggestion.  It's provided the clue that will let me
work around the problem.  But for the record, calling
getAbsolutePath() isn't changing the result: I still get different
paths on the two (identical) devices:

Code:

Utils.logf( "launchGame(%s)", path );
File file = new File( path );
Utils.logf( "file: %s", file.getAbsolutePath() );

One log:

D/XW4 (25851): [09:57:35]-1-launchGame(Game 1.xwg)
D/XW4 (25851): [09:57:35]-1-file: /Game 1.xwg

The other log:

D/XW4 ( 5102): [09:56:26]-1-launchGame(Game 1.xwg)
D/XW4 ( 5102): [09:56:26]-1-file: /data/data/
com.lge.providers.flex/databases/Game 1.xwg

It's the same if I use getCanonicalPath().

Thanks,

--Eric

On Jun 5, 5:21 am, Kostya Vasilyev  wrote:
> The path you're feeding to Uri.fromFile is not absolute.
>
> Make it so (by calling file.getAbsolutePath or file.getCanonicalPath) and
> you should get consistent, predictable results.
>
> -- Kostya
>
> 2011/6/5 eehouse 
>
> > I've tracked a crash in my app that's only reproducible on one phone
> > (that I've seen) to a strange return from Uri.fromFile().
>
> > I have two identical T-Mobile LG G2X devices.  They were purchased at
> > the same time.  Software version strings in Settings/About phone are
> > identical.  I've hard-reset both to eliminate config differences.
> > When I run my app on one, it crashes immediately 100% of the time.
> > Run on the other it's fine (as it is on every other device I've tested
> > on.)
>
> > The function that shows the problem looks like this, after I add
> > logging:
>
> >    public static void launchGame( Activity activity, String path )
> >    {
> >        File file = new File( path );
> >        Utils.logf( "file: %s", file.getPath() );
> >        Uri uri = Uri.fromFile( file );
> >        Utils.logf( "Uri.fromFile=>%s", uri.toString() );
> >        [...]
> >    }
>
> > On the device where there's no crash the logs look like this:
>
> > D/XW4     ( 7107): [22:59:40]-1-file: Game 1.xwg
> > D/XW4     ( 7107): [22:59:40]-1-Uri.fromFile=>file:///Game%201.xwg
>
> > while on the device that's about to crash I see this:
>
> > D/XW4     ( 4234): [23:00:36]-1-file: Game 1.xwg
> > D/XW4     ( 4234): [23:00:36]-1-Uri.fromFile=>file:///data/data/
> > com.lge.providers.flex/databases/Game%201.xwg
>
> > Has anybody seen this before?  Is there any chance that it's other
> > than a weird bug in the phone itself?
>
> > Thanks,
>
> > --Eric
>
> > --
> > 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 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: Uri.fromFile() returning different results on identical phones

2011-06-05 Thread Kostya Vasilyev
According to your logs, the current working directory at the time that the
file path is constructed is different.

Since the source path is relative, this produces different results.

Assuming you know where "Game 1.xwg" really is, why not construct an
absolute path to begin with?

-- Kostya

2011/6/5 eehouse 

> Thanks for the suggestion.  It's provided the clue that will let me
> work around the problem.  But for the record, calling
> getAbsolutePath() isn't changing the result: I still get different
> paths on the two (identical) devices:
>
> Code:
>
>Utils.logf( "launchGame(%s)", path );
> File file = new File( path );
> Utils.logf( "file: %s", file.getAbsolutePath() );
>
> One log:
>
> D/XW4 (25851): [09:57:35]-1-launchGame(Game 1.xwg)
> D/XW4 (25851): [09:57:35]-1-file: /Game 1.xwg
>
> The other log:
>
> D/XW4 ( 5102): [09:56:26]-1-launchGame(Game 1.xwg)
> D/XW4 ( 5102): [09:56:26]-1-file: /data/data/
> com.lge.providers.flex/databases/Game 1.xwg
>
> It's the same if I use getCanonicalPath().
>
> Thanks,
>
> --Eric
>
> On Jun 5, 5:21 am, Kostya Vasilyev  wrote:
> > The path you're feeding to Uri.fromFile is not absolute.
> >
> > Make it so (by calling file.getAbsolutePath or file.getCanonicalPath) and
> > you should get consistent, predictable results.
> >
> > -- Kostya
> >
> > 2011/6/5 eehouse 
> >
> > > I've tracked a crash in my app that's only reproducible on one phone
> > > (that I've seen) to a strange return from Uri.fromFile().
> >
> > > I have two identical T-Mobile LG G2X devices.  They were purchased at
> > > the same time.  Software version strings in Settings/About phone are
> > > identical.  I've hard-reset both to eliminate config differences.
> > > When I run my app on one, it crashes immediately 100% of the time.
> > > Run on the other it's fine (as it is on every other device I've tested
> > > on.)
> >
> > > The function that shows the problem looks like this, after I add
> > > logging:
> >
> > >public static void launchGame( Activity activity, String path )
> > >{
> > >File file = new File( path );
> > >Utils.logf( "file: %s", file.getPath() );
> > >Uri uri = Uri.fromFile( file );
> > >Utils.logf( "Uri.fromFile=>%s", uri.toString() );
> > >[...]
> > >}
> >
> > > On the device where there's no crash the logs look like this:
> >
> > > D/XW4 ( 7107): [22:59:40]-1-file: Game 1.xwg
> > > D/XW4 ( 7107): [22:59:40]-1-Uri.fromFile=>file:///Game%201.xwg
> >
> > > while on the device that's about to crash I see this:
> >
> > > D/XW4 ( 4234): [23:00:36]-1-file: Game 1.xwg
> > > D/XW4 ( 4234): [23:00:36]-1-Uri.fromFile=>file:///data/data/
> > > com.lge.providers.flex/databases/Game%201.xwg
> >
> > > Has anybody seen this before?  Is there any chance that it's other
> > > than a weird bug in the phone itself?
> >
> > > Thanks,
> >
> > > --Eric
> >
> > > --
> > > 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 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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] basic4android Fly With Me app tested

2011-06-05 Thread Thomas
I finally got around to having a friend test this little app on a
newer Droid as it has been working on my t-mobile G1. It worked nicely
there as well.  This app helps shoppers find their car in the mall
parking lot.  Down load at http://tombtalk.net/apps
I was testing the basic4android setup and a friend suggested I do
something useful like help her find her car at the mall.   After a
short visual Basic learning curve everything worked as advertised and
the app was sent to the field.  Field testing revealed that trig sin
and cos calculations should be done with double precision variables
rather than float and that it was possible to save the wrong location
it things were timed just perfectly.
Tom B

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


[android-developers] CWAC Demo

2011-06-05 Thread Simon Platten
Earlier I posted a question regarding a problem I'm having with my
BroadcastReceiver and onReceive method.  I found that the logic in onReceive
would sometimes crash and I couldn't find an explanation why, one road I
went down was to try creating a thread in onReceive, whilst this was better,
it didn't cure the problem altogether.

I then got a response from "Mark Murphy", pointing me in the direction of
the CWAC demo, which I am looking at, but having tried to implement the same
techniques used in the demo, my intent fails to launch with an error in the
logger "no init"...I've compared my code to the CWAC demo and cannot see
what I'm missing.

In summary,  my application starts off with an activity that gets input from
the user, it then installs a repeating alarm, the alarm works well and I can
see that the BroadcastReceiver onRecieve method is called reliably, however
sometimes there is a crash in the onReceive method, it continues to be
scheduled at the specified interval, but fails to work from this point on.
All my efforts to find out why have failed.

I am changing the wallpaper via the WallpaperManager in the onReceive.  Now
I am trying to implement the same technique used byt eh CWAV demo, but it
fails.  Here is my Receiver:

[code]
public class myReciever extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
myService.sendWakefulWork( context );
}
}
[/code]

Here is the myService class:

[code]
public class myService extends IntentService {
private static final String LOCK_NAME_STATIC = "myService";

private static volatile PowerManager.WakeLock m_lockStatic = null;

synchronized private static PowerManager.WakeLock getLock(Context
context) {
if( m_lockStatic == null ) {
PowerManager mgr =
(PowerManager)context.getSystemService(Context.POWER_SERVICE);
m_lockStatic = mgr.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
LOCK_NAME_STATIC);
m_lockStatic.setReferenceCounted(true);
}
return m_lockStatic;
}

public static void sendWakefulWork(Context context, Intent i) {
getLock(context).acquire();
context.startService( i );
}

public static void sendWakefulWork( Context ctxt ) {
Intent intent = new Intent( ctxt, myService.class );
sendWakefulWork( ctxt, intent );
}

public myService(String name) {
super(name);
setIntentRedelivery(true);
}

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if ( (flags & START_FLAG_REDELIVERY) != 0 ) { // if crash restart...
getLock(this).acquire();  // ...then quick grab
the lock
}
super.onStartCommand(intent, flags, startId);
return START_REDELIVER_INTENT;
}

@Override
final protected void onHandleIntent(Intent intent) {
try {
doWakefulWork(intent);
} finally {
getLock(this).release();
}
}

private void doWakefulWork( Intent intent ) {
// ... Do something, but it never gets here !

}
}
[/code]

The manifest file:
[code]

http://schemas.android.com/apk/res/android";
  package="com.myPackage"
  android:versionName="1.1" android:versionCode="1">











 
 
 

[/code]

Thank you,
Simon

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

[android-developers] Re: Actionbar.DISPLAY_HOME_AS_UP causes activity to not call destroy, is this by design?

2011-06-05 Thread Christer Nordvik
That's what I get for coding at night. I had forgotten that I had
created my own base activity that had implemented starting a new
Intent and no finish call.

Sorry about that, and thanks for responding :-)

-Christer

On Jun 5, 1:31 am, Mark Murphy  wrote:
> AFAIK, the top left icon has no effect, other than whatever effect you
> apply yourself. Just marking it as "up enabled" does not cause Android
> to somehow magically know how to handle that. Instead, you have to
> override onOptionsItemSelected() and watch for android.R.id.home and
> do something there.
>
> For example, in one of my activities that uses
> setDisplayHomeAsUpEnabled(), I have:
>
>         @Override
>         public boolean onOptionsItemSelected(MenuItem item) {
>                 switch (item.getItemId()) {
>                         case android.R.id.home:
>                                 finish();
>
>                                 return(true);
>                 }
>
>                 return(super.onOptionsItemSelected(item));
>         }
>
> In this case, the flow is much like yours -- "up" equates to "back",
> so I just finish() the current activity to make it happen.
>
> If you are using startActivity() with FLAG_ACTIVITY_REORDER_TO_FRONT
> to go "home", that's not going to immediately destroy your original
> activity, any more than any other startActivity() call does.
>
> So... what are you doing in onOptionsItemSelected()?
>
>
>
>
>
>
>
>
>
> On Sat, Jun 4, 2011 at 7:22 PM, Christer Nordvik  wrote:
> > I have two activities.
>
> > 1. Home
> > 2. Details
>
> > In the details activity I set:
> >  ActionBar actionBar = this.getActionBar();
> >  actionBar.setDisplayHomeAsUpEnabled(true);
>
> > and this causes the top left icon to act as a home button.
>
> > But what I hadn't anticipated was that the details activity isn't
> > destroyed when pressing the home button. If I press the back button
> > then the activity is destroyed.
>
> > Can anyone explain why the details activity isn't destroyed? Do I need
> > to intercept the user clicking the home button and destroy the
> > activity myself since I want to cleanup the image resources it uses...
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to Android Development_ Version 3.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


Re: [android-developers] CWAC Demo

2011-06-05 Thread Kostya Vasilyev
The offending line is this:

public myService(String name) {
super(name);
setIntentRedelivery(true);
}

Android instantiates components (services, activities) using the component's
default constructor.

An explicit non-default constructor like the above prevents the compiler
from generating the default one, and it can't use any constructors with
arguments because it has no way to know what they values would be.

Then Android fails to instantiate your service.

Change the constructor to:

public myService(/* no arguments */) {
super("some name string");
setIntentRedelivery(true);
}

The reason IntentService and WakefulIntentService have a constructor with a
string parameter is they are meant to be subclassed. And that's something
you could consider as well to improve maintainability.

-- Kostya

2011/6/5 Simon Platten 

> Earlier I posted a question regarding a problem I'm having with my
> BroadcastReceiver and onReceive method.  I found that the logic in onReceive
> would sometimes crash and I couldn't find an explanation why, one road I
> went down was to try creating a thread in onReceive, whilst this was better,
> it didn't cure the problem altogether.
>
> I then got a response from "Mark Murphy", pointing me in the direction of
> the CWAC demo, which I am looking at, but having tried to implement the same
> techniques used in the demo, my intent fails to launch with an error in the
> logger "no init"...I've compared my code to the CWAC demo and cannot see
> what I'm missing.
>
> In summary,  my application starts off with an activity that gets input
> from the user, it then installs a repeating alarm, the alarm works well and
> I can see that the BroadcastReceiver onRecieve method is called reliably,
> however sometimes there is a crash in the onReceive method, it continues to
> be scheduled at the specified interval, but fails to work from this point
> on.  All my efforts to find out why have failed.
>
> I am changing the wallpaper via the WallpaperManager in the onReceive.  Now
> I am trying to implement the same technique used byt eh CWAV demo, but it
> fails.  Here is my Receiver:
>
> [code]
> public class myReciever extends BroadcastReceiver {
> @Override
> public void onReceive(Context context, Intent intent) {
> myService.sendWakefulWork( context );
> }
> }
> [/code]
>
> Here is the myService class:
>
> [code]
> public class myService extends IntentService {
> private static final String LOCK_NAME_STATIC = "myService";
>
> private static volatile PowerManager.WakeLock m_lockStatic = null;
>
> synchronized private static PowerManager.WakeLock getLock(Context
> context) {
> if( m_lockStatic == null ) {
> PowerManager mgr =
> (PowerManager)context.getSystemService(Context.POWER_SERVICE);
> m_lockStatic = mgr.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
> LOCK_NAME_STATIC);
> m_lockStatic.setReferenceCounted(true);
> }
> return m_lockStatic;
> }
>
> public static void sendWakefulWork(Context context, Intent i) {
> getLock(context).acquire();
> context.startService( i );
> }
>
> public static void sendWakefulWork( Context ctxt ) {
> Intent intent = new Intent( ctxt, myService.class );
> sendWakefulWork( ctxt, intent );
> }
>
> public myService(String name) {
> super(name);
> setIntentRedelivery(true);
> }
>
> @Override
> public int onStartCommand(Intent intent, int flags, int startId) {
> if ( (flags & START_FLAG_REDELIVERY) != 0 ) { // if crash
> restart...
> getLock(this).acquire();  // ...then quick grab
> the lock
> }
> super.onStartCommand(intent, flags, startId);
> return START_REDELIVER_INTENT;
> }
>
> @Override
> final protected void onHandleIntent(Intent intent) {
> try {
> doWakefulWork(intent);
> } finally {
> getLock(this).release();
> }
> }
>
> private void doWakefulWork( Intent intent ) {
> // ... Do something, but it never gets here !
>
> }
> }
> [/code]
>
> The manifest file:
> [code]
> 
> http://schemas.android.com/apk/res/android";
>   package="com.myPackage"
>   android:versionName="1.1" android:versionCode="1">
>android:label="@string/app_name">
>android:label="@string/app_name">
> 
> 
>  />
> 
> 
> 
> 
> 
> 
>  
>  
>  android:normalScreens="true"
>android:smallScreens="true"
>android:resizeable="false"
>android:anyDensity="true"/>
> 
> [/code]
>
> Thank you,
> Simon
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To p

[android-developers] Re: Advanced Memory Leak, What could be the cause/How to find it ?

2011-06-05 Thread albnok
Figure out how to get OOME quickly (usually rotating and going in and
out if activities). Comment EVERYTHING out. Test that there is zero
gain. Get a hprof dump when app is freshly loaded, do the rotate and
in and out test, get another dump, compare the histograms (right most
icon in MAT). You may find some extra objects. Click Histogram and
search for the object. Right-click and expand the menus - the one you
need to look for is something like "ignore all phantom/soft/weak
references" (can't remember exact name since not at workstation). You
may see loads of orphaned objects e.g. Matrix so you'd do m.reset()
instead of m = new Matrix() if you want to reuse it.

Once you have attained zero gain, slowly uncomment blocks of code
until you find your leaks.

On May 14, 12:38 am, olivier  wrote:
> Dears,
>
> I am metting an OutOfMemory exception after a while, while inflating
> an XML View with a bitmap.
>
> The problem occurs after opening many times activities that are using
> many bitmap but always inflated from the XML.
>
> I check with MAT the Memory.
> First question : I don't retain any of my Activity in memory - If I
> filter on the name of my Activity, i get Objects = 0, but on some
> activities I could see RetainedHeap >= 302. Does this indicate a
> leak ?
>
> After that, I try to compare my memory in different points of time, to
> see the objects that have been created. But I can't find any thing
> significant.
>
> My Question is : If I don't retain activities in memory what could be
> the leak reasons ?
> What tools/Method to use to find it ?
>
> Regards,
>
> Olivier

-- 
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] Bundle.putSerializable not calling custom writeObject(ObjectOutputStream) method?

2011-06-05 Thread Emanuel Moecklin
Hi Mark

The serialization code works because my workaround I mentioned in my 
previous post works ("write everything into a byte[] using 
ObjectOutputStream.writeObject() on top of a ByteArrayOutputStream and then 
put the byte[] into the Bundle").

I tested your onRetainNonConfigurationInstance/
getLastNonConfigurationInstance suggestion and that's exactly what I was 
looking for! Thanks.

Remains the question why Android doesn't call through to writeObject? Maybe 
Dianne can answer that question?

Best Regards
Emanuel Moecklin
1gravity LLC

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

[android-developers] Re: Advanced Memory Leak, What could be the cause/How to find it ?

2011-06-05 Thread albnok
Comment everything out. Make a routine where you rotate and go in and
out of the activity. Start activity fresh, do hprof dump, do the
routine, get another dump. Click Histogram and click the right most
icon to compare to the fresh dump. You may spot some extra objects.
Click Histogram again and search for the extra objects. Right-click
and look for the "ignore phantom/weak/soft references" (not at
computer, don't remember exact menu). You may find orphaned objects
e.g. Matrix as a result of doing m = new Matrix() when you can reuse
with m.reset(). Aim for zero gain before uncommenting blocks of code
to find the leak(s).


On May 14, 12:38 am, olivier  wrote:
Comcommentment > Dears,
>
> I am metting an OutOfMemory exception after a while, while inflating
> an XML View with a bitmap.
>
> The problem occurs after opening many times activities that are using
> many bitmap but always inflated from the XML.
>
> I check with MAT the Memory.
> First question : I don't retain any of my Activity in memory - If I
> filter on the name of my Activity, i get Objects = 0, but on some
> activities I could see RetainedHeap >= 302. Does this indicate a
> leak ?
>
> After that, I try to compare my memory in different points of time, to
> see the objects that have been created. But I can't find any thing
> significant.
>
> My Question is : If I don't retain activities in memory what could be
> the leak reasons ?
> What tools/Method to use to find it ?
>
> Regards,
>
> Olivier

-- 
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] CWAC Demo

2011-06-05 Thread Simon Platten
Thank you so much, that was it!

Regards,
Simon

On Sun, Jun 5, 2011 at 7:41 PM, Kostya Vasilyev  wrote:

> The offending line is this:
>
> public myService(String name) {
> super(name);
> setIntentRedelivery(true);
> }
>
> Android instantiates components (services, activities) using the
> component's default constructor.
>
> An explicit non-default constructor like the above prevents the compiler
> from generating the default one, and it can't use any constructors with
> arguments because it has no way to know what they values would be.
>
> Then Android fails to instantiate your service.
>
> Change the constructor to:
>
> public myService(/* no arguments */) {
> super("some name string");
> setIntentRedelivery(true);
> }
>
> The reason IntentService and WakefulIntentService have a constructor with a
> string parameter is they are meant to be subclassed. And that's something
> you could consider as well to improve maintainability.
>
> -- Kostya
>
> 2011/6/5 Simon Platten 
>
>> Earlier I posted a question regarding a problem I'm having with my
>> BroadcastReceiver and onReceive method.  I found that the logic in onReceive
>> would sometimes crash and I couldn't find an explanation why, one road I
>> went down was to try creating a thread in onReceive, whilst this was better,
>> it didn't cure the problem altogether.
>>
>> I then got a response from "Mark Murphy", pointing me in the direction of
>> the CWAC demo, which I am looking at, but having tried to implement the same
>> techniques used in the demo, my intent fails to launch with an error in the
>> logger "no init"...I've compared my code to the CWAC demo and cannot see
>> what I'm missing.
>>
>> In summary,  my application starts off with an activity that gets input
>> from the user, it then installs a repeating alarm, the alarm works well and
>> I can see that the BroadcastReceiver onRecieve method is called reliably,
>> however sometimes there is a crash in the onReceive method, it continues to
>> be scheduled at the specified interval, but fails to work from this point
>> on.  All my efforts to find out why have failed.
>>
>> I am changing the wallpaper via the WallpaperManager in the onReceive.
>> Now I am trying to implement the same technique used byt eh CWAV demo, but
>> it fails.  Here is my Receiver:
>>
>> [code]
>> public class myReciever extends BroadcastReceiver {
>> @Override
>> public void onReceive(Context context, Intent intent) {
>> myService.sendWakefulWork( context );
>> }
>> }
>> [/code]
>>
>> Here is the myService class:
>>
>> [code]
>> public class myService extends IntentService {
>> private static final String LOCK_NAME_STATIC = "myService";
>>
>> private static volatile PowerManager.WakeLock m_lockStatic = null;
>>
>> synchronized private static PowerManager.WakeLock getLock(Context
>> context) {
>> if( m_lockStatic == null ) {
>> PowerManager mgr =
>> (PowerManager)context.getSystemService(Context.POWER_SERVICE);
>> m_lockStatic = mgr.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
>> LOCK_NAME_STATIC);
>> m_lockStatic.setReferenceCounted(true);
>> }
>> return m_lockStatic;
>> }
>>
>> public static void sendWakefulWork(Context context, Intent i) {
>> getLock(context).acquire();
>> context.startService( i );
>> }
>>
>> public static void sendWakefulWork( Context ctxt ) {
>> Intent intent = new Intent( ctxt, myService.class );
>> sendWakefulWork( ctxt, intent );
>> }
>>
>> public myService(String name) {
>> super(name);
>> setIntentRedelivery(true);
>> }
>>
>> @Override
>> public int onStartCommand(Intent intent, int flags, int startId) {
>> if ( (flags & START_FLAG_REDELIVERY) != 0 ) { // if crash
>> restart...
>> getLock(this).acquire();  // ...then quick
>> grab the lock
>> }
>> super.onStartCommand(intent, flags, startId);
>> return START_REDELIVER_INTENT;
>> }
>>
>> @Override
>> final protected void onHandleIntent(Intent intent) {
>> try {
>> doWakefulWork(intent);
>> } finally {
>> getLock(this).release();
>> }
>> }
>>
>> private void doWakefulWork( Intent intent ) {
>> // ... Do something, but it never gets here !
>>
>> }
>> }
>> [/code]
>>
>> The manifest file:
>> [code]
>> 
>> http://schemas.android.com/apk/res/android";
>>   package="com.myPackage"
>>   android:versionName="1.1" android:versionCode="1">
>> >   android:label="@string/app_name">
>> >   android:label="@string/app_name">
>> 
>> 
>> > />
>> 
>> 
>> 
>> 
>> 
>> 
>>  
>>  
>>  >android:normalScreens="true"
>>android:smallScreens

Re: [android-developers] Re: Advanced Memory Leak, What could be the cause/How to find it ?

2011-06-05 Thread B Lyon
what version of android?

On Sun, Jun 5, 2011 at 2:51 PM, albnok  wrote:
> Comment everything out. Make a routine where you rotate and go in and
> out of the activity. Start activity fresh, do hprof dump, do the
> routine, get another dump. Click Histogram and click the right most
> icon to compare to the fresh dump. You may spot some extra objects.
> Click Histogram again and search for the extra objects. Right-click
> and look for the "ignore phantom/weak/soft references" (not at
> computer, don't remember exact menu). You may find orphaned objects
> e.g. Matrix as a result of doing m = new Matrix() when you can reuse
> with m.reset(). Aim for zero gain before uncommenting blocks of code
> to find the leak(s).
>
>
> On May 14, 12:38 am, olivier  wrote:
> Comcommentment > Dears,
>>
>> I am metting an OutOfMemory exception after a while, while inflating
>> an XML View with a bitmap.
>>
>> The problem occurs after opening many times activities that are using
>> many bitmap but always inflated from the XML.
>>
>> I check with MAT the Memory.
>> First question : I don't retain any of my Activity in memory - If I
>> filter on the name of my Activity, i get Objects = 0, but on some
>> activities I could see RetainedHeap >= 302. Does this indicate a
>> leak ?
>>
>> After that, I try to compare my memory in different points of time, to
>> see the objects that have been created. But I can't find any thing
>> significant.
>>
>> My Question is : If I don't retain activities in memory what could be
>> the leak reasons ?
>> What tools/Method to use to find it ?
>>
>> Regards,
>>
>> Olivier
>
> --
> 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 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] Bundle.putSerializable not calling custom writeObject(ObjectOutputStream) method?

2011-06-05 Thread Dianne Hackborn
Android doesn't do anything to stop your code from working.  As you seem to
have already said, it is just doing standard serialization as here:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/os/Parcel.java;h=31f87198878aa4ac6c1dd3f8be6e151c1d1c89d8;hb=HEAD#l1154

Note onRetainNonConfigurationInstance is NOT a solution, because in the case
where your app goes to the background it still needs to place its UI state
in onSaveInstanceState() so it can be restored later if the process is
killed.  Anything you only put in onRetainnonConfigurationInstance() will be
lost, fairly randomly as far as the user is concerned.

On Sun, Jun 5, 2011 at 11:49 AM, Emanuel Moecklin <1gravity...@gmail.com>wrote:

> Hi Mark
>
> The serialization code works because my workaround I mentioned in my
> previous post works ("write everything into a byte[] using
> ObjectOutputStream.writeObject() on top of a ByteArrayOutputStream and then
> put the byte[] into the Bundle").
>
> I tested your onRetainNonConfigurationInstance/
> getLastNonConfigurationInstance suggestion and that's exactly what I was
> looking for! Thanks.
>
> Remains the question why Android doesn't call through to writeObject? Maybe
> Dianne can answer that question?
>
> Best Regards
> Emanuel Moecklin
> 1gravity LLC
>
> --
> 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
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

[android-developers] Back Button implementation

2011-06-05 Thread kaushik p
Hi all

can anyone please help me implementing the back button in my app
exclusively?? I am building an app to help illiterate ppl , so they do not
know how to use the android back button ,i need to exclusively put it on the
screen .

However i want to use  my back button exactly ia the  way, natural back
button works. For example , it should be like i click my back button on the
screen then it should trigger the natural back button click .


-- 
Thanks&Regards
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

Re: [android-developers] Re: getting exception on updating ui?

2011-06-05 Thread Hitendrasinh Gohil
>
> Hi mark,
>
>
 thankx a lot i have resolve with the help of postdelayed.

"3. Do not put a MediaPlayer in a static data member, as you appear to
have done with LocalMediaPlayer. Static data members should be avoided
where possible, and I fail to see why this case would be necessary."

I have three classess i)list of songs ii)mediaplayer class that handles
play,next,previous etc iii)playerview class on which there are buttons for
next,play/pause and previous.

I have used static mediaplayer because i can easily get the mediaplayer
objects i.e  LocalMediaPlayer.*mediaplayer*.getDuration();

if this is wrong way or not a better way then can u suggest me the best way?

-- 
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] Fragment Compatibility support down to Android 1.1

2011-06-05 Thread Dianne Hackborn
Making it work on 1.5 and earlier is not actually so simple, because of the
way the Dalvik class loader works on those versions.  The approach the
library uses a lot for being able to call newer functions (having the calls
in a separate class that is only used if running on the appropriate version)
breaks prior to 1.6 because Dalvik will fail loading the app's dex file if
it has any such references.

Honestly I don't think messing with 1.5 or earlier is at all worth the time.

On Sun, Jun 5, 2011 at 8:37 AM, Peli  wrote:

> I've modified the "Android Compatibility support v4, revision
> 2" ( http://developer.android.com/sdk/compatibility-library.html )
> slightly so that it can be used on Android 1.5 or Android 1.1 as well.
> The only modification so far was to support Build.VERSION.SDK_INT on
> versions earlier than 1.6.
>
> The aim is not to port back all functionality, but at least not to let
> an existing application crash in Android 1.1 or Android 1.5 if one
> wants to use Fragments or other Honeycomb features.
>
> This is work in progress, and we have not released a jar file yet. So
> far it is only available via SVN as an Android Library Project that
> can be included in any other project:
>
> http://code.google.com/p/openintents/source/browse/#svn%2Ftrunk%2Fcompatibility%2FAndroidSupportV2
>
> Feel free to use this in your projects, but beware that most of the
> functions may actually not yet be compatible with Android 1.1 or
> Android 1.5 (we only fixed what we needed so far). Feedback and
> patches are welcome, to make this even more useful.
>
> Peli
> www.openintents.org
>
> --
> 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
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

[android-developers] startActivityForResult does not return control to calling Activity

2011-06-05 Thread Anirvan
i have a tab layout. in one of the Activity's corresponding to a tab,
i use "startActivityForResult" to launch another activity to do
something. Once the tasks in the new activity are done, i invoke the
"finish()" method to return to the tab Activity which launched it.

strangely enough, when the new activity is finished, instead of
showing the tab activity which launched it, the entire app simply
exits. in the tab activity class i've overriden the "onActivityResult"
method, and have a log statement right at the start. This log
statement does not get printed.

so the gist of the problem is that when i launch an activity for
result, and then finish it, the control does not return back to the
activity which launched the other one - instead the app exits.

is there some elementary mistake that i'm making here?
thanks for your time.

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


[android-developers] Re: EditText stops displaying characters as I'm typing?

2011-06-05 Thread Eric Carman
As this is an on-again, off-again problem, it appears to be on again.

I can reproduce this on a G-Slate.

Back to square one

-- 
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] Back Button implementation

2011-06-05 Thread Dianne Hackborn
When you get the back button, call finish() on your activity.  That's all
the default implementation does.

On Sun, Jun 5, 2011 at 12:09 PM, kaushik p  wrote:

> Hi all
>
> can anyone please help me implementing the back button in my app
> exclusively?? I am building an app to help illiterate ppl , so they do not
> know how to use the android back button ,i need to exclusively put it on the
> screen .
>
> However i want to use  my back button exactly ia the  way, natural back
> button works. For example , it should be like i click my back button on the
> screen then it should trigger the natural back button click .
>
>
> --
> Thanks&Regards
> 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




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

[android-developers] GPS lat & long

2011-06-05 Thread ingy abbas
The GPS Latitude and longitude is not ( x and y Direction ) ?Is it z
direction ( slider some how )? When the map with overlay item appear
on the mobile it seems like the overlay items are Z direction Not
straight X and Y So is this 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


Re: [android-developers] Re: getting exception on updating ui?

2011-06-05 Thread Mark Murphy
Most media players have the MediaPlayer owned by a Service, to handle
this scenario, plus to allow the media to keep playing even after the
user presses HOME or otherwise leaves the app.

On Sun, Jun 5, 2011 at 3:10 PM, Hitendrasinh Gohil
 wrote:
>> Hi mark,
>>
>
>  thankx a lot i have resolve with the help of postdelayed.
>
> "3. Do not put a MediaPlayer in a static data member, as you appear to
> have done with LocalMediaPlayer. Static data members should be avoided
> where possible, and I fail to see why this case would be necessary."
>
> I have three classess i)list of songs ii)mediaplayer class that handles
> play,next,previous etc iii)playerview class on which there are buttons for
> next,play/pause and previous.
>
> I have used static mediaplayer because i can easily get the mediaplayer
> objects i.e  LocalMediaPlayer.mediaplayer.getDuration();
>
> if this is wrong way or not a better way then can u suggest me the best way?
>
>
>
>
>
>
>
> --
> 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 3.0 Programming Books: http://commonsware.com/books

-- 
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: Actionbar.DISPLAY_HOME_AS_UP causes activity to not call destroy, is this by design?

2011-06-05 Thread Mark Murphy
Reading your question, and with Honeycomb being relatively new, I
thought perhaps I had seriously screwed up how that "home affordance"
worked. Hence, I'm grateful that this is working for you.

On Sun, Jun 5, 2011 at 2:32 PM, Christer Nordvik  wrote:
> That's what I get for coding at night. I had forgotten that I had
> created my own base activity that had implemented starting a new
> Intent and no finish call.
>
> Sorry about that, and thanks for responding :-)
>
> -Christer
>
> On Jun 5, 1:31 am, Mark Murphy  wrote:
>> AFAIK, the top left icon has no effect, other than whatever effect you
>> apply yourself. Just marking it as "up enabled" does not cause Android
>> to somehow magically know how to handle that. Instead, you have to
>> override onOptionsItemSelected() and watch for android.R.id.home and
>> do something there.
>>
>> For example, in one of my activities that uses
>> setDisplayHomeAsUpEnabled(), I have:
>>
>>         @Override
>>         public boolean onOptionsItemSelected(MenuItem item) {
>>                 switch (item.getItemId()) {
>>                         case android.R.id.home:
>>                                 finish();
>>
>>                                 return(true);
>>                 }
>>
>>                 return(super.onOptionsItemSelected(item));
>>         }
>>
>> In this case, the flow is much like yours -- "up" equates to "back",
>> so I just finish() the current activity to make it happen.
>>
>> If you are using startActivity() with FLAG_ACTIVITY_REORDER_TO_FRONT
>> to go "home", that's not going to immediately destroy your original
>> activity, any more than any other startActivity() call does.
>>
>> So... what are you doing in onOptionsItemSelected()?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Sat, Jun 4, 2011 at 7:22 PM, Christer Nordvik  wrote:
>> > I have two activities.
>>
>> > 1. Home
>> > 2. Details
>>
>> > In the details activity I set:
>> >  ActionBar actionBar = this.getActionBar();
>> >  actionBar.setDisplayHomeAsUpEnabled(true);
>>
>> > and this causes the top left icon to act as a home button.
>>
>> > But what I hadn't anticipated was that the details activity isn't
>> > destroyed when pressing the home button. If I press the back button
>> > then the activity is destroyed.
>>
>> > Can anyone explain why the details activity isn't destroyed? Do I need
>> > to intercept the user clicking the home button and destroy the
>> > activity myself since I want to cleanup the image resources it uses...
>>
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Android Developers" group.
>> > To post to this group, send email to android-developers@googlegroups.com
>> > To unsubscribe from this group, send email to
>> > android-developers+unsubscr...@googlegroups.com
>> > For more options, visit this group at
>> >http://groups.google.com/group/android-developers?hl=en
>>
>> --
>> Mark Murphy (a Commons 
>> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>>
>> _The Busy Coder's Guide to Android Development_ Version 3.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
>



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

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

-- 
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] Bundle.putSerializable not calling custom writeObject(ObjectOutputStream) method?

2011-06-05 Thread Emanuel Moecklin
Hi Dianne

My custom serialization methods get called if I do the 
serialization/deserialization myself by writing/reading the object to/from a 
byte[].
If the same object is written using putSerializable the methods are NOT 
called. So my assumption is that the Bundle is never actually 
serialized/deserialized but just kept in memory?
So Android IS doing something to stop my code from working (or rather it 
doesn't do it although the docs don't say it's doing standard Java 
serialization, that's just something I would expect it to do).

Here's some sample code that will allow to follow my argumentation:

*public class SerializationActivity extends Activity {*
*
*
* public static class PersistentObject implements Serializable {*
* private static final long serialVersionUID = -8258412687839520234L;*
* private long id = (long) (Math.random() * 10);*
*private void writeObject(ObjectOutputStream out) throws IOException {*
* out.defaultWriteObject();*
* System.out.println("writeObject() called for: " + id);*
*}*
*private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {*
* in.defaultReadObject();*
* System.out.println("readObject() called for: " + id);*
*}*
*private void alive() {*
* System.out.println("I'm alive and my id is: " + id);*
*}*
* }*
* *
* private PersistentObject putSerializable = new PersistentObject();*
* private PersistentObject serializedObject = new PersistentObject();*
* *
* @Override protected void onCreate(Bundle savedInstanceState) {*
* super.onCreate(savedInstanceState);*
* if (savedInstanceState!=null) {*
* putSerializable = (PersistentObject) 
savedInstanceState.getSerializable("putSerializable");*
* putSerializable.alive();*
* serializedObject = (PersistentObject) deserializeObject((byte[]) 
savedInstanceState.getSerializable("serializedObject"));*
* serializedObject.alive();*
* }*
* }*
*
*
* @Override protected void onSaveInstanceState(Bundle outState) {*
* super.onSaveInstanceState(outState);*
* ** **System.out.println("onSaveInstanceState() called");*
* putSerializable.alive();*
* outState.putSerializable("putSerializable", putSerializable);*
* serializedObject.alive();*
* outState.putSerializable("serializedObject", 
serializeObject(serializedObject));*
* }*
*
*
* public byte[] serializeObject(Serializable s) {*
* try {*
*ByteArrayOutputStream baos = new ByteArrayOutputStream();*
* ObjectOutputStream oos = new ObjectOutputStream(baos);*
* oos.writeObject(s);*
* return baos.toByteArray();*
* } catch (IOException e) {*
* return null;*
* }*
* }*
*
*
* public Object deserializeObject(byte[] in) {*
* try {*
*ByteArrayInputStream bais = new ByteArrayInputStream(in);*
* ObjectInputStream ois = new ObjectInputStream(bais);*
* return ois.readObject();*
* } catch (Exception e) {*
* return null;*
* }*
* }*
*}*

Cheers
Emanuel Moecklin
1gravity LLC

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

[android-developers] Re: lg optimus freezing

2011-06-05 Thread gjs
Hi,

I'd guess it is a G2X, mine is just as bad, reboots regularly & also
won't start unless pop battery so can't use as day to day phone.

LG POS.

Regards

On Jun 5, 6:26 pm, Raghav Sood  wrote:
> I have an LG Optimus P500. It frezes quite often but that was because one of
> my apps had some bug in it. (I wrote it.) It never rebooted though. Which
> Optimus do you have?
>
>
>
>
>
>
>
>
>
> On Sat, Jun 4, 2011 at 11:51 PM, TreKing  wrote:
> > On Sat, Jun 4, 2011 at 12:57 PM, bob  wrote:
>
> >> I have an LG Optimus that I do dev work on, and it locks up and reboots
> >> itself about 3-5 times a day.  Anyone know how to make it stop doing that?
>
> > I would ...
>
> > 1 Uninstall apps, 1 by 1 in order of installation, until it stops to
> > identify if it's an app causing it.
> > 2 If that don't work, factory reset the device.
> > 3 If that don't work, contact LG support for a replacement.
>
> > --- 
> > --
> > TreKing  - Chicago
> > transit tracking app for Android-powered devices
>
> >  --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Raghav 
> Soodhttp://www.raghavsood.com/http://www.androidappcheck.com/http://www.telstop.tel/

-- 
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] Bundle.putSerializable not calling custom writeObject(ObjectOutputStream) method?

2011-06-05 Thread Dianne Hackborn
Well the object isn't actually serialized until it needs to be sent across
processes.

On Sun, Jun 5, 2011 at 4:05 PM, Emanuel Moecklin <1gravity...@gmail.com>wrote:

> Hi Dianne
>
> My custom serialization methods get called if I do the
> serialization/deserialization myself by writing/reading the object to/from a
> byte[].
> If the same object is written using putSerializable the methods are NOT
> called. So my assumption is that the Bundle is never actually
> serialized/deserialized but just kept in memory?
> So Android IS doing something to stop my code from working (or rather it
> doesn't do it although the docs don't say it's doing standard Java
> serialization, that's just something I would expect it to do).
>
> Here's some sample code that will allow to follow my argumentation:
>
> *public class SerializationActivity extends Activity {*
> *
> *
> * public static class PersistentObject implements Serializable {*
> * private static final long serialVersionUID = -8258412687839520234L;*
> * private long id = (long) (Math.random() * 10);*
> *private void writeObject(ObjectOutputStream out) throws IOException {
> *
> * out.defaultWriteObject();*
> * System.out.println("writeObject() called for: " + id);*
> *}*
> *private void readObject(ObjectInputStream in) throws IOException,
> ClassNotFoundException {*
> * in.defaultReadObject();*
> * System.out.println("readObject() called for: " + id);*
> *}*
> *private void alive() {*
> * System.out.println("I'm alive and my id is: " + id);*
> *}*
> * }*
> * *
> * private PersistentObject putSerializable = new PersistentObject();*
> * private PersistentObject serializedObject = new PersistentObject();*
> * *
> * @Override protected void onCreate(Bundle savedInstanceState) {*
> * super.onCreate(savedInstanceState);*
> * if (savedInstanceState!=null) {*
> * putSerializable = (PersistentObject)
> savedInstanceState.getSerializable("putSerializable");*
> * putSerializable.alive();*
> * serializedObject = (PersistentObject) deserializeObject((byte[])
> savedInstanceState.getSerializable("serializedObject"));*
> * serializedObject.alive();*
> * }*
> * }*
> *
> *
> * @Override protected void onSaveInstanceState(Bundle outState) {*
> * super.onSaveInstanceState(outState);*
> * ** **System.out.println("onSaveInstanceState() called");*
> * putSerializable.alive();*
> * outState.putSerializable("putSerializable", putSerializable);*
> * serializedObject.alive();*
> * outState.putSerializable("serializedObject",
> serializeObject(serializedObject));*
> * }*
> *
> *
> * public byte[] serializeObject(Serializable s) {*
> * try {*
> *ByteArrayOutputStream baos = new ByteArrayOutputStream();*
> * ObjectOutputStream oos = new ObjectOutputStream(baos);*
> * oos.writeObject(s);*
> * return baos.toByteArray();*
> * } catch (IOException e) {*
> * return null;*
> * }*
> * }*
> *
> *
> * public Object deserializeObject(byte[] in) {*
> * try {*
> *ByteArrayInputStream bais = new ByteArrayInputStream(in);*
> * ObjectInputStream ois = new ObjectInputStream(bais);*
> * return ois.readObject();*
> * } catch (Exception e) {*
> * return null;*
> * }*
> * }*
> *}*
>
> Cheers
> Emanuel Moecklin
> 1gravity LLC
>
>  --
> 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
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

[android-developers] Android Manifest Build Details in version string

2011-06-05 Thread MCON Dev
Hello,

I am wondering if there is a way to get a automated customized build
version name when I build a android application on eclipse. I need the
build to be like
"majorversion:minorversion DDMMHHMM"

I need a way to read the system date, time. Format it as DDMMHHMM"

Conny

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


[android-developers] Re: Fragment Compatibility support down to Android 1.1

2011-06-05 Thread Peli
Interestingly it seems to work (at least in the 1.1 and 1.5
emulators).
The compatibility library still contains references to AsyncTask which
is not available until 1.6, so it does not compile with 1.1 or 1.5,
but once compiled with 1.6 or higher it seems to load fine in 1.1 and
1.5.

Market statistics show that we have more than 8% of users running 1.5
for OI Shopping List, so we don't want to abandon them yet. (3.0 users
are <1% currently).

Peli

On 5 Jun., 21:14, Dianne Hackborn  wrote:
> Making it work on 1.5 and earlier is not actually so simple, because of the
> way the Dalvik class loader works on those versions.  The approach the
> library uses a lot for being able to call newer functions (having the calls
> in a separate class that is only used if running on the appropriate version)
> breaks prior to 1.6 because Dalvik will fail loading the app's dex file if
> it has any such references.
>
> Honestly I don't think messing with 1.5 or earlier is at all worth the time.
>
>
>
>
>
> On Sun, Jun 5, 2011 at 8:37 AM, Peli  wrote:
> > I've modified the "Android Compatibility support v4, revision
> > 2" (http://developer.android.com/sdk/compatibility-library.html)
> > slightly so that it can be used on Android 1.5 or Android 1.1 as well.
> > The only modification so far was to support Build.VERSION.SDK_INT on
> > versions earlier than 1.6.
>
> > The aim is not to port back all functionality, but at least not to let
> > an existing application crash in Android 1.1 or Android 1.5 if one
> > wants to use Fragments or other Honeycomb features.
>
> > This is work in progress, and we have not released a jar file yet. So
> > far it is only available via SVN as an Android Library Project that
> > can be included in any other project:
>
> >http://code.google.com/p/openintents/source/browse/#svn%2Ftrunk%2Fcom...
>
> > Feel free to use this in your projects, but beware that most of the
> > functions may actually not yet be compatible with Android 1.1 or
> > Android 1.5 (we only fixed what we needed so far). Feedback and
> > patches are welcome, to make this even more useful.
>
> > Peli
> >www.openintents.org
>
> > --
> > 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
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

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


Re: [android-developers] Re: Fragment Compatibility support down to Android 1.1

2011-06-05 Thread Dianne Hackborn
Well I didn't have this supporting 1.5 because it was causing failures when
Dalvik tried to load some classes.  You'll want to carefully test anything
you do.

On Sun, Jun 5, 2011 at 5:14 PM, Peli  wrote:

> Interestingly it seems to work (at least in the 1.1 and 1.5
> emulators).
> The compatibility library still contains references to AsyncTask which
> is not available until 1.6, so it does not compile with 1.1 or 1.5,
> but once compiled with 1.6 or higher it seems to load fine in 1.1 and
> 1.5.
>
> Market statistics show that we have more than 8% of users running 1.5
> for OI Shopping List, so we don't want to abandon them yet. (3.0 users
> are <1% currently).
>
> Peli
>
> On 5 Jun., 21:14, Dianne Hackborn  wrote:
> > Making it work on 1.5 and earlier is not actually so simple, because of
> the
> > way the Dalvik class loader works on those versions.  The approach the
> > library uses a lot for being able to call newer functions (having the
> calls
> > in a separate class that is only used if running on the appropriate
> version)
> > breaks prior to 1.6 because Dalvik will fail loading the app's dex file
> if
> > it has any such references.
> >
> > Honestly I don't think messing with 1.5 or earlier is at all worth the
> time.
> >
> >
> >
> >
> >
> > On Sun, Jun 5, 2011 at 8:37 AM, Peli  wrote:
> > > I've modified the "Android Compatibility support v4, revision
> > > 2" (http://developer.android.com/sdk/compatibility-library.html)
> > > slightly so that it can be used on Android 1.5 or Android 1.1 as well.
> > > The only modification so far was to support Build.VERSION.SDK_INT on
> > > versions earlier than 1.6.
> >
> > > The aim is not to port back all functionality, but at least not to let
> > > an existing application crash in Android 1.1 or Android 1.5 if one
> > > wants to use Fragments or other Honeycomb features.
> >
> > > This is work in progress, and we have not released a jar file yet. So
> > > far it is only available via SVN as an Android Library Project that
> > > can be included in any other project:
> >
> > >http://code.google.com/p/openintents/source/browse/#svn%2Ftrunk%2Fcom.
> ..
> >
> > > Feel free to use this in your projects, but beware that most of the
> > > functions may actually not yet be compatible with Android 1.1 or
> > > Android 1.5 (we only fixed what we needed so far). Feedback and
> > > patches are welcome, to make this even more useful.
> >
> > > Peli
> > >www.openintents.org
> >
> > > --
> > > 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
> >
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
> >
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see
> and
> > answer them.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

[android-developers] Re: GPS lat & long

2011-06-05 Thread JP

Lat and lon are projected to MapView's y and x coordinates, through
Projection.

On Jun 5, 3:53 pm, ingy abbas  wrote:
> The GPS Latitude and longitude is not ( x and y Direction ) ?Is it z
> direction ( slider some how )? When the map with overlay item appear
> on the mobile it seems like the overlay items are Z direction Not
> straight X and Y So is this 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


[android-developers] Re: Fragment Compatibility support down to Android 1.1

2011-06-05 Thread Zsolt Vasvari
The Market statistics chart for Platform versions haven't been updated
since they first made it available, so I wouldn't rely on that.   If
you don't believe me, count up the total and it should match the total
install count shown on the main page and on the top chart.

I know that this is the case as my # of Honeycomb installs are stuck
at 3, which I know is not the case as I have personally conversed with
more than 3 Honeycomb customers.



On Jun 6, 8:14 am, Peli  wrote:
> Interestingly it seems to work (at least in the 1.1 and 1.5
> emulators).
> The compatibility library still contains references to AsyncTask which
> is not available until 1.6, so it does not compile with 1.1 or 1.5,
> but once compiled with 1.6 or higher it seems to load fine in 1.1 and
> 1.5.
>
> Market statistics show that we have more than 8% of users running 1.5
> for OI Shopping List, so we don't want to abandon them yet. (3.0 users
> are <1% currently).
>
> Peli
>
> On 5 Jun., 21:14, Dianne Hackborn  wrote:
>
>
>
> > Making it work on 1.5 and earlier is not actually so simple, because of the
> > way the Dalvik class loader works on those versions.  The approach the
> > library uses a lot for being able to call newer functions (having the calls
> > in a separate class that is only used if running on the appropriate version)
> > breaks prior to 1.6 because Dalvik will fail loading the app's dex file if
> > it has any such references.
>
> > Honestly I don't think messing with 1.5 or earlier is at all worth the time.
>
> > On Sun, Jun 5, 2011 at 8:37 AM, Peli  wrote:
> > > I've modified the "Android Compatibility support v4, revision
> > > 2" (http://developer.android.com/sdk/compatibility-library.html)
> > > slightly so that it can be used on Android 1.5 or Android 1.1 as well.
> > > The only modification so far was to support Build.VERSION.SDK_INT on
> > > versions earlier than 1.6.
>
> > > The aim is not to port back all functionality, but at least not to let
> > > an existing application crash in Android 1.1 or Android 1.5 if one
> > > wants to use Fragments or other Honeycomb features.
>
> > > This is work in progress, and we have not released a jar file yet. So
> > > far it is only available via SVN as an Android Library Project that
> > > can be included in any other project:
>
> > >http://code.google.com/p/openintents/source/browse/#svn%2Ftrunk%2Fcom...
>
> > > Feel free to use this in your projects, but beware that most of the
> > > functions may actually not yet be compatible with Android 1.1 or
> > > Android 1.5 (we only fixed what we needed so far). Feedback and
> > > patches are welcome, to make this even more useful.
>
> > > Peli
> > >www.openintents.org
>
> > > --
> > > 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
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see and
> > answer them.- Hide quoted text -
>
> - Show quoted text -

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


[android-developers] Failed to register input channel?

2011-06-05 Thread Nikolay Elenkov
I've been getting this error a lot in ACRA lately. Seems it 
happens mostly when trying to display a Toast or a progress 
dialog. It is only happening on 2.3.3 so far, but across 
different devices. Any idea what can be causing this?

Here are some stacktraces:

java.lang.RuntimeException: Failed to register input channel.  Check logs 
for details.
at android.view.InputQueue.nativeRegisterInputChannel(Native Method)
at android.view.InputQueue.registerInputChannel(InputQueue.java:92)
at android.view.ViewRoot.setView(ViewRoot.java:575)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:203)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:117)
at android.widget.Toast$TN.handleShow(Toast.java:373)
at android.widget.Toast$TN$1.run(Toast.java:302)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)

java.lang.RuntimeException: Failed to register input channel.  Check logs 
for details.
at android.view.InputQueue.nativeRegisterInputChannel(Native Method)
at android.view.InputQueue.registerInputChannel(InputQueue.java:92)
at android.view.ViewRoot.setView(ViewRoot.java:575)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:203)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:117)
at android.view.Window$LocalWindowManager.addView(Window.java:424)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2174)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1672)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3691)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
at dalvik.system.NativeStart.main(Native Method)

java.lang.RuntimeException: Failed to register input channel.  Check logs 
for details.
at android.view.InputQueue.nativeRegisterInputChannel(Native Method)
at android.view.InputQueue.registerInputChannel(InputQueue.java:92)
at android.view.ViewRoot.setView(ViewRoot.java:572)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
at android.view.Window$LocalWindowManager.addView(Window.java:424)
at android.app.Dialog.show(Dialog.java:241)
at android.app.ProgressDialog.show(ProgressDialog.java:107)
at android.app.ProgressDialog.show(ProgressDialog.java:90)

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

[android-developers] Re: Advanced Memory Leak, What could be the cause/How to find it ?

2011-06-05 Thread albnok
(Apologies for double-post... Xoom Honeycomb browser crashed twice
upon posting!)

Also an edit to my previous post:
Click Histogram again and search for the extra objects. Right-click
and click "Merge Shortest Path to GC Roots" and look for the "exclude
all phantom/weak/soft etc. references".

You'll want to do the same for the 'fresh' Histogram and see who is
keeping your objects alive. The target is to make the total (at the
bottom) equal on both the fresh and 'after-routine' Histogram.

I have only used this on Android 2.2 and 3.0. It is good to test this
on as many versions as you have access to, as you may find that
certain builds may leak more objects than others (the Galaxy Tab stock
2.2 seems to leak a bit compared to CyanogenMod 7.0.0 on 2.3).

Also, while 3.0 has the very helpful ability to see that your Bitmaps
are leaking as byte[] objects, you can already see if your code is
leaking with 2.2. A leak doesn't have to have a large footprint
especially in 2.2 where a harmless-looking AsyncTask may leak Bitmaps
but show minimal memory use.


On Jun 6, 3:00 am, B Lyon  wrote:
> what version of android?
>
>
>
>
>
>
>
> On Sun, Jun 5, 2011 at 2:51 PM, albnok  wrote:
> > Comment everything out. Make a routine where you rotate and go in and
> > out of the activity. Start activity fresh, do hprof dump, do the
> > routine, get another dump. Click Histogram and click the right most
> > icon to compare to the fresh dump. You may spot some extra objects.
> > Click Histogram again and search for the extra objects. Right-click
> > and look for the "ignore phantom/weak/soft references" (not at
> > computer, don't remember exact menu). You may find orphaned objects
> > e.g. Matrix as a result of doing m = new Matrix() when you can reuse
> > with m.reset(). Aim for zero gain before uncommenting blocks of code
> > to find the leak(s).
>
> > On May 14, 12:38 am, olivier  wrote:
> > Comcommentment > Dears,
>
> >> I am metting an OutOfMemory exception after a while, while inflating
> >> an XML View with a bitmap.
>
> >> The problem occurs after opening many times activities that are using
> >> many bitmap but always inflated from the XML.
>
> >> I check with MAT the Memory.
> >> First question : I don't retain any of my Activity in memory - If I
> >> filter on the name of my Activity, i get Objects = 0, but on some
> >> activities I could see RetainedHeap >= 302. Does this indicate a
> >> leak ?
>
> >> After that, I try to compare my memory in different points of time, to
> >> see the objects that have been created. But I can't find any thing
> >> significant.
>
> >> My Question is : If I don't retain activities in memory what could be
> >> the leak reasons ?
> >> What tools/Method to use to find it ?
>
> >> Regards,
>
> >> Olivier
>
> > --
> > 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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] how to deal with details when using rtsp?

2011-06-05 Thread Hitendrasinh Gohil
Hi,

I m using rtsp for radio streaming and my problem is that i need to
show the track details associated with the currently playing song.
server sends the track details to the clients that are currently
connected at the begining of song.How can i handle this situation at
android client side?
I m able to play the stream related to particular artist,

-- 
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: Fragment Compatibility support down to Android 1.1

2011-06-05 Thread TreKing
On Sun, Jun 5, 2011 at 7:14 PM, Peli  wrote:

> The compatibility library still contains references to AsyncTask which is
> not available until 1.6, so it does not compile with 1.1 or 1.5, but once
> compiled with 1.6 or higher it seems to load fine in 1.1 and 1.5.
>

http://developer.android.com/reference/android/os/AsyncTask.html

Since: API Level 3 (which is 1.5)

-
TreKing  - Chicago
transit tracking app for Android-powered devices

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

Re: [android-developers] Re: A tricky but simple solution for who requires modal dialog

2011-06-05 Thread Qi Luo
On Mon, Jun 6, 2011 at 12:36 AM, Mark Murphy wrote:

> On Sun, Jun 5, 2011 at 12:28 PM, Qi Luo  wrote:
> > I've tried this, but I didn't figure out how to build a real dialog-like
> and
> > modal activity. Here's 2 issues I ran into,
> > 1. I created a dialog-themed activity, but the background of  it was
> always
> > black, and the main activity under it was totally invisible.
>
>
> http://android-coding.blogspot.com/2011/05/make-you-app-looked-like-dialog.html
>

I did try this way, Theme.Dialog style was applied. The above link seemed
perfect, but, when it was started as a sub-activity, it showed up at center
of screen, dialog appearance, but the rest of screen was totally black.
Some guys got same problem.
http://code.google.com/p/android/issues/detail?id=4394



>
> > 2. activity could be started and expect a result back, but there's no
> sync
> > response.
>
> You don't need "sync response".
>
--
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Android 3.0 Programming Books: http://commonsware.com/books
>
> --
> 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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] import error in AIDL, guessing Android.mk needs fixing.

2011-06-05 Thread maliha
Hi,

I am writing an aidl which will needs to use NetworkInfo from
com.android.internal.telephony.gsm.NetworkInfo,
I am using 'import com.android.internal.telephony.gsm.NetworkInfo' in
myService.aidl, I am able to generate the apk for my app but when I
try to build with the android source code i am getting the following
error: packages/apps/MyApp/src/com/example/myapplication/
myService.aidl:19: couldn't find import for class
com.android.internal.telephony.gsm.NetworkInfo.

My Android.mk (modified from the Android.mk of packages/apps/Phone) is
as follows
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_SRC_FILES += \
src/com/example/myapplication/myService.aidl
LOCAL_MODULE := com.example.myapplication
include $(BUILD_STATIC_JAVA_LIBRARY)
include $(CLEAR_VARS)
LOCAL_STATIC_JAVA_LIBRARIES := com.android.phone.common
LOCAL_JAVA_LIBRARIES := core framework
#maliha fix FRAMEWORKS_BASE_JAVA_SRC_DIRS comes from build/core/
pathmap.mk
LOCAL_AIDL_INCLUDES += $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_SRC_FILES += \
src/com/example/myapplication/myService.aidl
LOCAL_PACKAGE_NAME := MyApp
LOCAL_CERTIFICATE := platform
include $(BUILD_PACKAGE)
# Build the test package
include $(call all-makefiles-under,$(LOCAL_PATH))

what am i missing? I have tried a clean build multiple times.

Cheerio!
- Maliha.

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


[android-developers] Re: A tricky but simple solution for who requires modal dialog

2011-06-05 Thread Zsolt Vasvari
I can confirm Theme.Dialog works.  I use it in my own app without any
issue whatsoever.  The background activity is still visible dimmed.

On Jun 6, 12:55 pm, Qi Luo  wrote:
> On Mon, Jun 6, 2011 at 12:36 AM, Mark Murphy wrote:
>
> > On Sun, Jun 5, 2011 at 12:28 PM, Qi Luo  wrote:
> > > I've tried this, but I didn't figure out how to build a real dialog-like
> > and
> > > modal activity. Here's 2 issues I ran into,
> > > 1. I created a dialog-themed activity, but the background of  it was
> > always
> > > black, and the main activity under it was totally invisible.
>
> >http://android-coding.blogspot.com/2011/05/make-you-app-looked-like-d...
>
> I did try this way, Theme.Dialog style was applied. The above link seemed
> perfect, but, when it was started as a sub-activity, it showed up at center
> of screen, dialog appearance, but the rest of screen was totally black.
> Some guys got same 
> problem.http://code.google.com/p/android/issues/detail?id=4394
>
>
>
>
>
>
>
> > > 2. activity could be started and expect a result back, but there's no
> > sync
> > > response.
>
> > You don't need "sync response".
>
> --
> > Mark Murphy (a Commons Guy)
> >http://commonsware.com|http://github.com/commonsguy
> >http://commonsware.com/blog|http://twitter.com/commonsguy
>
> > Android 3.0 Programming Books:http://commonsware.com/books
>
> > --
> > 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- Hide quoted text -
>
> - Show quoted text -

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


[android-developers] Monetize Your Android App and Maximize Your Reach

2011-06-05 Thread OrenTodoros
Hi Group

Oren Todoros here, Online Marketing Strategist at the AppSnips, part
of the Logia Group.

I'd like to introduce you to an effortless solution that will help
you
generate more revenue from your Android apps.

The advanced tools and extensive distribution channels that AppSnips
offers for Android apps allow you to start marketing and monetizing
your apps better than ever before.

The AppSnips solutions include:
In-app payment engine - Choose the payment model most suitable to
your
titles, whether it is subscription, freemium, trial version, virtual
goods purchasing or other, and improve you games monetization ability
by 10x times or more!

Operator billing (SMS and Direct Billing) - proven to increase sales
significantly.
Paypal - Why only stick to Google Checkout!?

Not to mention our significant distribution methods which we'd love
to
tell you about.

Share a comment on this thread or reach us directly at - http://www.appsnips.com

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


[android-developers] Mix audio files

2011-06-05 Thread neha
hi

Is there nay way to mix two or more audio files.

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


[android-developers] Re: Activity lifecycle: invoking finish

2011-06-05 Thread albnok
If you've noticed, cleaning stuff up let's say clearing a bitmap or
nulling an image before you call another activity will result in a
temporary blanking out. So onDestroy has to happen after the next
activity is fully drawn. If you use 14mb in Activity A and 14mb in
Activity B on a 16mb heap device you will run out of memory. I use
android:process in the manifest to get around this.


On May 11, 11:12 pm, Vikram  wrote:
> This seems to be the order.
>
> B.onPause() -> A.onStart() -> A.onResume() ->B.onStop() -
>
> >B.onDestroy().
>
> which makes sense!
>
> On May 12, 10:43 am, Vikram  wrote:
>
>
>
>
>
>
>
> > I have two activities A and B. A is in the stopped mode and B is
> > running. When I invoke finish() on B, A.onStart() and A.onResume() are
> > being invoked before B.onStop() and B.onDestroy().
>
> > Is this normal behavior? I find this a little strange! I want to
> > cleanup stuff before I hand over control to B.

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


[android-developers] How can I get app ratings to display on my website?

2011-06-05 Thread Spiderfly Studios
I've seen a lot of sites that display app ratings and comments, but
how?  I would like to display that info on my website, but I can't
find the info on how to do so anywhere.  It would be great if there
were a simple WordPress plugin to do so, but there isn't.  So I'm left
to try an figure out how to hard code it.  There doesn't seem to be
anything Market dev info on how to do so.

Any ideas?

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


[android-developers] [SOLVED] startActivityForResult does not return control to calling Activity

2011-06-05 Thread Anirvan
hello,

i found the source of my troubles - it was to do with the manifest
setting. i had set the "android:noHistory" attribute to true for the
tab activity from which i launched the other activity.

lesson learnt :]

On Jun 6, 1:25 am, Anirvan  wrote:
> i have a tab layout. in one of the Activity's corresponding to a tab,
> i use "startActivityForResult" to launch another activity to do
> something. Once the tasks in the new activity are done, i invoke the
> "finish()" method to return to the tab Activity which launched it.
>
> strangely enough, when the new activity is finished, instead of
> showing the tab activity which launched it, the entire app simply
> exits. in the tab activity class i've overriden the "onActivityResult"
> method, and have a log statement right at the start. This log
> statement does not get printed.
>
> so the gist of the problem is that when i launch an activity for
> result, and then finish it, the control does not return back to the
> activity which launched the other one - instead the app exits.
>
> is there some elementary mistake that i'm making here?
> thanks for your time.

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


[android-developers] Bluetooth encryption technique in android

2011-06-05 Thread manish
Dear All
 I want to set the encryption key size for Bluetooth in Android,
but not able to find the files where the exact encryption happens . I
have seen that BluetoothSocket class does take "encryption" as a
boolean argument in constructor, but when i followed it to the JNI
layer, found that it just makes system call of "setsockopt" with param
"SYS_SETSOCKOPT". But in kernel code i was not able to find the place
where its happening. If anyone have idea where the actual encryption
happens for Bluetooth and what is the key size used for encryption
then please answer.

Thanks in advance.

Thanks & Regards
Manish

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


[android-developers] How to rectify Transformer exception

2011-06-05 Thread HariRam
Hi guys,
I am doing application with parsing XML file. I used TransformerFactory to
modify XML file. when i use TransformerFactory in android 2.2 version its
working fine, at the same time when using TransformerFactory in android
version 2.1 i am getting Transformer exception. Can anybody know how to
rectify transformer exception

-- 
Thanks and
Regards
Hariram

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

[android-developers] Installing platforms without internet access

2011-06-05 Thread Raghav Sood
Hi,

In a few days time I will be going to my grandparents house which does not
have an internet connection. Over there my new laptop (Macbook Pro)
 will be sent to me. I am taking the android starter package, eclipse and
adt plugin with me on my pendrive. Is there any way to download and keep the
android sdk platforms on my pendrive so that they can be installed offline
later? Also, are the platform files the same on mac and linux (like the adt
plugin has the same file to be installed into eclipse on all oses.)

Thanks
-- 
Raghav Sood
http://www.raghavsood.com/
http://www.androidappcheck.com/
http://www.telstop.tel/

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

[android-developers] Re: How to rectify Transformer exception

2011-06-05 Thread Zsolt Vasvari
Sure, you look at the exception and its stack trace.  Then try to
determine, using various debugging tools at your disposal, what in
your code could be causing the problem.

That will be $50 which you can PayPal to me.



On Jun 6, 2:27 pm, HariRam  wrote:
> Hi guys,
> I am doing application with parsing XML file. I used TransformerFactory to
> modify XML file. when i use TransformerFactory in android 2.2 version its
> working fine, at the same time when using TransformerFactory in android
> version 2.1 i am getting Transformer exception. Can anybody know how to
> rectify transformer exception
>
> --
> Thanks and
> Regards
> Hariram

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