[android-developers] Re: Android: Get Recently used Apps

2011-04-27 Thread Goodwin
Add the following.


On 4月27日, 下午9时14分, Simon  wrote:
> Hello!
>
> I need a little bit help getting information about the last lets say 5
> application that was opened/used.
>
> ActivityManager m =
> (ActivityManager)this.getSystemService(ACTIVITY_SERVICE);
> RecentTaskInfo task = m.getRecentTasks(5,0).get(0);
>
> Then i used:
>
> String output  = "the last application you've executed is '"+task.id
> +"' and the PID is '"+task.toString()+"'";
> But it didnt work out well. I think im on the right track with
> ActivityManager to track the latest app.
>
> Thank you!
>
> And ye i only need to get enough information so i can run/start them
> later.
>
> //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] Phone for development

2011-04-27 Thread Pepijn Van Eeckhoudt
I agree with that review. As I already said in the set of devices I have 
available, that one's my 'favorite'.


A couple of my colleagues have one for personal use as well and are very 
happy with it. BTW, there's also a revamped 'S' version of the desire 
which is a gingerbread device. It's probably a bit more expensive than 
the regular desire though.


Pepijn

On 27/04/2011 22:22, Tommy wrote:


Here is engadgets review of the desire... 
http://www.engadget.com/2010/04/01/htc-desire-review/


Accoding the the last section called "Wrap-up" the first paragraph reads:

The Desire is yet another fine piece of work from HTC -- build quality 
is top notch as usual, and there's little to complain about the 
software except for the Flash performance. Some may argue that the 
Desire lacks freshness since the Nexus One's already shown it all, but 
we'd disagree -- at the end of the day it's mainly about the software 
andservice 
, 
plus the Desire is available from more carriers to begin with (outside 
the US, anyway).


If I were looking into buy the phone given the review I wouldn't feel 
bad about buying it, but that's me.


*From:*android-developers@googlegroups.com 
[mailto:android-developers@googlegroups.com] *On Behalf Of *Raghav Sood

*Sent:* Wednesday, April 27, 2011 1:42 PM
*To:* android-developers@googlegroups.com
*Subject:* Re: [android-developers] Phone for development

Thanks.

Is the Desire a good choice?

On Wed, Apr 27, 2011 at 10:31 PM, Tommy > wrote:


I would HIGHLY recommend HTC THEY ARE BEAUTIFUL PHONES! One of my 
phones is the HTC Aria I use for development and my main personal 
phone Great phones. An example My wife threw a pair of paints 
at me as hard as she could (we were playing around she wasn't trying 
to kill me) but she didn't know my HTC was in my pocket... Well the 
pants missed me by a mile(probably b/c she is a girl J) and hit the 
oak bed back I heard the phone hit and just assumed the phone was 
trashed... It hit really hard... The only thing that happened was the 
case popped off... No cracks... no breaks... Phone still works like it 
did when it was knew


I recommend HTC to anyone and everyone until they show me they don't 
deserve to be recommended.


*From:*android-developers@googlegroups.com 
 
[mailto:android-developers@googlegroups.com 
] *On Behalf Of *Raghav Sood

*Sent:* Wednesday, April 27, 2011 11:35 AM


*To:* android-developers@googlegroups.com 



*Subject:*Re: [android-developers] Phone for development

Thanks Pepijn. That helps a lot. I'll most probably do with a HTC now.

Thanks everyone.

On Wed, Apr 27, 2011 at 8:45 PM, Pepijn Van Eeckhoudt 
mailto:pep...@vaneeckhoudt.net>> wrote:


On 27/04/2011 16:12, Raghav Sood wrote:

Okay. I'll check that out. Still can someone suggest a reasonably 
priced android 2.2 or above phone?

Thanks

Since no one's giving you any advice I'll give it a try ;)

The dev phones I use myself are Motorola Milestone XT720, HTC Desire, 
Samsung Galaxy S and a Google Nexus S; one for each OS revision. I 
know these are all high-end devices, but I can try to extrapolate my 
experience with those.
Objectively, they're all fairly similar for development purposes. I 
don't use these phones for anything besides testing so I can't comment 
on any Android customizations each vendor might have made. 
Subjectively, I prefer the HTC the most in terms of feel and build 
quality. HTC seems to do a pretty good with their OS updates as well 
and they actually use OTA updates rather than requiring some buggy 
proprietary tool.


If you stick with HTC the only model they seem to have in the 230 euro 
/ Rp. 15000 price range is the wildfire. The wildfire is listed in 
Belgium at 229 euro and the wildfire S at 289 euro. The first one is a 
Froyo device, the second one Gingerbread.


I don't know about the specific Samsung model you mentioned, but the 
Galaxy and Nexus are pretty good too FWIW. The only downsides to 
Samsung IMO is that you have to use Kies to perform upgrades which can 
be a pain and they feel rather flimsy, plasticy. The HTC has a 
sturdier feel to it.


Hope this helps,

Pepijn




--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to 
android-developers@googlegroups.com 


To unsubscribe from this group, 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 t

[android-developers] GMaps launching problem

2011-04-27 Thread kaushik p
on click of a button i am launching googlemaps , on which the current
location of the user is present . But my application crashes each time i
click the button . Please help me solve this problem


public void launchmaps() {
Intent i = new Intent(this,com.kaushik.android.ShowMap.class);
Toast.makeText(getBaseContext(), "loading of  map under process...
 ",
Toast.LENGTH_SHORT).show();
startActivity(i);
}
-- 
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

[android-developers] Re: car dock mode

2011-04-27 Thread mort
On 27 Apr., 21:24, Dianne Hackborn  wrote:
> Um.  This API was introduced in Froyo/2.2 (that is API 8).

Oops, sorry, mixed up the version numbers... :o

> ACTION_DOCK_EVENT is about the device being placed in a dock.  Calling that
> API puts the device in to car mode, but that doesn't cause it to be placed
> in to a dock.

OK. I think this separation between "dock mode" and "dock event" is a
bit confusing, I expected those to belong together, even if only
"emulated". But of course there might be situations where this
separation is useful...

So if I understood this correctly:
ACTION_DOCK_EVENT is for apps that want to respond to "real" dock
changes, like showing some activity, notification, or toast. It's
supported since Android 2.0, and can't be emulated since 2.2.
UiModeManager and Configuration.uiMode allow to query the current
mode, which is the way to go if the app should e.g. show different
layouts depending on the dock mode, but only exists since Android 2.2.
UiModeManager also allows to (de)activate the car mode.
Right?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: javax.xml.bind.annotation.XmlAccessType and Android

2011-04-27 Thread Robert Massaioli
I know it has been a while but in case you wanted a JAXB replacement in 
Android you should use the Simple 
library: 
http://massaioli.homelinux.com/wordpress/2011/04/21/simple-xml-in-android-1-5-and-up/

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

[android-developers] is there anyone using spotify?

2011-04-27 Thread Hitendrasinh Gohil
hi,

In spotify there are offline playlist mode in which it stores songs on
sdcard in number of chunks.and if we select a particular chunk with
renamed extension .mp3 it cant be played even with spotify.

so can anyone tell me how it works?

is there any encryption or any game with id3 header or something else?

regards,
hitendrasinh gohil

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] How is your app selling on the Amazon Appstore?

2011-04-27 Thread Nikolay Elenkov
On Thu, Apr 28, 2011 at 2:16 PM, Zsolt Vasvari  wrote:
> Mine started out very slow, but has picked up some steam lately.  It's
> still too few downloads to establish a pattern, but it's something for
> nothing, so I can't complain.
>
> How is your experience?
>

Very slow. It took ages (2-3 weeks?, can't be sure because there is
no timeline for status changes) to get approved. Hopefully updates
will get approved faster. Not exactly 'something for nothing', because
I had to create a separate build for the Amazon store since my app links
to another app, and I had to disable that until the other app is approved,
which only happened a few days ago. Now I have to replace Android
market links with Amazon links and release an update.

All three apps are free, but maybe the problem is that the Amazon
store is US only, and my apps are mostly popular in Asia. On the
other hand, the reference category has less than 100 apps, so
less competition :)

To sum up, I'm still not convinced that publishing to Amazon is
worth the trouble. Since it's free for a year, there's still some time
to see what happens.

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


[android-developers] What exactly happens during an upgrade?

2011-04-27 Thread Robert Macaulay
I have Acra in my app to report on crashes(I will be removing it in
favor of the market one soon). I've recently changed the form that it
posts to during an upgrade(so the new app version will post to the new
form, the old version will remain on the old form). However, I've
witnessed old code, throwing an exception about resources being null,
being reported to the new form. Acra attaches an uncaughtException
Handler to the application class. In this case, since I've switched
destination forms, it implies that Android is replacing the code in
place in the same process.  The exceptions I get are in the old code,
usually accessing resources from the context.

An example is:
onCreate() in my launch activity sets up a tab host. It assigns a
selectorDrawable to the tab(an xml resource, referring to 2 valid png
files, all in the drawable directory). It gets a ResourceNotFound
Exception - stack trace at the end. The line numbers indicate it is
being thrown in old code. However, the user has installed the new
version since I see the exception on the new form. It seems that there
is a race condition during upgrades where pieces of the old app are
still around while the new one is being placed in.

I've also seen very similar things in a Service that has an AsyncTask
that gets the AppWidgetManager.getInstance(this). In this case, it
throws an NPE in there - stack also at end..

In the end, a solution would be to enforce a new process for the new
instance of the app. Is this possible? If that is what happens, how is
the code being mingled at runtime? Could the user be launching my app
while it is "installing", and thus get pieces of the old one still?

Thanks
Robert

Stack trace showing the tab host failure:
Caused by: android.content.res.Resources$NotFoundException: File
res/drawable/ic_tab_alert.xml from drawable resource ID #0x7f020010
at android.content.res.Resources.loadDrawable(Resources.java:1725)
at android.content.res.Resources.getDrawable(Resources.java:590)
at com.zomut.watchdog.library.Main.onCreate(Main.java:168)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2701)
... 11 more
Caused by: java.lang.NullPointerException
at 
android.graphics.drawable.DrawableContainer$DrawableContainerState.addChild(DrawableContainer.java:349)
at 
android.graphics.drawable.StateListDrawable$StateListState.addStateSet(StateListDrawable.java:265)
at 
android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:796)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:737)
at android.content.res.Resources.loadDrawable(Resources.java:1722)
... 15 more

Stack trace showing the AppWidget.getInstance() failure:
java.lang.NullPointerException
   at android.appwidget.AppWidgetManager.(AppWidgetManager.java:230)
   at 
android.appwidget.AppWidgetManager.getInstance(AppWidgetManager.java:221)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] JSon parsing has been taking more time on Android

2011-04-27 Thread imran ali
Hi all,
i have big data approx 10MB, that i have to parse and save in to
database of db4o.
i have been downloading date and making it in to string then i am
parsing and
setting all values of class object, that object i have been saving in
to db4o.

the above process has been taking more time, to parse and save one
object it has been
taking approx 10 sec.

i want to reduce parsing time, how can i achieve on android? same
thing on iPhone has been taking less time.

is there any json parser that has been taking input-stream in spite of
String to make Json Object?


Regards
Imran ali

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Obtaining access to the surfaceView instance

2011-04-27 Thread Dianne Hackborn
You need to create it in the activity.

On Thu, Apr 28, 2011 at 12:30 AM, droid-stricken  wrote:

> Thanks.
> So, any idea on how to associate the view created in the activity with
> the mediaplayer instance created in the service.
> It's not an issue for playing audio files but for video files, i need
> a surface to render it :(
>
> I am sure ppl must have faced this issue - it appears pretty commonly,
> i believe.
> Thanks.
>
>
> On Apr 27, 11:18 pm, Dianne Hackborn  wrote:
> > You can't do this from a service.  A service is not associated with a UI.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On Thu, Apr 28, 2011 at 12:15 AM, droid-stricken 
> wrote:
> > > Hi,
> >
> > > I have an activity -
> > > public class mainActivity extends Activity {
> >
> > >  private SurfaceView sv;
> >
> > >  @Override
> > >  public void onCreate(Bundle savedInstanceState) {
> > >  sv = (SurfaceView) findViewById(R.id.video_surface);
> >
> > > .
> > >  }
> > > }
> >
> > > I have a service -
> >
> > > public class VideoService extends Service {
> >
> > >  private static MediaPlayer mPlayer;
> >
> > >@Override
> > >public void onCreate() {
> > >super.onCreate();
> > >mPlayer = new MediaPlayer();
> > >SurfaceHolder holder = ((SurfaceView)
> > > findViewById(R.id.video_surface)).getHolder();
> > >player.setDisplay(holder);
> > >}
> > > }
> >
> > > Is this a correct way to set the surface holder for the video
> > > mediaplayer?
> >
> > > If yes, the problem is i cannot do findViewById from within the
> > > service class. Any idea how to solve that part?
> >
> > > I wish the mediaplayer instance to be part of the service so that any
> > > activity can issue play/pause commands and the service will execute
> > > the activities command.
> >
> > > Please help.
> >
> > > 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
> >
> > --
> > 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

Re: [android-developers] Re: Activity Lifecycle Documentation Question

2011-04-27 Thread Dianne Hackborn
Yes if you call finish() you are saying you want to completely remove the
activity from the stack.  The system can have the activity destroyed in the
same way, but just not remove it from the stack it maintains.

At the end of the day, it would be fundamentally broken if there was a way
for an activity to stop being used in a process without being destroyed.
 This means it would be IMPOSSIBLE to write a correctly working application.
 I agree you can find parts of the documentation to help you convince
yourself that there are cases this can happen, if that is what you are
looking for.  But it won't.  Because it would be broken.  As I think is
already obvious to you, since your original question was basically: "if I
read the documentation this way then there is nothing useful at all about
onDestroy() or onStop() because they won't get called when they need to be."
 Right.  So don't try to read the documentation in a way that makes it
broken.

You are welcome to contribute changed to the documentation for people to
review if there are things you think can be improved.

On Thu, Apr 28, 2011 at 12:29 AM, Eric  wrote:

>
>
> On Apr 28, 12:21 am, Dianne Hackborn  wrote:
> > "Asking it to finish" means finishing the activity, which means
> destroying
> > it.  Politely asking it to finish isn't going to cause it to just not
> > cleanly exit.  It would be fundamentally broken if activities every just
> > stop being used in their process without actually going through the
> > lifecycle.
> >
> > In other words "asking to finish" -> Activity.finish() -> does what you
> > expect.
>
> Ok, so when I 'finish' an Activity programmatically, never wanting it
> to show up in the Task stack again, how does the system know to remove
> my Activity from the back stack in that case, but it doesn't remove it
> from the stack when the system asks it to finish due to low memory
> conditions?
>
> Also, the documentation for onDestroy() adds to the confusion a bit:
>
> "Called before the activity is destroyed. This is the final call that
> the activity will receive. It could be called either because the
> activity is finishing (someone called finish() on it), or because the
> system is temporarily destroying this instance of the activity to save
> space. You can distinguish between these two scenarios with the
> isFinishing() method."
>
> Note that it says if the Activity is being temporarily discarded to
> save space, then the 'isFinishing' method will return false.  If
> Android is simply calling 'finish' to temporarily discard the
> Activity, as you state, then is it explicitly setting 'isFinishing()'
> flag back to false (assuming the call to finish() automatically sets
> it to true; because if it didn't, then when I programmatically call
> 'finish()' to permanently finish the Activity, the flag would probably
> never get set)?
>
> - 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
>



-- 
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] How is your app selling on the Amazon Appstore?

2011-04-27 Thread Zsolt Vasvari
Mine started out very slow, but has picked up some steam lately.  It's
still too few downloads to establish a pattern, but it's something for
nothing, so I can't complain.

How is your experience?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Developer console: payments not charged, application statistics not updated

2011-04-27 Thread Zsolt Vasvari
> Hopefully Google will soon get around to updating my paid app
> statistics, and it won't languish at the bottom of its category
> forever. Or I have just wasted a couple of months work. One or the
> other.

Up until a couple of weeks ago, the updates to the download stats were
updated once a day, every 2 days max.  But there has been nothing
since.

Pssst, let's not tell Google and see how long it will take before
somebody takes a notice.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Canvas draw outside the bitmap.

2011-04-27 Thread a a
Another question, Is it possible that new(create) several canvas on
the screen at one time?

2011/4/28 Romain Guy :
> You cannot draw outside of a bitmap and see it... since it's outside. You
> can apply a transform on the Canvas to bring the text back in View (for
> instance, do translate(-120, 0) then drawText(120, 0) will be like drawing
> text at 0,0).
>
> On Wed, Apr 27, 2011 at 10:00 PM, a a  wrote:
>>
>> Yes, it can see nothing. I wan't to draw the text outside and can see it.
>>
>> 2011/4/28 Romain Guy :
>> > You can draw outside, but nothing will happen.
>> >
>> > On Wed, Apr 27, 2011 at 9:52 PM, a a  wrote:
>> >>
>> >> Dear All,
>> >>
>> >> The Canvas class holds the "draw" calls. To draw something, you need 4
>> >> basic components: A Bitmap to hold the pixels, a Canvas to host the
>> >> draw calls (writing into the bitmap), a drawing primitive (e.g. Rect,
>> >> Path, text, Bitmap), and a paint (to describe the colors and styles
>> >> for the drawing).
>> >>
>> >> Above is google SDK document.
>> >> --
>> >>
>> >> I have a question, I have a small bitmap (50 * 60), init the canvas
>> >> with this bitmap. Can we only draw text on this scope(50*60)?
>> >>
>> >> How can we draw outside this bitmap(50*60) ?
>> >>
>> >> I try the canvas.clipRect(0, 0, 512, 512); and want to draw at (100,
>> >> 150), but it can't work.
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups "Android Developers" group.
>> >> To post to this group, send email to
>> >> android-developers@googlegroups.com
>> >> To unsubscribe from this group, send email to
>> >> android-developers+unsubscr...@googlegroups.com
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/android-developers?hl=en
>> >
>> >
>> >
>> > --
>> > Romain Guy
>> > Android framework engineer
>> > romain...@android.com
>> >
>> > Note: please don't send private questions to me, as I don't have time to
>> > provide private support.  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
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support.  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

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Developer console: payments not charged, application statistics not updated

2011-04-27 Thread Maps.Huge.Info
> I launched my first paid app 5 days ago. It still shows zero downloads

Don't worry too much about this. Once they do get around to actually
processing the last nine days of data your app will float up to where
it should be. My free app "Radar Now!" has had nearly 70,000 downloads
in that time and hasn't updated either. What's a drag about this is
I'm hoping it will cross the one million active user count and I
haven't been able to see that happen because of this delay in
processing. Not a big deal but it's an important milestone in the life
of my app.

-John Coryat

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: First Application Development

2011-04-27 Thread Peter Webb
Messages?

You mean email? You mean instant messaging? You mean SMS? You mean via
bluetooth? You mean via direct sockets connections? You mean via
Facebook/Twitter etc APIs ?

These are all completely different problems, and would be solved in
very different ways.

What are you really trying to do, and why? If this is just some random
problem you picked for fun, and you are new to applications
development, my advice would be to find a simpler and better defined
problem to start on.




On Apr 28, 2:30 am, arpit  wrote:
> I am new in this app development field,
> I have decided to make a simple application regarding messaging, i.e.
> just send and receive messages..
> so can u help me out in this.. how the messages are sent from one
> device to another..?? or do i have to stay on sending message from one
> emulator to another.??
> what are the overall requirements??(i've fully installed eclipse and
> integrated android too)..
> any particular book having a vast information on messaging services
> and android "Telephony" package...

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Canvas draw outside the bitmap.

2011-04-27 Thread Romain Guy
You cannot draw outside of a bitmap and see it... since it's outside. You
can apply a transform on the Canvas to bring the text back in View (for
instance, do translate(-120, 0) then drawText(120, 0) will be like drawing
text at 0,0).

On Wed, Apr 27, 2011 at 10:00 PM, a a  wrote:

> Yes, it can see nothing. I wan't to draw the text outside and can see it.
>
> 2011/4/28 Romain Guy :
> > You can draw outside, but nothing will happen.
> >
> > On Wed, Apr 27, 2011 at 9:52 PM, a a  wrote:
> >>
> >> Dear All,
> >>
> >> The Canvas class holds the "draw" calls. To draw something, you need 4
> >> basic components: A Bitmap to hold the pixels, a Canvas to host the
> >> draw calls (writing into the bitmap), a drawing primitive (e.g. Rect,
> >> Path, text, Bitmap), and a paint (to describe the colors and styles
> >> for the drawing).
> >>
> >> Above is google SDK document.
> >> --
> >>
> >> I have a question, I have a small bitmap (50 * 60), init the canvas
> >> with this bitmap. Can we only draw text on this scope(50*60)?
> >>
> >> How can we draw outside this bitmap(50*60) ?
> >>
> >> I try the canvas.clipRect(0, 0, 512, 512); and want to draw at (100,
> >> 150), but it can't work.
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "Android Developers" group.
> >> To post to this group, send email to
> android-developers@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> android-developers+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >> http://groups.google.com/group/android-developers?hl=en
> >
> >
> >
> > --
> > Romain Guy
> > Android framework engineer
> > romain...@android.com
> >
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support.  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
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  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] Canvas draw outside the bitmap.

2011-04-27 Thread a a
Yes, it can see nothing. I wan't to draw the text outside and can see it.

2011/4/28 Romain Guy :
> You can draw outside, but nothing will happen.
>
> On Wed, Apr 27, 2011 at 9:52 PM, a a  wrote:
>>
>> Dear All,
>>
>> The Canvas class holds the "draw" calls. To draw something, you need 4
>> basic components: A Bitmap to hold the pixels, a Canvas to host the
>> draw calls (writing into the bitmap), a drawing primitive (e.g. Rect,
>> Path, text, Bitmap), and a paint (to describe the colors and styles
>> for the drawing).
>>
>> Above is google SDK document.
>> --
>>
>> I have a question, I have a small bitmap (50 * 60), init the canvas
>> with this bitmap. Can we only draw text on this scope(50*60)?
>>
>> How can we draw outside this bitmap(50*60) ?
>>
>> I try the canvas.clipRect(0, 0, 512, 512); and want to draw at (100,
>> 150), but it can't work.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support.  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

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Developer console: payments not charged, application statistics not updated

2011-04-27 Thread Peter Webb
My free app just caught up with about where it should be, after 9 days
without an update.

I launched my first paid app 5 days ago. It still shows zero downloads
(even though people are obviously downloading it and paying for it).
As a result, my paid app doesn't even make it to the top 800 in its
category; that bogus 0/0 rating has forced it to the bottom of the
list.

This is all rather demoralising.

Hopefully Google will soon get around to updating my paid app
statistics, and it won't languish at the bottom of its category
forever. Or I have just wasted a couple of months work. One or the
other.

Peter Webb


On Apr 27, 3:46 am, burnayev  wrote:
> The payments for my application (ActionComplete Pro) sit in a limbo
> (the Charge button is grayed out) since April 24. Typically it took a
> few hours before an order would come through and Charge button would
> be replaced by Archive.
>
> The application statistics for both ActionComplete and ActionComplete
> Pro has not been updated for a while. I'm not sure if it stopped
> updating at the same time when the payment issue occurred or at a
> different time.
>
> What's going on?
>
> Kind regards,
> Borys Burnayev
> actioncomplete.com
> GTD for Android and Web

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Canvas draw outside the bitmap.

2011-04-27 Thread Romain Guy
You can draw outside, but nothing will happen.

On Wed, Apr 27, 2011 at 9:52 PM, a a  wrote:

> Dear All,
>
> The Canvas class holds the "draw" calls. To draw something, you need 4
> basic components: A Bitmap to hold the pixels, a Canvas to host the
> draw calls (writing into the bitmap), a drawing primitive (e.g. Rect,
> Path, text, Bitmap), and a paint (to describe the colors and styles
> for the drawing).
>
> Above is google SDK document.
> --
>
> I have a question, I have a small bitmap (50 * 60), init the canvas
> with this bitmap. Can we only draw text on this scope(50*60)?
>
> How can we draw outside this bitmap(50*60) ?
>
> I try the canvas.clipRect(0, 0, 512, 512); and want to draw at (100,
> 150), but it can't work.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  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: android set top boxes

2011-04-27 Thread Eric Wong (hdmp4.com)
Do you mean Android set box from Google or from 3rd party China
manufacturer?

On Apr 26, 3:20 pm, kaushik p  wrote:
> Hi ,
>
> Is there there anyone here who  is working on android set top boxes ? I need
> some information on that .May i know the availability of the hardware ??
>
> --
> 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


[android-developers] Canvas draw outside the bitmap.

2011-04-27 Thread a a
Dear All,

The Canvas class holds the "draw" calls. To draw something, you need 4
basic components: A Bitmap to hold the pixels, a Canvas to host the
draw calls (writing into the bitmap), a drawing primitive (e.g. Rect,
Path, text, Bitmap), and a paint (to describe the colors and styles
for the drawing).

Above is google SDK document.
--

I have a question, I have a small bitmap (50 * 60), init the canvas
with this bitmap. Can we only draw text on this scope(50*60)?

How can we draw outside this bitmap(50*60) ?

I try the canvas.clipRect(0, 0, 512, 512); and want to draw at (100,
150), but it can't work.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 set top boxes

2011-04-27 Thread Zsolt Vasvari
It doesn't matter.  There is no public SDK available for the Google
TV, so this is not the right forum to discuss any issues with it.


On Apr 28, 12:36 pm, "Eric Wong (hdmp4.com)" 
wrote:
> Do you mean Android set box from Google or from 3rd party China
> manufacturer?
>
> On Apr 26, 3:20 pm, kaushik p  wrote:
>
>
>
> > Hi ,
>
> > Is there there anyone here who  is working on android set top boxes ? I need
> > some information on that .May i know the availability of the hardware ??
>
> > --
> > Thanks&Regards
> > Kaushik Pendurthi
>
> >http://kaushikpendurthi.blogspot.com/- 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: Maintain session over 3g and wifi

2011-04-27 Thread seema
Hi,

  You need to have a mobility protocol running on your android phone
for doing this.
There are protocols which maintains the session when the interfaces
are changed.

Check this...
http://hipl.hiit.fi/hipl/manual/ch02s07.html

Regards,
Seema


On Apr 27, 11:30 am, Ashish jain  wrote:
> Hi,
>
> I want to maintain session in my app when there is loss of WIFI
> connection and android switches to 3G automatically and also when the
> device is working on 3G and there is WIFI network availablity so the
> device would use WIFI.
> In this changeover of connection i want to preserve the session.
> How can I do it...
>
> Thanks and Regards
> Ashish

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Cropping Images with Droid X

2011-04-27 Thread James W
It's certainly fine on Nexus 1, even on 2.3.3. but I wasn't aware it
wasn't supported on the Nexus S.

So it looks as if long term writing my own cropping activity will be
the best solution.

Thanks!
James


On Apr 28, 2:21 am, Kumar Bibek  wrote:
> Cropping, as far as I know, is not a documented Intent to be used for
> reliable behaviour.
>
> So, first of all, you should probably not using it. On Android 2.3.3,
> it breaks(Nexus S). I think it also breaks on 2.2 (Nexus One).
>
> You might get it to work on majority of devices right now. But, if
> it's not documented, you will find it hard to use the same code to
> make it work on all the devices.
>
> On Apr 27, 6:52 pm, James W  wrote:
>
>
>
> > There have been a number of threads here and on other resources
> > regarding this issue, with no resolution I could see:
>
> >http://groups.google.com/group/android-developers/browse_frm/thread/b...
>
> >http://groups.google.com/group/android-developers/browse_frm/thread/2...
>
> > The issue is that on theDroidXwhen using ACTION_GET_CONTENT with
> > cropping, or the photo app's cropping intent, the requested image does
> > not get returned but instead overwrites the user's Wallpaper!
>
> > I am in the same situation, I am using a Intent.ACTION_GET_CONTENT
> > with the crop settings to browse the gallery, and specifying a file
> > URI on the SD card for the returned cropped image data, which I then
> > want to copy to the internal app area. (I am using an intermediate sd
> > card file as returning the data in memory fails for all but very small
> > images).
>
> > On theDroidXit is not saving the file, and I suspect like these
> > other reports it is instead overwriting the user's wallpaper also,
> > however as my app is a Preference Activity for a Live Wallpaper, such
> > an effect is not visible, as my Live Wallpaper is still in play.
>
> > The last official word I could find from Motorola was in here, back in
> > January:
>
> >http://community.developer.motorola.com/t5/Android-App-Development-fo...
>
> > "This appears to be bug when its trying to store large sized images
> > using MediaStore.EXTRA_OUTPUT while cropping. Will file the bug and
> > let you know the status if I get any update."
>
> > But nothing since then.
>
> > So I guess I am faced with either:
>
> > 1. Not using cropping at all, which means reduced functionality for
> > every other phone apart fromDroidX
> > 2. Adding an extra non-cropped routine just forDroid-Xusers
> > 3. Writing my own cropping activity
>
> > The third option seems like overkill, but perhaps is the only way to
> > be sure.
>
> > Anybody else come across this, or could suggest any other workarounds?
>
> > Thanks and regards,
> > James

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Obtaining access to the surfaceView instance

2011-04-27 Thread droid-stricken
Thanks.
So, any idea on how to associate the view created in the activity with
the mediaplayer instance created in the service.
It's not an issue for playing audio files but for video files, i need
a surface to render it :(

I am sure ppl must have faced this issue - it appears pretty commonly,
i believe.
Thanks.


On Apr 27, 11:18 pm, Dianne Hackborn  wrote:
> You can't do this from a service.  A service is not associated with a UI.
>
>
>
>
>
>
>
>
>
> On Thu, Apr 28, 2011 at 12:15 AM, droid-stricken  wrote:
> > Hi,
>
> > I have an activity -
> > public class mainActivity extends Activity {
>
> >  private SurfaceView sv;
>
> >  @Override
> >  public void onCreate(Bundle savedInstanceState) {
> >  sv = (SurfaceView) findViewById(R.id.video_surface);
>
> > .
> >  }
> > }
>
> > I have a service -
>
> > public class VideoService extends Service {
>
> >  private static MediaPlayer mPlayer;
>
> >        @Override
> >        public void onCreate() {
> >                super.onCreate();
> >                mPlayer = new MediaPlayer();
> >                SurfaceHolder holder = ((SurfaceView)
> > findViewById(R.id.video_surface)).getHolder();
> >                player.setDisplay(holder);
> >        }
> > }
>
> > Is this a correct way to set the surface holder for the video
> > mediaplayer?
>
> > If yes, the problem is i cannot do findViewById from within the
> > service class. Any idea how to solve that part?
>
> > I wish the mediaplayer instance to be part of the service so that any
> > activity can issue play/pause commands and the service will execute
> > the activities command.
>
> > Please help.
>
> > 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
>
> --
> 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: Activity Lifecycle Documentation Question

2011-04-27 Thread Eric


On Apr 28, 12:21 am, Dianne Hackborn  wrote:
> "Asking it to finish" means finishing the activity, which means destroying
> it.  Politely asking it to finish isn't going to cause it to just not
> cleanly exit.  It would be fundamentally broken if activities every just
> stop being used in their process without actually going through the
> lifecycle.
>
> In other words "asking to finish" -> Activity.finish() -> does what you
> expect.

Ok, so when I 'finish' an Activity programmatically, never wanting it
to show up in the Task stack again, how does the system know to remove
my Activity from the back stack in that case, but it doesn't remove it
from the stack when the system asks it to finish due to low memory
conditions?

Also, the documentation for onDestroy() adds to the confusion a bit:

"Called before the activity is destroyed. This is the final call that
the activity will receive. It could be called either because the
activity is finishing (someone called finish() on it), or because the
system is temporarily destroying this instance of the activity to save
space. You can distinguish between these two scenarios with the
isFinishing() method."

Note that it says if the Activity is being temporarily discarded to
save space, then the 'isFinishing' method will return false.  If
Android is simply calling 'finish' to temporarily discard the
Activity, as you state, then is it explicitly setting 'isFinishing()'
flag back to false (assuming the call to finish() automatically sets
it to true; because if it didn't, then when I programmatically call
'finish()' to permanently finish the Activity, the flag would probably
never get set)?

- 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


Re: [android-developers] Re: Activity Lifecycle Documentation Question

2011-04-27 Thread Dianne Hackborn
"Asking it to finish" means finishing the activity, which means destroying
it.  Politely asking it to finish isn't going to cause it to just not
cleanly exit.  It would be fundamentally broken if activities every just
stop being used in their process without actually going through the
lifecycle.

In other words "asking to finish" -> Activity.finish() -> does what you
expect.

On Wed, Apr 27, 2011 at 11:01 PM, Eric  wrote:

>
>
> On Apr 27, 9:27 pm, Dianne Hackborn  wrote:
> > On Wed, Apr 27, 2011 at 6:56 PM, Eric  wrote:
> > >  Hopefully the documentation can also be updated to
> > > remove any doubt whatsoever that an Activity cannot possibly be
> > > 'removed' from memory in low-memory situations (when the process is
> > > _not_ killed), that would result in an inconsistent or leak state by
> > > not having balanced lifecycle methods called.
> >
> > The only thing that happens in low-memory situations is processes being
> > killed.
>
> Yes, thank you for clarifying that, but unfortunately the
> documentation lead one to believe that Activities that are already
> paused can somehow be removed from memory by a different mechanism
> other than killing the process.  For example,
>
> http://developer.android.com/reference/android/app/Activity.html
>
> "If an activity is paused or stopped, the system can drop the activity
> from memory by either asking it to finish, or simply killing its
> process"
>
> Note the 'either', 'or' language.  I assume this situation is meant to
> address an Activity stack:
>
>  A1, A2, A3
>
> Where A3 was just started, but the system is so low on memory that it
> 'drops' the activities A1 and A2 from memory using the nebulous
> mechanism described in the documentation.  The nebulous mechanism is
> described as 'the Activity being asked to finish'.  However, my
> understanding of 'finishing' an Activity was that once an Activity is
> 'finished' it never again returns to the screen unless being
> explicitly started again.  Therefore, I took the 'finish' in that
> above documentation to mean that Android removes the Activity from
> memory some other way, where the normal lifecycle is not followed.
> Hence the reason why I wrote this post in the first place.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, 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] not legal to write files using the instrumentation context for an InstrumentationTestCase?

2011-04-27 Thread Dianne Hackborn
The instrumentation code is running as part of the application's process,
not in its own process, so it is running under the app's uid and not its
own.

On Wed, Apr 27, 2011 at 3:10 PM, Andrew Ball  wrote:

> I get a NullPointerException when I try to invoke openFileOutput() on
> the instrumentation context for an InstrumentationTestCase.  Is this
> by design?  I am able to use the target context.
>
> public class ImageUtilTest extends InstrumentationTestCase
> {
>
>  /** the instrumentation context */
>  private Context ctx;
>  /** context of application under test */
>  private Context targetCtx;
>
>  public void setUp() throws IOException
>  {
>ctx = getInstrumentation().getContext();
>targetCtx = getInstrumentation().getTargetContext();
>
>// copy the example image file from the assets folder to the data
> folder
>InputStream in = ctx.getAssets().open("fixture/" +
> LIGHTS_BUTTON_FILENAME);
>// Trying to invoke openFileOutput() on ctx (the instrumentation
> context)
>// throws a NullPointerException.  Use the target context instead.
>FileOutputStream out =
> targetCtx.openFileOutput(LIGHTS_BUTTON_FILENAME,
>Context.MODE_PRIVATE);
>  }
> }
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, 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] Obtaining access to the surfaceView instance

2011-04-27 Thread Dianne Hackborn
You can't do this from a service.  A service is not associated with a UI.

On Thu, Apr 28, 2011 at 12:15 AM, droid-stricken  wrote:

> Hi,
>
> I have an activity -
> public class mainActivity extends Activity {
>
>  private SurfaceView sv;
>
>  @Override
>  public void onCreate(Bundle savedInstanceState) {
>  sv = (SurfaceView) findViewById(R.id.video_surface);
>
> .
>  }
> }
>
> I have a service -
>
> public class VideoService extends Service {
>
>  private static MediaPlayer mPlayer;
>
>@Override
>public void onCreate() {
>super.onCreate();
>mPlayer = new MediaPlayer();
>SurfaceHolder holder = ((SurfaceView)
> findViewById(R.id.video_surface)).getHolder();
>player.setDisplay(holder);
>}
> }
>
> Is this a correct way to set the surface holder for the video
> mediaplayer?
>
> If yes, the problem is i cannot do findViewById from within the
> service class. Any idea how to solve that part?
>
> I wish the mediaplayer instance to be part of the service so that any
> activity can issue play/pause commands and the service will execute
> the activities command.
>
> Please help.
>
> 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
>



-- 
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: How to prevent my application from being killed?

2011-04-27 Thread Dianne Hackborn
On Thu, Apr 28, 2011 at 12:15 AM, lbendlin  wrote:

> b) use Alarm Manager to start your app every x minutes. In your app specify
> singletask.


(1) Force stop also removes all alarms registered by the app.

(2) I sure hope you are not using activities with the alarm manager, and you
should never have a reason to think about singleTask with any relationship
to the alarm manager.

-- 
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] Android: Get Recently used Apps

2011-04-27 Thread Dianne Hackborn
Fwiw, that is the API used to determine the recent tasks to show in the task
switcher.

On Thu, Apr 28, 2011 at 12:15 AM, Dianne Hackborn wrote:

> Yes it returns the recent tasks.  You'll need to describe more what you
> mean by "it didn't work out well."
>
>
> On Wed, Apr 27, 2011 at 9:14 AM, Simon  wrote:
>
>> Hello!
>>
>> I need a little bit help getting information about the last lets say 5
>> application that was opened/used.
>>
>> ActivityManager m =
>> (ActivityManager)this.getSystemService(ACTIVITY_SERVICE);
>>RecentTaskInfo task = m.getRecentTasks(5,0).get(0);
>>
>> Then i used:
>>
>> String output  = "the last application you've executed is '"+task.id
>> +"' and the PID is '"+task.toString()+"'";
>> But it didnt work out well. I think im on the right track with
>> ActivityManager to track the latest app.
>>
>> Thank you!
>>
>> And ye i only need to get enough information so i can run/start them
>> later.
>>
>> //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
>>
>
>
>
> --
> 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.
>
>


-- 
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] Android: Get Recently used Apps

2011-04-27 Thread Dianne Hackborn
Yes it returns the recent tasks.  You'll need to describe more what you mean
by "it didn't work out well."

On Wed, Apr 27, 2011 at 9:14 AM, Simon  wrote:

> Hello!
>
> I need a little bit help getting information about the last lets say 5
> application that was opened/used.
>
> ActivityManager m =
> (ActivityManager)this.getSystemService(ACTIVITY_SERVICE);
>RecentTaskInfo task = m.getRecentTasks(5,0).get(0);
>
> Then i used:
>
> String output  = "the last application you've executed is '"+task.id
> +"' and the PID is '"+task.toString()+"'";
> But it didnt work out well. I think im on the right track with
> ActivityManager to track the latest app.
>
> Thank you!
>
> And ye i only need to get enough information so i can run/start them
> later.
>
> //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
>



-- 
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] Obtaining access to the surfaceView instance

2011-04-27 Thread droid-stricken
Hi,

I have an activity -
public class mainActivity extends Activity {

 private SurfaceView sv;

 @Override
 public void onCreate(Bundle savedInstanceState) {
  sv = (SurfaceView) findViewById(R.id.video_surface);

.
 }
}

I have a service -

public class VideoService extends Service {

 private static MediaPlayer mPlayer;

@Override
public void onCreate() {
super.onCreate();
mPlayer = new MediaPlayer();
SurfaceHolder holder = ((SurfaceView)
findViewById(R.id.video_surface)).getHolder();
player.setDisplay(holder);
}
}

Is this a correct way to set the surface holder for the video
mediaplayer?

If yes, the problem is i cannot do findViewById from within the
service class. Any idea how to solve that part?

I wish the mediaplayer instance to be part of the service so that any
activity can issue play/pause commands and the service will execute
the activities command.

Please help.

Thanks

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


[android-developers] Re: How to prevent my application from being killed?

2011-04-27 Thread lbendlin
b) use Alarm Manager to start your app every x minutes. In your app specify 
singletask.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Multiple Tasks within an Application

2011-04-27 Thread Dianne Hackborn
On Wed, Apr 27, 2011 at 10:55 PM, Eric  wrote:

> 6. If the user hits the HOME button while in Task B (NOT the main
> application Task), and then they re-enter the App via the launcher
> (for Activity A1, Task A), how can I cause the App to enter back where
> I left off in Task B?  The LAUNCHER doesn't know about Task B, but
> there must be a way?  Do I need to override onCreate() in Activity A1,
> look up the last active task/activity name I stored in
> SharedPreferences, and then startActivity on that Activity in
> onCreate(), then call finish() on A1 (which the LAUNCHER just
> launched)?
>

You can't.  They are separate tasks.  That is the point of having separate
tasks -- they operate independently, and switching to one does not impact
the other.


> 7. If I want two separate Tasks in my app, do I actually need to
> define the Activities to have explicit taskAffinity in the manifest
> (i.e. Activity A1,A2,A3 with affinity "A", and B1, B2, B3 with
> affinity "B")?  Or can I allow Activity A1, A2, A3 to inherit the main/
> default application Task affinity, and then just start Task B from my
> menu using FLAG_ACTIVITY_NEW_TASK, whereby Android will assign a new
> globally unique Task affinity to Activity B1, B2, B3 in Task B?
>

Yes you need to give them independent task affinities, or else you can have
cases where they get mixed together.  For example, when you are launching an
activity with NEW_TASK and this causes any existing task to come to the
foreground, which task should be brought to the foreground is determined to
some degree by the task affinities.


> I hope my questions makes sense, and I'm not thinking about this
> wrong.  If I am, I would appreciate it if someone would describe the
> proper way to have multiple Tasks within an Application, and the
> proper way to jump around to each Task.  Or, possibly suggest another
> Paradigm that will achieve the same goal without the use of multiple
> Tasks?
>

The proper way to have multiple tasks is to implement something like the
launcher, where the user is switching between independent tasks that are
shown as independent entities on the recent tasks list etc.  If that is not
the behavior you want, you don't want to use multiple tasks.

-- 
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: Search from Database

2011-04-27 Thread Zsolt Vasvari
If I am not mistaken FTS3 is compiled into the Android SQLite.

On Apr 27, 9:43 am, DanH  wrote:
> There are also extensions to SQLite to do full text 
> search:http://www.sqlite.org/fts3.html
>
> But these would presumably require you to C compile and load the
> extensions.
>
> On Apr 26, 7:56 am, Brad Stintson  wrote:
>
>
>
> > How to make a database field searchable?- 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: Invoke shell commands insmod/rmmod from application

2011-04-27 Thread Zsolt Vasvari
> Ethernet Configuration, found in Android-x86 2.2 & 2.3 under Settings
> category. This app can change the IP address. However on a typical
> Linux PC it can be done (using ifconfig) only with admin/root
> privileges.

There are many things the Settings app can do that you cannot, for a
good reason.  It probably uses a custom permission that only apps
running under the system ID can get.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 prevent my application from being killed?

2011-04-27 Thread Zsolt Vasvari
a) you can't
b) you can't

On Apr 27, 11:35 am, J J  wrote:
> Hello, all.
>
> I have 2 questions please:
> a) How to prevent my application from being killed?
> or
> b) How to restart my application automatically after it is killed or
> force stopped?
>
> Thanks in advance.
> -Jiang

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Multiple Tasks within an Application

2011-04-27 Thread Eric


On Apr 27, 11:25 pm, TreKing  wrote:
> On Wed, Apr 27, 2011 at 9:55 PM, Eric  wrote:
> The rest of that documentation:
> "See 
> FLAG_ACTIVITY_MULTIPLE_TASK
> for
> a flag to disable this behavior."

Thank you for the information.  It helped answer my first few
questions, but I don't believe FLAG_ACTIVITY_MULTIPLE_TASK is what I
want regarding question #4.  I don't want yet another Task to be
started.  I wondered how I would resume the previously running task,
but rather than resume at the point I just left off, I want it to
actually add Activity B1 (the root Activity) onto the stack.  I am not
going to do this in my app, I just wondered if it was possible.


> I hope my questions makes sense, and I'm not thinking about this wrong.  If
>
> > I am, I would appreciate it if someone would describe the proper way to have
> > multiple Tasks within an Application, and the proper way to jump around to
> > each Task.  Or, possibly suggest another Paradigm that will achieve the same
> > goal without the use of multiple Tasks?
>
> What goal? What are you actually trying to achieve with all this?

Very simply, I essentially want to be able to have two navigation
stacks in my application, rather than define a separate Application
for each of the Tasks I want my user to participate in.  My
application is very industry specific, and the user has to log-in to
gain access.  Once they're logged in, they would like to be able to
view data in different categories in drill-down fashion.  Therefore, I
want the user to be able to navigate to a new task for each data
category, and then drill down into the details on that data in a
separate back/navigation stack.  I could do this by supplying
different Applications for each data category, but that seems like a
kludge.  I want to have a single login process, and I don't want the
user to access any data before login.  I know that I can define a
Login Service, and all the "Applications" could play nicely with that,
but I just like the concept of having one Launcher Icon.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Get Recently used Apps

2011-04-27 Thread Simon
Hello!

I need a little bit help getting information about the last lets say 5
application that was opened/used.

ActivityManager m =
(ActivityManager)this.getSystemService(ACTIVITY_SERVICE);
RecentTaskInfo task = m.getRecentTasks(5,0).get(0);

Then i used:

String output  = "the last application you've executed is '"+task.id
+"' and the PID is '"+task.toString()+"'";
But it didnt work out well. I think im on the right track with
ActivityManager to track the latest app.

Thank you!

And ye i only need to get enough information so i can run/start them
later.

//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: Invoke shell commands insmod/rmmod from application

2011-04-27 Thread Abhijit
Thanks, I understand this.
However my curiosity in this topic got triggered by one application,
Ethernet Configuration, found in Android-x86 2.2 & 2.3 under Settings
category. This app can change the IP address. However on a typical
Linux PC it can be done (using ifconfig) only with admin/root
privileges.
Of course it has nothing to do with installing kernel modules, but
still it implies that an application can get root privileges. Isn't it
so?
I am anyway going to have a look at its code (http://www.android-
x86.org/screenshot).


On Apr 26, 12:36 am, Dianne Hackborn  wrote:
> Android currently doesn't support this.  Allowing third party apps to
> install kernel modules is Very Not Desireable in terms of the overall user
> experience.
>
> On Apr 25, 2011 3:34 PM, "Abhijit"  wrote:
>
>
>
>
>
> > Well, the intention may not be to attack with a malware or something,
> > but what if the phone supports some kind of hardware extension to
> > which a device is being attached which doesn't have a native support
> > in the form of a driver?
> > What if the phone can act as a USB host (like Nokia N8) and I am the
> > developer of a USB device and want to support my device on this phone?
> > Say I have a working Linux driver for my device and want that device
> > to work on this phone, then I might want to provide an APK which
> > installs the required driver. What other option do I have here?
>
> > On Apr 22, 1:03 am, Mark Murphy  wrote:
> > > On Thu, Apr 21, 2011 at 7:06 AM, Nagesh A  wrote:
> > > > I have a requirement to install kernel module (module.ko) from the
> > > > application (say setup.apk file).
>
> > > Fortunately, this should be impossible. Kernel modules are part of the
> > > firmware, and random people writing random applications cannot attack
> > > Android users' devices this way.
>
> > > > For this, I am planning to invoke shell commands insmod/rmmod from the
> > > > application.  But, insmod/rmmod commands need ROOT access to execute.
>
> > > And they may not exist on any given device.
>
> > > > Is it possible to get root access from application level?
>
> > > Not from an ordinary SDK application on an ordinary (un-rooted) device.
>
> > > > Is there any other way to do this work?
>
> > > Write your own firmware.
>
> > > > Further, I have gone through google groups mailing lists, and found
> > > > some of them
> > > > are saying its not possible to get root permissions from application
> > > > level.
>
> > > Correct.
>
> > > --
> > > Mark Murphy (a Commons Guy)http://commonsware.com|
>
> http://github.com/commonsguyhttp://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 -- 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] Clearing composing text in IME on switching fields?

2011-04-27 Thread ColdForged
I'm working on a custom keyboard implementation overriding an
InputMethodService. Our implementation creates composing text for
predictions within the text field, styled appropriately. For instance,
a user typing "pine" would have "pineapple" shown with the "apple"
showing as gray since the user hasn't committed it, using the
inputConnection.setComposingText(sbb,...) method. Everything works
very well unless there are multiple text fields on screen and the user
taps a different field. By the time my service is in onFinishInput()
before I ever call the super.onFinishInput() the composing text has
already had its SPAN_COMPOSING styling removed, but the completed text
is still there. I can find no way to reliably remove the unaccepted
"apple" to yield "pine". Thoughts?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Pure Data as your audio engine

2011-04-27 Thread Chris McCormick
Hello Android dev ppl,

Pure Data is a Free Software audio patching/programming language which allows
you to make wonderful sound machines by connecting boxes together with virtual
wires. http://pure-data.info/ There is now a way of getting your Pure Data
patches to work as the audio engine in your Android project (as well as your
Python project, Java project, C++ project, whatever). This is great if you are
making an app which does complex or interesting things with dynamic audio or
music or whatever. You can find the project for doing that here:

https://gitorious.org/pdlib/pd-for-android

I am giving a workshop in Los Angeles this Thursday if you are interested in
learning about this stuff. You can sign up here: http://mccrm.cx/l/la-2011

Hope to see you there!

Cheers,

Chris.

---
http://mccormick.cx

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Search from Database

2011-04-27 Thread tbltop
All database fields are searchable by default.  Android doesn't do the
searching, you need to make your own "search bar" and use sqlite to do
the actual search (called a query in sqlite speak).

I've not used sqlite within Android, but if I needed to, here is what
I would do:

Look into Androids sqlite classes.  There should be a way to pass
sqlite commands over to sqlite and receive results back.

You're also going to have to know the correct sqlite command to pass,
so read up on sqlite as well.


On Apr 26, 12:17 pm, Brad Stintson  wrote:
> I mean that user can search the fields of a particular row of sqlite
> database using search
> bar.
>
> On Tue, Apr 26, 2011 at 9:14 PM, Mark Murphy wrote:
>
>
>
>
>
>
>
> > What does "searchable" mean to you?
>
> > What does a "database field" mean to you?
>
> > On Tue, Apr 26, 2011 at 11:40 AM, Brad Stintson 
> > wrote:
> > > Please reply
>
> > > On Tue, Apr 26, 2011 at 6:26 PM, Brad Stintson 
> > > wrote:
>
> > >> How to make a database field searchable?
>
> > --
> > Mark Murphy (a Commons Guy)
> >http://commonsware.com|http://github.com/commonsguy
> >http://commonsware.com/blog|http://twitter.com/commonsguy
>
> > Warescription: Three Android Books, Plus Updates, One Low Price!
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, 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] not legal to write files using the instrumentation context for an InstrumentationTestCase?

2011-04-27 Thread Andrew Ball
I get a NullPointerException when I try to invoke openFileOutput() on
the instrumentation context for an InstrumentationTestCase.  Is this
by design?  I am able to use the target context.

public class ImageUtilTest extends InstrumentationTestCase
{

 /** the instrumentation context */
  private Context ctx;
  /** context of application under test */
  private Context targetCtx;

  public void setUp() throws IOException
  {
ctx = getInstrumentation().getContext();
targetCtx = getInstrumentation().getTargetContext();

// copy the example image file from the assets folder to the data
folder
InputStream in = ctx.getAssets().open("fixture/" +
LIGHTS_BUTTON_FILENAME);
// Trying to invoke openFileOutput() on ctx (the instrumentation
context)
// throws a NullPointerException.  Use the target context instead.
FileOutputStream out =
targetCtx.openFileOutput(LIGHTS_BUTTON_FILENAME,
Context.MODE_PRIVATE);
  }
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Developer console: payments not charged, application statistics not updated

2011-04-27 Thread burnayev
The payments for my application (ActionComplete Pro) sit in a limbo
(the Charge button is grayed out) since April 24. Typically it took a
few hours before an order would come through and Charge button would
be replaced by Archive.

The application statistics for both ActionComplete and ActionComplete
Pro has not been updated for a while. I'm not sure if it stopped
updating at the same time when the payment issue occurred or at a
different time.

What's going on?

Kind regards,
Borys Burnayev
actioncomplete.com
GTD for Android and Web

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] 16 bit encoding

2011-04-27 Thread angshuman baruah
Hi all
How can I send a SMS using 16 bit encoding scheme. All the methods that i
got in the internet are deprecated. Can any one help me to send 16 bit
unicode programmatically.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 use scrollview in java code.

2011-04-27 Thread rishabh agrawal
I want to know that how i use the scrollview in java code

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


[android-developers] First Application Development

2011-04-27 Thread arpit
I am new in this app development field,
I have decided to make a simple application regarding messaging, i.e.
just send and receive messages..
so can u help me out in this.. how the messages are sent from one
device to another..?? or do i have to stay on sending message from one
emulator to another.??
what are the overall requirements??(i've fully installed eclipse and
integrated android too)..
any particular book having a vast information on messaging services
and android "Telephony" package...

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Error in building application

2011-04-27 Thread aditya _22cen
Hi everyone,

i am new to andriod i am geting the

C:\Program Files\Android\android-sdk\tools\ant\main_rules.xml:472: The
following error occurred while executing this line:
C:\Program Files\Android\android-sdk\tools\ant\main_rules.xml:203:
apply returned: 255
BUILD FAILED (total time: 3 seconds)

error while compiling my first application as i am new please give me
detailed explanation .I AM using netbeans 6.9.1 andriod 3.0 .Please
give a reply
thankx 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] Getting the time of day from a cell site

2011-04-27 Thread CBD
I am writing an application that wants to know the time of day from a
cell site. Any cell site that we can see is acceptable. I have not
been able to find anything in the TelephonyServices or
LocationServices that would allow me to do this.. Is there a way to
get the time of day (any format is ok) from the cell network?

Also, the "time of the fix" from location services, I assume this is
the devices time of day fetched from Linux at the time the fix was
made, and not the time from the GPS satellite, is that correct?

Many thanks for any insights!

-Charlie

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 prevent my application from being killed?

2011-04-27 Thread J J
Hello, all.

I have 2 questions please:
a) How to prevent my application from being killed?
or
b) How to restart my application automatically after it is killed or
force stopped?

Thanks in advance.
-Jiang

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Button code

2011-04-27 Thread rishabh agrawal
How to crate button & also called without using xml.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 handle Exception message internationalization

2011-04-27 Thread Guilherme Matsumoto
Hi Everyone,

Here is an example of my problem:

try {
// code that throws an exception
} catch (Exception e) {
Toast.makeText(getApplicationContext(), e.getLocalizedMessage(),
Toast.LENGTH_LONG).show();
}

I'd like it to show a message in other language in a beautiful way
something like just overwriting the exception's internationalization
string entry. Some thing like:
custom message
or
custom
message

Is there any way of doing this or some other thing without using
Exception.getMessage() string comparison?

thks.

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


[android-developers] why are images automatically scaled down on high density screens with BitmapDrawable(String filepath)

2011-04-27 Thread Andrew Ball
I've noticed that when working with a high density device,
BitmapDrawable(String) automatically scales a bitmap down by a factor
of 160/240.  I'm able to get the bitmap to not be scaled by using
BitmapDrawable(Context, String), but I don't understand why the image
would be automatically scaled *down*.  It seems like things are
usually scaled up on high density screens so that they appear the same
size to the user as they would on lower density screens.

Can anyone shed some light on why?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Maintain session over 3g and wifi

2011-04-27 Thread Ashish jain
Hi,

I want to maintain session in my app when there is loss of WIFI
connection and android switches to 3G automatically and also when the
device is working on 3G and there is WIFI network availablity so the
device would use WIFI.
In this changeover of connection i want to preserve the session.
How can I do it...

Thanks and Regards
Ashish

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Multiple Tasks within an Application

2011-04-27 Thread TreKing
On Wed, Apr 27, 2011 at 9:55 PM, Eric  wrote:

> This seems to work empirically, HOWEVER, I don't understand "why"
> this works, after I have already navigated around in Task B?  I
> understand why it would work the first time, to start Task B, but I
> don't understand why on subsequent calls, when I perform startActivity,
> Task B is resume dat the last Activity (B3) it left off from, rather
> than add a new Activity (B1) to Task B's stack, such that the stack is
> B1, B2, B3, B1.  While I WANT it to resume Task B where it left off, I don't
> understand why Task B doesn't have an extra Activity B1 added to the end
> after I startActivity on subsequent starts?  None of the Activities are
> defined as 'singleTop', or 'clearTop', or whatever. They are standard
> Activities in the manifest.
>

As described:

http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NEW_TASK


"When using this flag, if a task is already running for the activity you are
now starting, then a new activity will not be started; instead, the current
task will simply be brought to the front of the screen with the state it was
last in."

4. Following up on point 3, what if I DO want to switch to Task B, and add a
> new Activity B1 to the end of the stack?  What call would I make (from the
> menu action code) to do this?
>

The rest of that documentation:
"See 
FLAG_ACTIVITY_MULTIPLE_TASK
for
a flag to disable this behavior."

5. I don't understand how the LAUNCHER does this either, that is, resume a
> Task at the last place it left off, rather than add a new Activity (root
> Activity) to the end of the Task's back stack?  I assume the LAUNCHER is
> doing the same thing I'm doing in the menu action call?
>

See above.


I don't know about the rest.

I hope my questions makes sense, and I'm not thinking about this wrong.  If
> I am, I would appreciate it if someone would describe the proper way to have
> multiple Tasks within an Application, and the proper way to jump around to
> each Task.  Or, possibly suggest another Paradigm that will achieve the same
> goal without the use of multiple Tasks?
>

What goal? What are you actually trying to achieve with all this?

-
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: Fragmentation-resistant product design

2011-04-27 Thread Brill Pappin
project created.

http://code.google.com/p/aosddl/

i haven't sent any code up yet (not that there is much to send up) but will 
do so shortly.
Those that wish to participate, please make yourself know to the project :)

- Brill

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Keytool and Jarsigner - where are they?

2011-04-27 Thread Satya Komatineni
They are in

your-jdk-directory\bin



On Wed, Apr 27, 2011 at 11:02 PM, Paul Spradley  wrote:
> I am using eclipse and cannot find Keytool or Jarsigner . Where are they
> accessed from?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
Satya Komatineni
http://www.satyakomatineni.com
http://www.androidbook.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] Keytool and Jarsigner - where are they?

2011-04-27 Thread Paul Spradley
I am using eclipse and cannot find Keytool or Jarsigner . Where are they 
accessed from?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 Documentation Question

2011-04-27 Thread Eric


On Apr 27, 9:27 pm, Dianne Hackborn  wrote:
> On Wed, Apr 27, 2011 at 6:56 PM, Eric  wrote:
> >  Hopefully the documentation can also be updated to
> > remove any doubt whatsoever that an Activity cannot possibly be
> > 'removed' from memory in low-memory situations (when the process is
> > _not_ killed), that would result in an inconsistent or leak state by
> > not having balanced lifecycle methods called.
>
> The only thing that happens in low-memory situations is processes being
> killed.

Yes, thank you for clarifying that, but unfortunately the
documentation lead one to believe that Activities that are already
paused can somehow be removed from memory by a different mechanism
other than killing the process.  For example,

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

"If an activity is paused or stopped, the system can drop the activity
from memory by either asking it to finish, or simply killing its
process"

Note the 'either', 'or' language.  I assume this situation is meant to
address an Activity stack:

  A1, A2, A3

Where A3 was just started, but the system is so low on memory that it
'drops' the activities A1 and A2 from memory using the nebulous
mechanism described in the documentation.  The nebulous mechanism is
described as 'the Activity being asked to finish'.  However, my
understanding of 'finishing' an Activity was that once an Activity is
'finished' it never again returns to the screen unless being
explicitly started again.  Therefore, I took the 'finish' in that
above documentation to mean that Android removes the Activity from
memory some other way, where the normal lifecycle is not followed.
Hence the reason why I wrote this post in the first place.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Multiple Tasks within an Application

2011-04-27 Thread Eric
Let's say for the purposes of my specialized Application, I would like
to have two Tasks (thus back stacks) that can be run by the user
within an Application.

Task A (with task affinity "A") --> Activity A1, Activity A2, Activity
A3
Task B (with task affinity "B") --> Activity B1, Activity B2, Activity
B3

Assume that Activity A1 is the MAIN/LAUNCHER Activity, such that Task
A, Activity A1 becomes the main Application Task.  Assume I have a
menu that allows switching between the tasks.

1. If the App starts in Activity A1 (Task A), as it should, and I want
to switch to Task B, is it correct that the menu which does the switch
should call:

startActivity(new Intent(context, ActivityA1.class)  (with
FLAG_ACTIVITY_NEW_TASK) ?

2. Likewise, to switch to Task B, I assume the similar menu call
should be:

startActivity(new Intent(context, ActivityB1.class) (with
FLAG_ACTIVITY_NEW_TASK) ?

3. If I have previously navigated to Activity B3 in Task B, such that
Task B's stack is B1, B2, B3, and I'm back in Task A at the moment,
when I want to switch back to Task B and arrive at the current
activity B3, then using the menu, I assume I would still use:

startActivity(new Intent(context, ActivityB1.class) (with
FLAG_ACTIVITY_NEW_TASK)

This seems to work empirically, HOWEVER, I don't understand "why" this
works, after I have already navigated around in Task B?  I understand
why it would work the first time, to start Task B, but I don't
understand why on subsequent calls, when I perform startActivity, Task
B is resume dat the last Activity (B3) it left off from, rather than
add a new Activity (B1) to Task B's stack, such that the stack is B1,
B2, B3, B1.  While I WANT it to resume Task B where it left off, I
don't understand why Task B doesn't have an extra Activity B1 added to
the end after I startActivity on subsequent starts?  None of the
Activities are defined as 'singleTop', or 'clearTop', or whatever.
They are standard Activities in the manifest.

4. Following up on point 3, what if I DO want to switch to Task B, and
add a new Activity B1 to the end of the stack?  What call would I make
(from the menu action code) to do this?

5. I don't understand how the LAUNCHER does this either, that is,
resume a Task at the last place it left off, rather than add a new
Activity (root Activity) to the end of the Task's back stack?  I
assume the LAUNCHER is doing the same thing I'm doing in the menu
action call?

6. If the user hits the HOME button while in Task B (NOT the main
application Task), and then they re-enter the App via the launcher
(for Activity A1, Task A), how can I cause the App to enter back where
I left off in Task B?  The LAUNCHER doesn't know about Task B, but
there must be a way?  Do I need to override onCreate() in Activity A1,
look up the last active task/activity name I stored in
SharedPreferences, and then startActivity on that Activity in
onCreate(), then call finish() on A1 (which the LAUNCHER just
launched)?

7. If I want two separate Tasks in my app, do I actually need to
define the Activities to have explicit taskAffinity in the manifest
(i.e. Activity A1,A2,A3 with affinity "A", and B1, B2, B3 with
affinity "B")?  Or can I allow Activity A1, A2, A3 to inherit the main/
default application Task affinity, and then just start Task B from my
menu using FLAG_ACTIVITY_NEW_TASK, whereby Android will assign a new
globally unique Task affinity to Activity B1, B2, B3 in Task B?


I hope my questions makes sense, and I'm not thinking about this
wrong.  If I am, I would appreciate it if someone would describe the
proper way to have multiple Tasks within an Application, and the
proper way to jump around to each Task.  Or, possibly suggest another
Paradigm that will achieve the same goal without the use of multiple
Tasks?




-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Setting Widget Background via RemoteView

2011-04-27 Thread Jake Colman
> "KV" == Kostya Vasilyev  writes:

   KV> 12.04.2011 17:19, Jake Colman пишет:

   >> I have yet to figure this out so I though I'd try posting again.
   >> 
   >> Given a widget with a background image specified in its layout,
   >> how can one set the background's transparency at runtime?
   >> 
   >> I have tried Kostya's suggestion of calling the
   >> RemoteView.setInt() method and passing in setAlpha as the
   >> methodName but I get a reflection error.

   KV> Calling "setInt" for "setAlpha" works starting with 2.2 - where
   KV> ImageView.setAlpha is marked with @RemotableViewMethod.

   >> I know this is doable because other application widgets have
   >> sliders to set the transparency at runtime.  But how?

Kostya,

Now I know for sure it's doable since you just released upgrades to your
widgets that do it!

Unfortunately, and I admit that I am being obtuse, I'm still not getting
it.

When I call RemoteViews.setInt(id,"setAlpha",value) what am I supposed
to be passing in for the id parameter?  It's not the layout id since
that does not have a setAlpha method.  I tried sending in the id of my
background drawable but that gave me an error that it could not find the
view.

What's the magic incantation?  Have you done a blog posting on this?

-- 
Jake Colman -- Android Tinkerer

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


Re: [android-developers] CheckedTextView and filtering of list not working well together

2011-04-27 Thread TreKing
On Wed, Apr 27, 2011 at 8:14 PM, Lowell Kirsh  wrote:

> At a high level I understand what you are saying but I'm not sure where to
> hook into the filtering.


I don't know anything about filtering - haven't used it.


> I think I know how to save and restore the list's checked state (e.g. set
> of checked row ids) but where would I put the code to save the state and the
> code to restore the state?


The checked state of each entry is determined by the object that view
represents. That object would have some sort of "selected" flag.

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

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

[android-developers] Re: Android OOM exception and SoftReferences

2011-04-27 Thread DanH
One does need to keep in mind that naively loading, say, an 8
megapixel image will take about 16mb of storage.  And on some
platforms (not sure about Android) simply having 6mb of heap available
does not mean that there's 6mb CONTIGUOUS, as would be needed for a
large object.

On Apr 27, 1:24 pm, dnkoutso  wrote:
> Hey everyone,
>
> I got an OOM. I know it has been covered alot by previous questions but mine
> has to do with the internals of Android.
>
> As I am loading images at random points I get this dreaded OOM exception.
>
> I do have my images in an HashMap>. From the SoftReferences definition I
> would expect the Drawables to be GC'ed if memory is not enough.
>
> In contrast, from my previous research I see that the bitmap in the drawable
> is allocated in a different heap (the native heap) than my applications
> heap. That explains why on DDMS despite the fact I see 6MB of memory I am
> using, my app still crashes.
>
> It also seems that SoftReferences are "perfect" for caches and are
> recommended by Android engineers to use.
>
> My question is, since my application heap never reaches the MAX point, this
> should mean my SoftReferences are never GC'ed.
>
> How can I resolve this problem? Is there really any gains from using
> SoftReferences then? Am I not understanding something correctly?
>
> Thanks!

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


[android-developers] ExpandableListView for only mp3 albums. Tips requested

2011-04-27 Thread Gabriel Simões
Hello,

I´ve been trying to figure a way out to search MediaStore.Audio.Albums
and MediaStore.Audio.Media to retrieve a list of mp3 albums and
organize them in an expandablelistview.

In the end what I haven´t been able to do is to retrieve information
about existing albums with mp3 files. I can list all albums and
retrieve their songs but can´t filter which albums have mp3s and which
haven´t.

Listing albums (all registered albums with audio files of any
extension):

 String[] cols = new String[] {
 MediaStore.Audio.Albums._ID,
 MediaStore.Audio.Albums.ARTIST,
 MediaStore.Audio.Albums.ALBUM,
 MediaStore.Audio.Albums.NUMBER_OF_SONGS
 };
 Uri uriExternal =
MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI;
 Uri uriInternal =
MediaStore.Audio.Albums.INTERNAL_CONTENT_URI;
 Cursor externalCursor =
getContentResolver().query(uriExternal, cols, null, null,
MediaStore.Audio.Albums.ARTIST + ", " +
MediaStore.Audio.Albums.ALBUM);
 Cursor internalCursor =
getContentResolver().query(uriInternal, cols, null, null,
MediaStore.Audio.Albums.ARTIST + ", " +
MediaStore.Audio.Albums.ALBUM);

Do I need to run a SQL or can I archive the results I need using
getContentResolver().query()? I couldn´t figure out a way to use WHERE
clause or also search DISTINCT MediaStore.Audio.Media.ALBUM filtering
MediaStore.Audio.Media.DATA

Thanks for your help,
Gabriel Simões

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 do you counter repeated bogus reviews from competitors?

2011-04-27 Thread Peter Sinnott
On Apr 26, 4:49 pm, TreKing  wrote:
>
> It has. Repeatedly. Just search for "respond to comments". Like all other
> support queries and feature requests directed at Google on that forum,
> they're all ignored.
>

I don't think they are ignored. Look at the thread about Google Docs
for Android.
Google employee Robin posted that the Docs  team have plans.
And now,not even two and a half years latter we have a Google Docs app
for Android.
People just need to stop being so impatient.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Application with Hardware Acceleration, hardware layers, and rotated ImageViews is causing jaggies.

2011-04-27 Thread Brion Emde
Hi Romain,

I'm having the same problem, and I don't really understand what you're
talking about with "layer on" and "layer off".

Could you explain that a bit more, so I can get a better hold on this
whole problem?

Thanks,

Brion Emde


On Apr 26, 4:51 pm, Romain Guy  wrote:
> To get antialiased edges with HW acceleration on you should add an empty 1px
> border in your bitmap (layer off) or 1 px padding in your ImageView (layer
> on).
>
> On Tue, Apr 26, 2011 at 4:17 PM, Christopher Lester 
> wrote:
>
>
>
>
>
>
>
>
>
> > Hey folks
>
> > I am building an application and the following 3 scenarios occur.
>
> > 1. When I have hardware acceleration in the manifest turned on,
> > hardware layers enabled in my layout.xml file and a rotation applied
> > to an ImageView I get jaggies around the edges of the ImageView that
> > is holding the Bitmap.
>
> > 2. When I have hardware acceleration in the manifest turned on,
> > hardware layers dis-abled in my layout.xml file and a rotation applied
> > to an ImageView I get black borders around the edges of the ImageView
> > that is holding the Bitmap.
>
> > 3. When I have hardware acceleration turned off, hardware layers dis-
> > abled, and the ImageViews rotated I get some kind of jaggedness added
> > to the ImageView images themselves. Essentially they are not smooth
> > and crisp (ANTI_ALIAS).
>
> > I am trying to work out a scenario where I can have hardware
> > acceleration = on, no black edges around the ImageViews bitmaps, and
> > anti_aliased rotated imageviews. Clean and Crisp rotations.
>
> > Thanks for any help
>
> > Chris
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support.  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: Activity Lifecycle Documentation Question

2011-04-27 Thread Dianne Hackborn
On Wed, Apr 27, 2011 at 6:56 PM, Eric  wrote:

> I am glad this change was made, it makes more logical sense to me to
> do it this way.  Hopefully the documentation can also be updated to
> remove any doubt whatsoever that an Activity cannot possibly be
> 'removed' from memory in low-memory situations (when the process is
> _not_ killed), that would result in an inconsistent or leak state by
> not having balanced lifecycle methods called.
>

The only thing that happens in low-memory situations is processes being
killed.

-- 
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: Activity Lifecycle Documentation Question

2011-04-27 Thread Dianne Hackborn
Um, yes, called.  I meant called. :)

On Wed, Apr 27, 2011 at 6:53 PM, Mark Murphy wrote:

> On Wed, Apr 27, 2011 at 6:44 PM, Dianne Hackborn 
> wrote:
> > Also it may be worth mentioning -- there was a significant change to the
> > activity lifecycle in 3.0 where onStop() is now guaranteed to be killed
> > (prior to killing a process) like onPause() has always been.
>
> Just to clarify, shouldn't that read:
>
> > Also it may be worth mentioning -- there was a significant change to the
> > activity lifecycle in 3.0 where onStop() is now guaranteed to be
> **called**
> > (prior to killing a process) like onPause() has always been.
>
> ?
>
> Thanks!
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 3.3 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
>



-- 
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] Call not ended when ending it in the other peer

2011-04-27 Thread Alaeddine Ghribi
Hi,
I'm developping a SIP application, however, i have a big problem:
When A call B, and we ended the call in B => A will not as well end
the call until we confirm it (with a button or menu option).
It misses some synchronisation between the two peers.

How can i add this "sync" in a SIP application ?

Thank you for your help.

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


[android-developers] Re: How can we get the mobile position (e.g. by gps) all the time?

2011-04-27 Thread lbendlin
Not really, as the device may operate off grid.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] CheckedTextView and filtering of list not working well together

2011-04-27 Thread Lowell Kirsh
Thanks TreKing. At a high level I understand what you are saying but I'm not 
sure where to hook into the filtering. I think I know how to save and 
restore the list's checked state (e.g. set of checked row ids) but where 
would I put the code to save the state and the code to restore the state?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] How can i user SVN to check in my code to google server?

2011-04-27 Thread Kristopher Micinski
Why are you asking this on the Android list?

Kris

On Wed, Apr 27, 2011 at 8:21 PM, a a  wrote:

> Cannot complete the install because one or more required items could
> not be found.
>  Software being installed: Subversive SVN Integration for the Mylyn
> Project (Optional) (Incubation) 0.7.9.I20110318-1700
> (org.eclipse.team.svn.mylyn.feature.group 0.7.9.I20110318-1700)
>  Missing requirement: Subversive Integration for the Mylyn Project
> (Incubation) 0.7.9.I20110318-1700 (org.eclipse.team.svn.mylyn
> 0.7.9.I20110318-1700) requires 'bundle org.eclipse.mylyn.team.ui
> 3.0.0' but it could not be found
>  Cannot satisfy dependency:
>From: Subversive SVN Integration for the Mylyn Project (Optional)
> (Incubation) 0.7.9.I20110318-1700
> (org.eclipse.team.svn.mylyn.feature.group 0.7.9.I20110318-1700)
>To: org.eclipse.team.svn.mylyn [0.7.9.I20110318-1700]
>
>
>
> 2011/4/27 J Handal :
> >  Hi aa,
> >
> >
> http://blog.search-computing.net/2010/04/using-a-svn-repository-with-eclipse/
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, 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] How can i user SVN to check in my code to google server?

2011-04-27 Thread a a
Cannot complete the install because one or more required items could
not be found.
  Software being installed: Subversive SVN Integration for the Mylyn
Project (Optional) (Incubation) 0.7.9.I20110318-1700
(org.eclipse.team.svn.mylyn.feature.group 0.7.9.I20110318-1700)
  Missing requirement: Subversive Integration for the Mylyn Project
(Incubation) 0.7.9.I20110318-1700 (org.eclipse.team.svn.mylyn
0.7.9.I20110318-1700) requires 'bundle org.eclipse.mylyn.team.ui
3.0.0' but it could not be found
  Cannot satisfy dependency:
From: Subversive SVN Integration for the Mylyn Project (Optional)
(Incubation) 0.7.9.I20110318-1700
(org.eclipse.team.svn.mylyn.feature.group 0.7.9.I20110318-1700)
To: org.eclipse.team.svn.mylyn [0.7.9.I20110318-1700]



2011/4/27 J Handal :
>  Hi aa,
>
> http://blog.search-computing.net/2010/04/using-a-svn-repository-with-eclipse/
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, 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: Debugging a separate thread.

2011-04-27 Thread Indicator Veritatis
The Eclipse debugger does support multi-thread debugging, but I can't
say I am all that impressed with the support for it. When, for
example, you set a breakpoint, you have no control over which thread
is running when it hits it. Whatever thread is running, it will stop
when it reaches that breakpoint.

Now it sounds like the thread you are concerned about runs its own
code, and in only one background thread. So the above is not your
problem. What might be your problem though, is that it does stop at
the breakpoint, but then you lose the information when your foreground
thread stops on its own breakpoint. Try removing/disabling all
breakpoints except the one in the background thread. As long as you
actually do reach that line in that thread, it should stop there.

On Apr 27, 12:36 pm, Tobiah  wrote:
> > No, I have no trouble at all with breakpoints in a multithreaded
> > application.
>
> > Note that Eclipse only pauses one thread at a time, which means that
> > other threads keep running while you're stopped at a breakpoint.
>
> > Sometimes this complicates debugging, sometimes helps (since the UI
> > thread keeps running).
>
> > There may be a setting somewhere in Eclipse to pause all threads, but
> > I've never bothered to look.
>
> I can set a breakpoint in my first Activity during say onCreate() and
> the debugger stops there, and shows me the line.  I have another thread
> that I know is running because of a successful web fetch that it
> performs, but the debugger never shows me that file.  I continue to
> see the results from the background thread in the UI, but the breakpoint
> never seems to be honored.
>
> I do see a list of threads in one of the top windows.  Am I supposed to
> switch context in there somehow?
>
> Thanks,
>
> Tobiah

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


[android-developers] What I found using big images on an activity

2011-04-27 Thread fr4gus
Hi everyone,

I would like to share some findings related to using images on
activities and impact on an application creating multiples activities
or changing orientation.

What I coded:

public class BigImageActivity extends Activity {
int count;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
if (intent != null) {
count = intent.getIntExtra("count", 0);
}

setContentView(R.layout.bigimagelayout);

TextView txtView = (TextView) findViewById(R.id.Counter);
txtView.setText("Activity: " + count);

Button openNew = (Button) findViewById(R.id.OpenNew);
openNew.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
startNewActivity(count);
}
});
}

public void startNewActivity(int count) {
Intent intent = new Intent();
intent.setClass(this, BigImageActivity.class);
intent.putExtra("count", count + 1);
startActivity(intent);

}
}

Layout:

http://schemas.android.com/apk/res/android";
  android:layout_width="match_parent"
  android:layout_height="wrap_content" android:orientation="vertical">





Image resource called domo2048 its an JPEG mage of 2048x1536 and about
627Kb (physical size)

I was able to create... I think stack is better ;), about 233
activities using that button. I got my app killed during the process
but Android was able to recreate them,so I was able to go back through
all activities. Curiously I got my app killed several times too while
presing back till activity 0.

The second finding was that, with only one activity, but changing
orientation I got an application crash afte a ramdom number of
orientation changes ( some times at third try, some times higher
number, depending of how fast I did it between changes)

What I got on my logcat was the following:

04-27 17:36:48.217: INFO/WindowManager(1574): Setting rotation to 1,
animFlags=0
04-27 17:36:48.237: INFO/ActivityManager(1574): Config changed:
{ scale=1.0 imsi=712/2 loc=en_US touch=3 keys=2/1/2 nav=2/1 orien=2
layout=34 uiMode=17 seq=402}
04-27 17:36:48.277: ERROR/dalvikvm-heap(25598): Heap Massage needed
(14155776-byte external allocation too big)
04-27 17:36:48.277: ERROR/dalvikvm-heap(25598): Full GC (don't collect
SoftReferences)
04-27 17:36:48.297: INFO/UsageStats(1574): Unexpected resume of
com.schematic.android while already resumed in com.schematic.android
04-27 17:36:48.307: DEBUG/dalvikvm(25598): GC_EXTERNAL_ALLOC freed 352
objects / 22840 bytes in 32ms
04-27 17:36:48.317: INFO/GPSButton(1574): Update State
04-27 17:36:48.397: ERROR/dalvikvm-heap(25598): Heap Massage was
successful...

I got it several times, before get this:

04-27 17:36:51.057: ERROR/AndroidRuntime(25598):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.schematic.android.grindr/
com.schematic.android.BigImageActivity}:
android.view.InflateException: Binary XML file line #8: Error
inflating class 
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2663)
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2679)
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): at
android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:
3815)
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): at
android.app.ActivityThread.access$2400(ActivityThread.java:125)
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2037)
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): at
android.os.Handler.dispatchMessage(Handler.java:99)
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): at
android.os.Looper.loop(Looper.java:123)
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): at
android.app.ActivityThread.main(ActivityThread.java:4627)
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): at
java.lang.reflect.Method.invokeNative(Native Method)
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): at
java.lang.reflect.Method.invoke(Method.java:521)
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): at
dalvik.system.NativeStart.main(Native Method)
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): Caused by:
android.view.InflateException: Binary XML file line #8: Error
inflating class 
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): at
android.view.LayoutInflater.createView(LayoutInflater.java:513)
04-27 17:36:51.057: ERROR/AndroidRuntime(25598): at
com.android.i

[android-developers] Re: Debugging a separate thread.

2011-04-27 Thread Indicator Veritatis
What you describe using F7 is fairly normal. But since single-stepping
through code is tedious, and the tedium is fruitless when you don't
have the source, I usually use Step UP instead of Step Over once I
land in Android system code. I also use breakpoints in Android more
heavily than I do in other debugging/development environments to avoid
landing in the system code in the first place.

On Apr 27, 10:48 am, Tobiah  wrote:
> I am getting familiar with debugging from eclipse.
> I have a thread that runs in the background, and set
> a breakpoint in that file.  When I debug my program,
> I never see it stop there or display the file that
> the break is in.  Do I need to do something special
> in order to select which thread I'm debugging?
>
> Also, as I step through my program, I eventually
> get to parts of the Android system, where I'm in
> the dark.  I get a message about the source file
> not being available which makes sense.  I just
> keep hitting F7, and eventually get back to my
> code.  Is this a normal routine that people go
> through, and can I get and install the source
> somewhere so that I could actually step through
> the Android code?
>
> Thanks!
>
> Tobiah

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


[android-developers] Re: Android OOM exception and SoftReferences

2011-04-27 Thread Indicator Veritatis
I think I know why it is "not full[sic] proof". Some time ago, I
carefully read and compared side by side the Java Sun Javadoc
description of System.gc() and Android's. One shocking difference
emerged. In both, the call is only a hint, but in Android, it is a
much weaker hint: unlike in Sun, you are not even guaranteed that the
garbage collection is called at all! With Sun, you are at least
guaranteed that it was called, and an effort made to release SOME
memory, even if that effort is unsuccessful.

On Apr 27, 12:12 pm, Streets Of Boston 
wrote:
> Using System.gc() helped me with my image editing program.
> But it is NOT full proof.
>
> This is what I do:
> When ma app no longer needs (a) bitmap(s), it calls *recycle()* (this will
> clean up the memory - image data - that is part of your process, but not
> part of the DalvikVM), nulls the Bitmap(s) references and calls System.gc().
>
> (Pre Android 3.0), bitmap memory (the memory holding the raw image data) is
> not 'seen' by the DalvikVM. It may not know that your app is running low on
> memory and it won't call the garbage collector to try to reclaim some memory
> before allocating it --> OOM that was not really necessary.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 OOM exception and SoftReferences

2011-04-27 Thread Indicator Veritatis
Well, you didn't post your code, so I can't be 100% sure, but my guess
is that there are other references to the same Drawables somewhere,
references that are NOT SoftReferences. That would keep it from being
garbage-collected.

Also, there is a difference between weak references and soft ones. It
you really want to make sure it is garbage-collected sooner rather
than later (it sounds like this is what you want), use a weak
reference not a soft one. A typical example of the difference is that
the Sun/Oracle JVM will clear all soft references before returning an
OOM.

That said, there is no requirement on the JVM that it actually treat
WeakReferences and SoftReferences differently. (http://
weblogs.java.net/blog/2006/05/04/understanding-weak-references).

Finally, there is actually a well known but in earlier versions (1.5,
1.6) of Android that is the opposite of what you describe: it reports
that SoftReferences are being GC'd too early instead of too late. See
http://stackoverflow.com/questions/4014033/android-the-gc-doesnt-respect-softreferences
for details.

On Apr 27, 11:24 am, dnkoutso  wrote:
> Hey everyone,
>
> I got an OOM. I know it has been covered alot by previous questions but mine
> has to do with the internals of Android.
>
> As I am loading images at random points I get this dreaded OOM exception.
>
> I do have my images in an HashMap>. From the SoftReferences definition I
> would expect the Drawables to be GC'ed if memory is not enough.
>
> In contrast, from my previous research I see that the bitmap in the drawable
> is allocated in a different heap (the native heap) than my applications
> heap. That explains why on DDMS despite the fact I see 6MB of memory I am
> using, my app still crashes.
>
> It also seems that SoftReferences are "perfect" for caches and are
> recommended by Android engineers to use.
>
> My question is, since my application heap never reaches the MAX point, this
> should mean my SoftReferences are never GC'ed.
>
> How can I resolve this problem? Is there really any gains from using
> SoftReferences then? Am I not understanding something correctly?
>
> 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


Re: [android-developers] Error when launching a ringtone.

2011-04-27 Thread a a
android.content.res.Resources$NotFoundException: File res/raw/ringtone
from drawable resource ID #0x7f05

file res/raw/ringtone is not exist?

2011/4/27 Alaeddine Ghribi :
> Hi,
> I have an AlertDialog that when it shows it launches a ringtone,
> however i have always an exception, here is what i did:
> ad.show();
>        try {
>                MediaPlayer mt = MediaPlayer.create(context,R.raw.ringtone);
>            mt.setVolume(5,5);
>          mt.start();
>          mt.setLooping(true);
>                }
>                catch(Exception e)
>                {
>                        Log.d("erreur sonnerie","erreur",e);
>                }
>
> After showing the AlertDialog(ad.show() ) the ringtone is normally
> launched.
>
> Here is the Log:
>
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893): erreur
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):
> android.content.res.Resources$NotFoundException: File res/raw/ringtone
> from drawable resource ID #0x7f05
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> android.content.res.Resources.openRawResourceFd(Resources.java:860)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> android.media.MediaPlayer.create(MediaPlayer.java:662)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> com.sip_communicator.Dialog.répondre(Dialog.java:101)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> com.sip_communicator.IncomingCallReceiver.onReceive(IncomingCallReceiver.java:
> 28)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:709)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> android.os.Handler.handleCallback(Handler.java:587)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> android.os.Handler.dispatchMessage(Handler.java:92)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> android.os.Looper.loop(Looper.java:123)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> android.app.ActivityThread.main(ActivityThread.java:3683)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> java.lang.reflect.Method.invoke(Method.java:507)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:839)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> dalvik.system.NativeStart.main(Native Method)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893): Caused by:
> java.io.FileNotFoundException: This file can not be opened as a file
> descriptor; it is probably compressed
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> android.content.res.AssetManager.openNonAssetFdNative(Native Method)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> android.content.res.AssetManager.openNonAssetFd(AssetManager.java:427)
> 04-27 00:55:07.658: DEBUG/erreur sonnerie(893):     at
> android.content.res.Resources.openRawResourceFd(Resources.java:857)
>
>
> The ringtone is .ogg file .
> What could me the problem ?
>
> Thank you very much.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, 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] webview form reading

2011-04-27 Thread Miguel Morales
what data?

On Wed, Apr 27, 2011 at 4:22 PM, bob  wrote:

> I load a form into a WebView, but I don't know how to read the data
> from it.  Anyone know how?
>
> 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




-- 
~ Jeremiah:9:23-24
Android 2D MMORPG: http://solrpg.com/,
http://www.youtube.com/user/revoltingx

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] webview form reading

2011-04-27 Thread bob
I load a form into a WebView, but I don't know how to read the data
from it.  Anyone know how?

Thanks.


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


[android-developers] Re: Activity Lifecycle Documentation Question

2011-04-27 Thread Eric


On Apr 27, 6:44 pm, Dianne Hackborn  wrote:
> Also it may be worth mentioning -- there was a significant change to the
> activity lifecycle in 3.0 where onStop() is now guaranteed to be killed
> (prior to killing a process) like onPause() has always been.

I am glad this change was made, it makes more logical sense to me to
do it this way.  Hopefully the documentation can also be updated to
remove any doubt whatsoever that an Activity cannot possibly be
'removed' from memory in low-memory situations (when the process is
_not_ killed), that would result in an inconsistent or leak state by
not having balanced lifecycle methods called.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Activity Lifecycle Documentation Question

2011-04-27 Thread Mark Murphy
On Wed, Apr 27, 2011 at 6:44 PM, Dianne Hackborn  wrote:
> Also it may be worth mentioning -- there was a significant change to the
> activity lifecycle in 3.0 where onStop() is now guaranteed to be killed
> (prior to killing a process) like onPause() has always been.

Just to clarify, shouldn't that read:

> Also it may be worth mentioning -- there was a significant change to the
> activity lifecycle in 3.0 where onStop() is now guaranteed to be **called**
> (prior to killing a process) like onPause() has always been.

?

Thanks!

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

_Android Programming Tutorials_ Version 3.3 Available!

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


Re: [android-developers] Re: Activity Lifecycle Documentation Question

2011-04-27 Thread Dianne Hackborn
Hopefully I can clearly confirm what is actually happening.  There are only
two ways your entire activity instance can go away:

1. At some point the activity lifecycle completing and onDestroy() being
called.
2. The process being killed.

Thus you will not have a resource leak if you release the resources in
onStop() or onDestroy().  Generally you pair onCreate() with onDestroy(),
onStart() with onStop(), and onResume() with onPause().  You can however do
variations if you are careful such as allocating in onStart() (if not
already allocated) and releasing in onDestroy().

Also it may be worth mentioning -- there was a significant change to the
activity lifecycle in 3.0 where onStop() is now guaranteed to be killed
(prior to killing a process) like onPause() has always been.  In fact if you
are targeting API 11 or greater, you will find onSaveInstanceState() now
being called between onPause() and onStop().

On Wed, Apr 27, 2011 at 6:14 PM, Mark Murphy wrote:

> On Wed, Apr 27, 2011 at 5:55 PM, Eric  wrote:
> > Android is allowed to 'clean up'
> > your activity right after onPause(), without killing the app, if it
> > wants to reclaim memory.
>
> By finishing the activity, thereby triggering the
> onPause()/onStop()/onDestroy() triad. If the activity is paused,
> finishing it will merely do onStop() and onDestroy().
>
> > I don't see that in the documentation I read.
>
> Documentation has gaps.
>
> If you can create a sample application that demonstrates that you're
> correct, please post it.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 3.3 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
>



-- 
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: How can we get the mobile position (e.g. by gps) all the time?

2011-04-27 Thread Maps.Huge.Info
A more ideal method would be to use C2DM to occasionally ping the
device for a location fix. That way a service wouldn't need to be
constantly running.

-John Coryat

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Activity Lifecycle Documentation Question

2011-04-27 Thread Mark Murphy
On Wed, Apr 27, 2011 at 5:55 PM, Eric  wrote:
> Android is allowed to 'clean up'
> your activity right after onPause(), without killing the app, if it
> wants to reclaim memory.

By finishing the activity, thereby triggering the
onPause()/onStop()/onDestroy() triad. If the activity is paused,
finishing it will merely do onStop() and onDestroy().

> I don't see that in the documentation I read.

Documentation has gaps.

If you can create a sample application that demonstrates that you're
correct, please post it.

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

_Android Programming Tutorials_ Version 3.3 Available!

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


Re: [android-developers] Re: Activity Lifecycle Documentation Question

2011-04-27 Thread TreKing
On Wed, Apr 27, 2011 at 4:55 PM, Eric  wrote:

> It means the activity can be destroyed after onPause() by the system
> calling 'finish()' on it.
>

calling finish() will result in onStop() -> onDestory() when in the paused
stated.

It seems to me, in that specific case, if you've started another
> activity from the current activity, and right after your onPause() was
> called, Android decides 'finish' your activity due to memory constraints,
> I don't see anything in the documentation that says Android can't 'finish'
> your activity right there on the stop, thereby bypassing the call to
> onStop(), and going directly into onDestroy().
>

Where does it say the system "bypasses" onStop() and goes directly to
onDestroy()?


> In this case, the process would still be running, your activity would be
> "paused", archived, and 'destroyed', but never 'stopped'.
>

No. The flow is pause -> stop -> destroy. There is no random skipping
about.


> You say 'onStop()' will _definitely_ be called.  I don't see that in the
> documentation I read.
>

Look at the pretty graph - it pretty clearly indicates the only way to
onDestroy() is from onStop().


Honestly, I think you're over-thinking this and confusing yourself.

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

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

[android-developers] Re: Activity Lifecycle Documentation Question

2011-04-27 Thread Streets Of Boston
The text of the documentation says you're right. A call to 'finish()' is all 
that could happen to 'destroy' the activity. No killing of the process is 
necessary.
 
However, the image in the documentation (
http://developer.android.com/images/activity_lifecycle.png  inside 
http://developer.android.com/guide/topics/fundamentals/activities.html) 
states that the 'process is killed' when it skips the onStop or onDestroy.

In my experience, the image is correct, the text is not correct. I have not 
seen any Activity in my apps whose onStop/onDestroy is not called without it 
being killed through a kill of the process. But i could be wrong...



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

Re: [android-developers] Re: Activity Lifecycle Documentation Question

2011-04-27 Thread Mark Murphy
On Wed, Apr 27, 2011 at 6:04 PM, Eric  wrote:
> From the Activity documentation:
>
> http://developer.android.com/guide/topics/fundamentals/activities.html
>
> If an activity is **paused or stopped**, the system can drop it from
> memory either by asking it to finish (calling its finish() method), or
> simply killing its process. When the activity is opened again (after
> being finished or killed), it must be created all over.

An activity in the paused state, when finished, goes through onStop()
and onDestroy().

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

_Android Programming Tutorials_ Version 3.3 Available!

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


[android-developers] Re: Activity Lifecycle Documentation Question

2011-04-27 Thread Eric
>From the Activity documentation:

http://developer.android.com/guide/topics/fundamentals/activities.html

If an activity is **paused or stopped**, the system can drop it from
memory either by asking it to finish (calling its finish() method), or
simply killing its process. When the activity is opened again (after
being finished or killed), it must be created all over.


On Apr 27, 5:55 pm, Eric  wrote:
> On Apr 27, 4:45 pm, Mark Murphy  wrote:
>
> > On Wed, Apr 27, 2011 at 4:22 PM, Eric  wrote:
> > > You then navigate to a new activity by starting it.
>
> > Which triggers onPause() and onStop() on the original activity.
>
> This is where I disagree with you.  Android is allowed to 'clean up'
> your activity right after onPause(), without killing the app, if it
> wants to reclaim memory.  The Activity lifecycle documentation says
> the Activity is 'killable' after onPause(), which technically doesn't
> mean the process must be 'killed'.  It means the activity can be
> destroyed after onPause() by the system calling 'finish()' on it.  It
> seems to me, in that specific case, if you've started another activity
> from the current activity, and right after your onPause() was called,
> Android decides 'finish' your activity due to memory constraints, I
> don't see anything in the documentation that says Android can't
> 'finish' your activity right there on the stop, thereby bypassing the
> call to onStop(), and going directly into onDestroy().  In this case,
> the process would still be running, your activity would be "paused",
> archived, and 'destroyed', but never 'stopped'.  You say 'onStop()'
> will _definitely_ be called.  I don't see that in the documentation I
> read.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 Documentation Question

2011-04-27 Thread Eric


On Apr 27, 4:45 pm, Mark Murphy  wrote:
> On Wed, Apr 27, 2011 at 4:22 PM, Eric  wrote:
> > You then navigate to a new activity by starting it.
>
> Which triggers onPause() and onStop() on the original activity.

This is where I disagree with you.  Android is allowed to 'clean up'
your activity right after onPause(), without killing the app, if it
wants to reclaim memory.  The Activity lifecycle documentation says
the Activity is 'killable' after onPause(), which technically doesn't
mean the process must be 'killed'.  It means the activity can be
destroyed after onPause() by the system calling 'finish()' on it.  It
seems to me, in that specific case, if you've started another activity
from the current activity, and right after your onPause() was called,
Android decides 'finish' your activity due to memory constraints, I
don't see anything in the documentation that says Android can't
'finish' your activity right there on the stop, thereby bypassing the
call to onStop(), and going directly into onDestroy().  In this case,
the process would still be running, your activity would be "paused",
archived, and 'destroyed', but never 'stopped'.  You say 'onStop()'
will _definitely_ be called.  I don't see that in the documentation I
read.

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


[android-developers] Re: How can we get the mobile position (e.g. by gps) all the time?

2011-04-27 Thread lbendlin
Sorry I may not have been clear enough. I was more thinking of using the 
accelerometer as a motion sensor, to restore the power to the GPS after it had 
been cut due to lack of location events or changes. 

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: car dock mode

2011-04-27 Thread Dianne Hackborn
ACTION_DOCK_EVENT is about the device being placed in a dock.  Calling that
API puts the device in to car mode, but that doesn't cause it to be placed
in to a dock.

On Wed, Apr 27, 2011 at 3:29 PM, mort  wrote:

> > Additionally: Is there a way to emulate thedockmodes? I only found
> > some old tools that stopped working since Android 2.2.
>
> Little update: I tried to emulate at least the car dock mode with
> UiModeManager.en-/disableCarMode(). I get the steering wheel in the
> notification bar and a "Config changed" log entry, but
> ACTION_DOCK_EVENT doesn't seem to be sent. At least there's no log
> entry, and no receiver is invoked, no matter if I register it in my
> Activity or Service or use a static intent-filter in
> AndroidManifest.xml. The car home doesn't get invoked as well. Is this
> always the case or just a device/ROM specific bug (Nexus S with CM7)?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, 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: Activity Lifecycle Documentation Question

2011-04-27 Thread Mark Murphy
On Wed, Apr 27, 2011 at 4:53 PM, Streets Of Boston
 wrote:
> Be very careful with cleaning up some resources in onPause. A dialog being
> shown could put your activity into paused-state, but not into stopped-state.
> This happens when a system dialog pops up (e.g. an activity chooser) and
> your activity is still visible in the background (blurred, but still
> visible). You may not want to clean up certain resources while your activity
> is paused but still visible.

Technically, these are dialog-themed activities, which is why
onPause() is called. onStop() is not called because the underlying
activity is still visible.

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

_Android Programming Tutorials_ Version 3.3 Available!

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


Re: [android-developers] Re: Activity Lifecycle Documentation Question

2011-04-27 Thread Streets Of Boston
Be very careful with cleaning up some resources in onPause. A dialog being 
shown could put your activity into paused-state, but not into stopped-state. 
This happens when a system dialog pops up (e.g. an activity chooser) and 
your activity is still visible in the background (blurred, but still 
visible). You may not want to clean up certain resources while your activity 
is paused but still visible. 

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 Documentation Question

2011-04-27 Thread Streets Of Boston
The text and the diagram of the link you showed are indeed not saying the 
same:

   - The diagram only shows a direct path out of onPause or onStop only when 
   the process is being killed.
   - The text says that the framework can just call 'finish' on the activity 
   (without going through onDestroy). I must say that i *never *have seen 
   this happen. The only time that onDestroy/onStop is not called at some point 
   in time is when the process is being killed.
   

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Activity Lifecycle Documentation Question

2011-04-27 Thread Mark Murphy
On Wed, Apr 27, 2011 at 4:22 PM, Eric  wrote:
> You then navigate to a new activity by starting it.

Which triggers onPause() and onStop() on the original activity.

 Your
> activity gets paused.  Android can 'finish' your activity at this
> point, WITHOUT killing the process.

Which triggers onDestroy() on the original activity.

> In
> that case, the thread you started in onStart will still be running.

Only if developer did not stop the thread in onPause(), onStop(), or
onDestroy().

> I think it makes much more sense for the documentation to clarify
> this, and recommend that people do all auxiliary setup/cleanup in
> onResume/onPause, and nowhere else.

You are welcome to think what you want. And, as I noted, it's not a
bad idea to tend towards onPause() and onStop(). However, there is
nothing directly wrong with waiting until onDestroy() to shut down a
background thread, and there may be perfectly valid reasons for
keeping that thread around as long as possible (e.g., chat client
maintaining a socket connection to a chat server).

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

_Android Programming Tutorials_ Version 3.3 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


  1   2   3   >