Re: [android-developers] Hard Crash (Reboot) in 3.2

2011-08-02 Thread Dianne Hackborn
Thanks, I've filed a bug.

On Tue, Aug 2, 2011 at 10:45 AM, Joshua Smith joshuaesm...@charter.netwrote:

 Update: We've created a small reproducible test case.  Run this code for an
 hour (usually less) on a XOOM with 3.2 and you will reboot.

 We haven't gotten lucky enough to get a log, so we cannot be absolutely
 certain that this reboot is the same one we're hitting, but it probably is.

 Who do I send this to?

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

2011-08-01 Thread Dianne Hackborn
It is actually 1MB.  The most common reason for this error is a too large
IPC.  As a quick test, you could try removing half the bitmaps or so and see
if it works.  If so, the issue is almost certainly an IPC that is too large.
 If that is the case, you just need to reduce the amount of data being sent
over.

On Mon, Aug 1, 2011 at 8:18 AM, Kostya Vasilyev kmans...@gmail.com wrote:


 01.08.2011 19:02, Ash McConnell пишет:

  Hi Kostya,

 It's not that the single bitmap is too large, it's that I'm updating quite
 a few bitmaps. The biggest bitmap in PNG form (a lot smaller I know) is only
 4KB. I am updating 14 ImageViews in each update. Is there any way to split
 the update for each widget instance somehow?


 Binder data size limit is 512K, IIRC, so it should be enough for the
 update.

 Are you sure the failed transaction is not caused by bad data in
 RemoteViews (references to views that don't exist, etc.) that cause the
 remote side (Launcher) to crash?



 What are the other methods to push a bitmap into a widget? Anything I
 could search for?


 ImageView can grab images from a Uri, and supports content:// and file://
 style Uris.

 -- Kostya



 Thanks for your help!
 All the best,
 Ash


 --
 Kostya Vasilyev


 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to 
 android-developers@**googlegroups.comandroid-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/android-developers?hl=enhttp://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] Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

2011-08-01 Thread Dianne Hackborn
Those files aren't be accessed by you, they are being opened by another app
(the launcher) when it applies your RemoteViews to the widget it is
displaying.

On Mon, Aug 1, 2011 at 9:23 AM, Ash McConnell ash.mcconn...@gmail.comwrote:

 Hi Kostya / Dianne,

 Thanks for the replies.  As Dianne suggested, removing half the bitmaps
 does indeed make it work.

 I can't really reduce the amount of bitmaps, so I am trying to use the
 setImageURI on ImageView.  Unfortunately I am getting permission denied
 errors.

 Here is the test code I used: -

 File file = new
 File(context.getFilesDir().getAbsolutePath() +
 /skins/Minimal/flight_on.png);
 if (file.exists()){
  Uri uri = Uri.fromFile(file);
 Log.i(LOGTAG, uri.toString());
 views.setUri(R.id.buttonSound, setImageURI, uri);
  }


 The file *does* exist and I get the following log message: -

 08-01 17:19:20.304: INFO/WidgetTest(4563):
 file:///data/data/sirocco.widgets/files/skins/Minimal/flight_on.png

 I didn't think I would have permission problems with the widget's own
 files.  Is there a problem with accessing these files from a widget
 (actually a private service class within the widget)?

 Thanks again for your help
 All the best,
 Ash

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

2011-08-01 Thread Dianne Hackborn
You can't do this, and it is very much a feature that you can't do this.

On Mon, Aug 1, 2011 at 10:41 AM, Priyank priyankvma...@gmail.com wrote:

 Thanks for the reply.
 I wanted to do something similar. I wanted to save some information on
 the phone, but when the user selects Clear Data, the information
 needs to persist. I dont mind the information getting deleted if the
 user uninstalls the application.
 I tried saving the information in a file in the internal memory (data/
 data/com.test/files/FILENAME using openFileOutput(FILENAME,
 Context.MODE_PRIVATE)) but still the file gets deleted on pressing
 Clear Data. I do not want to save the file in the SD card.
 Is there any way I can do that.

 Any help would be appreciated.

 Thanks,
 Priyank

 On Jul 26, 1:24 pm, Chris Stratton cs07...@gmail.com wrote:
  On Tuesday, July 26, 2011 1:17:42 PM UTC-4, Priyank wrote:
 
   I saw a few posts which said that even though we add this line in the
   manifest file, we are not able to disable the Clear Data button for an
   application.
   I tried it in 2.2, 2.3 and 3.0 and was not able to disable that
   button. Am I doing anything wrong or is there any other method to do
   this.
 
  Apparently that was only ever available for system applications, and is
 also
  broken in some versions.  This would be consistent with the android
 design
  goal of not letting 3rd party apps make semi-permanent changes to the
  device.  Even if it did work, removing and re-installing the application
  would get around it.
 
  See:
 https://groups.google.com/d/msg/android-developers/sQkfGQ9zVrc/AT98os...

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Service or Thread for accelerometer monitoring?

2011-08-01 Thread Dianne Hackborn
Thread or service is not generally a decision -- they are two different
things, for different purposes.  A thread lets you do work off of the main
UI thread.  A service lets you tell the system to try to keep your process
around instead of killing it in the background.

On Mon, Aug 1, 2011 at 2:08 PM, Fred Niggle fred.nig...@googlemail.comwrote:

 Hello,

 I am stuck with making a decision and I could use some expert help.

 I have a need to monitor motion, either with the compass or
 accelerometer to ensure that someone is safe.

 I have code which works really well when using the accelerometer, BUT
 it can suck a battery flat in around 30 minutes.

 To help mitigate this i am considering a 'duty-cycle- of 1 minute on,
 and 1 minute off - so should straight away be on to a 50% increase in
 battery life, and later I'll refine this.

 Im developing for api 7 (2.1 eclair) and while I have some programming
 experience, i need guidance on which route to follow to enable the
 duty-cycle usage of the accelerometer.

 One avenue of research indicates that using threads is the way to go -
 however since threads can be killed off with the main UI (screen goes
 to sleep, etc), so i'm leaning towards using a service which can I can
 START_STICKY.

 Which route do you recommend?
 Thread or Service?

 Regards,
 Fred

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

2011-08-01 Thread Dianne Hackborn
No that isn't true.  It is the C2DM mechanism.  Android since 1.0 has had a
single constant connection to google services to receive tickles when
there are things to do -- single email or contacts, etc.  One of the tickles
is to perform app downloads.  This is the exact same mechanism the C2DM is.
 It has been there since 1.0 for the Google applications, and was only ready
to be exposed to third party developers in Froyo.

(Also fwiw this is technically not part of the Android platform itself, but
proprietary features that Google supplies to developers on top of the
platform.)

On Mon, Aug 1, 2011 at 7:06 PM, Nikolay Elenkov
nikolay.elen...@gmail.comwrote:

 On Tue, Aug 2, 2011 at 10:47 AM, Paul Turchenko
 paul.turche...@gmail.com wrote:
  It's push. Android market (vending process on your device) keeps
  passive connection with Android Market server. Same way Gmail app
  works. This is why email delivery is instant.
 

 Interesting. Do you have any more details about this? Since
 it doesn't work if you are not logged in to Google Talk,
 I always thought it uses some sort of XMPP notification.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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: ActionBar/Mode Style Regressions with SDK 12r2 and 13r1

2011-07-29 Thread Dianne Hackborn
Yes, that is terrible, and pretty much guaranteed to break.

On Mon, Jul 18, 2011 at 6:54 AM, dmitry.lukas...@gmail.com 
dmitry.lukas...@gmail.com wrote:

 I've found only one way to change default search view icon:-) But this is
 terrible solution

 SearchView sv = new SearchView(mActivity);
 sv.setOnQueryTextListener(mOnSearchQueryTextListener);
 menuItemSearch.setActionView(sv);
 searchViewChangeHack(sv);

 private static int sViewIndex = 0;

 private void searchViewChangeHack(ViewGroup sv) {
 for (int i = 0; i  sv.getChildCount(); i++) {
 View v = sv.getChildAt(i);
 if (v instanceof ViewGroup) {
 searchViewChangeHack((ViewGroup)v);
 } else if (v instanceof ImageView) {
 if (sViewIndex == 0 || sViewIndex == 1) {
 ((ImageView)
 v).setImageResource(R.drawable.common_bar_search);
 }
 sViewIndex++;

 }
 }
 }

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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 can we keep a particular application on the top always

2011-07-29 Thread Dianne Hackborn
What I am saying is you shouldn't use an activity, you should go modify the
SystemUI code to introduce your window there in the same way the status bar
is done.

On Thu, Jul 28, 2011 at 10:37 PM, trickybit jmack...@gmail.com wrote:

 Is there a way for an activity to specify the type of its main window,
 in time for it to matter?

 Thanks

 On Jul 28, 12:11 pm, Dianne Hackborn hack...@android.com wrote:
  I suggest looking at the SystemUI process
  (frameworks/base/packages/SystemUI), which is responsible for showing the
  status bar and extending as desired.
 
  First question you will need to answer is what layer your UI goes in to:
  above everything including the lock screen, above the system bar /
  notifications, above toasts, just above apps.  It is likely you will need
 to
  define a new private window type with its own layer (assigned in
  PhoneWindowManager) to get it z-ordered where you want.
 
 
 
 
 
 
 
 
 
  On Thu, Jul 28, 2011 at 1:32 AM, Ankit ank82...@gmail.com wrote:
   Hi ,
   I want to keep my application ( Application A ) on the top always in
   Android.  Application A is not a full screen  application, it is a
   floating window or dialog theme based application. The Application A
   can launch other application.\ from its own UI portion also other
   applications can be launched from background from Home screen
   shortcut / Application Launcher screen.
   How can we do it?
 
   Also the application which are in the background with Application A on
   top should work normally. e.g. it can Launch other activities (of it
   own own or some other application), dialog etc.
 
   Second doubt/ requirement  is -  Activity Y is below Activity X,
   Activity X is below Activity A (of Application A) . Activity X has a
   close/exit button which would finish its own activity X. Now when that
   button is pressed the activity get closed but leaves a black screen
   below activity A.
 
   Why does this happen (i think may be because it requires the Back
   stack to be rearranged)  and is their a turn around way of being able
   to do this.
 
   If any  application in the background  launches another activity/
   application then also my application ( Application A ) should come at
   the top of the launched activity/application.
 
   Thanks ,
   Ankit
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, 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: ActionBar/Mode Style Regressions with SDK 12r2 and 13r1

2011-07-29 Thread Dianne Hackborn
Sorry at this point you can't customize it like that.  If you seriously
can't live with the standard style, you'll need to make your own.

On Thu, Jul 28, 2011 at 11:42 PM, dmitry.lukas...@gmail.com wrote:

 My concern is why I can easily change android:actionOverflowButtonStyle...
 and cannot do the same with search icon. Gray search icon is not acceptable
 for our brand style... so default action bar became useless for us, and we
 should create custom bar for tablet that is ridiculous:)

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

2011-07-29 Thread Dianne Hackborn
You don't need to be a fragment to participate in the action bar tabs, they
just let you do that as a convenience.  They are just calling back to you
when the tabs are changed.  They make it easy to at that point switch
fragments, but you can just as well switch views.

I'd prefer to not start introducing dependencies on fragments for doing
basic UI stuff.  The app package has always been layered on top of view and
widget, and that is a good thing.

On Thu, Jul 28, 2011 at 9:30 AM, Mark Murphy mmur...@commonsware.comwrote:

 On Thu, Jul 28, 2011 at 12:26 PM, nadam a...@anyro.se wrote:
  Another option is to skip the ListFragment and use a ListView directly
  instead. You only need to use ListFragment if the same list (and
  related logic) should be displayed in two different activities.

 Or if the list needs to be a Fragment for other reasons (e.g., to
 participate in the tab navigation in the action bar). Right now, there
 are few of these, but I suspect that there will be more of those
 Fragment dependencies in the future.

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

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

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




-- 
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] Pain taking db reads off UI thread

2011-07-29 Thread Dianne Hackborn
Consider using loaders, for example:

http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/LoaderCursorSupport.html

On Fri, Jul 29, 2011 at 9:23 AM, Julius Spencer jul...@msa.co.nz wrote:

 Hi,

 I have been trying to take database reads off the UI thread and am
 currently using an AsyncTask, however I am running into trouble swapping out
 an updated Cursor for a new one in the adapter.
 (I was previously using requery() on the Cursor which had to be on the main
 UI thread)

 The documentation regarding requery() says:
 Just request a new cursor, so you can do this asynchronously and update
 your list view once the new cursor comes back.

 If I update the existing Cursor (mCursor) with the results from a new query
 and do the following in onPostExecute of an AsyncTask:

mAdapter.changeCursor(mCursor);

 it works pretty well on a Nexus 1.  On other devices I am getting errors
 because I haven't closed the old Cursor.
 (java/lang/IllegalStateException;: Finalizing cursor
 android.database.sqlite.SQLiteCursor on null that has not been deactivated
 or closed)

 I have tried creating a new Cursor and swapping the Cursors out like so:

if(null!=mArtists)
mCursor.close();
mArtists = newCursor;

 but I get performance issues and the view of the list goes back to the top.

 Has anyone got any ideas on this?  Alternatively does anyone have or know
 of any documentation for using a CursorLoader against a SQLiteDatabase
 rather than a ContentProvider?

 Thanks for any help.

 Regards,
 Julius.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] How can we keep a particular application on the top always

2011-07-28 Thread Dianne Hackborn
I suggest looking at the SystemUI process
(frameworks/base/packages/SystemUI), which is responsible for showing the
status bar and extending as desired.

First question you will need to answer is what layer your UI goes in to:
above everything including the lock screen, above the system bar /
notifications, above toasts, just above apps.  It is likely you will need to
define a new private window type with its own layer (assigned in
PhoneWindowManager) to get it z-ordered where you want.

On Thu, Jul 28, 2011 at 1:32 AM, Ankit ank82...@gmail.com wrote:

 Hi ,
 I want to keep my application ( Application A ) on the top always in
 Android.  Application A is not a full screen  application, it is a
 floating window or dialog theme based application. The Application A
 can launch other application.\ from its own UI portion also other
 applications can be launched from background from Home screen
 shortcut / Application Launcher screen.
 How can we do it?

 Also the application which are in the background with Application A on
 top should work normally. e.g. it can Launch other activities (of it
 own own or some other application), dialog etc.

 Second doubt/ requirement  is -  Activity Y is below Activity X,
 Activity X is below Activity A (of Application A) . Activity X has a
 close/exit button which would finish its own activity X. Now when that
 button is pressed the activity get closed but leaves a black screen
 below activity A.

 Why does this happen (i think may be because it requires the Back
 stack to be rearranged)  and is their a turn around way of being able
 to do this.

 If any  application in the background  launches another activity/
 application then also my application ( Application A ) should come at
 the top of the launched activity/application.

 Thanks ,
 Ankit

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

2011-07-27 Thread Dianne Hackborn
You can't.  You'll notice that nowhere in the standard platform as shipped
on Xoom does it disappear.  There is no facility to make it disappear.  To
be able to do this, you would need to take the platform and modify the code
that displays the system bar to have an API that only your trusted app can
call to make it disappear.

On Wed, Jul 27, 2011 at 6:26 AM, RichardLalancette.Blogspot.com 
richard.lalance...@gmail.com wrote:

 I really need to find a way to hide and show the bottom bar.
 Our app needs to take over the entire screen.

 Please advise on a way to do so if you know, even if it means not
 using the regular SDK.

 On Jul 21, 8:51 pm, Dianne Hackborn hack...@android.com wrote:
  No.
 
  We shouldn't let you force stop the system UI, either.
 
  On Thu, Jul 21, 2011 at 12:02 AM, chibinho chibinho1...@gmail.com
 wrote:
   Hi, everyone. Android 3.0 status bar is always appear . And I find it
   can be disappear when use setting  system ui  force close. May I
   develop an app which can auto force close the system ui ? Does Android
   have provide this API?
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, 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: SurfaceView#setZOrderMediaOverlay(true) not working as expected

2011-07-27 Thread Dianne Hackborn
Well it is too bad we made that API public. :p

You can use adb shell dumpsys window to see the windows in the window
manager, to see how your windows have been Z-ordered.  Also be sure you are
setting this property before the SurfaceView is attached to its window, and
never changing it.

On Tue, Jul 26, 2011 at 10:51 PM, Shri shri.bo...@gmail.com wrote:

 I am occasionaly seeing this on Nexus S Gingerbread MR1 as well. Is
 this a bug in setZOrderMediaOverlay?

 On Jul 13, 2:09 pm, Shri shri.bo...@gmail.com wrote:
  I have a small screen camera preview being shown on top of a larger
  video (see layout at the end). I use
  SurfaceView#setZOrderMediaOverlay(true) on the small camera preview,
  and this works most of the time. However, occasionally, the camera
  preview is not fully displayed. Only the part of it not blocked by the
  larger video view is displayed, while the 5dip black border *is* fully
  displayed on top of the large video.
 
  So it seems like SurfaceView#setZOrderMediaOverlay(true) is not
  working as expected. My understanding of the API is that it guarantees
  that the SurfaceView will be displayed on top of other SurfaceViews.
 
  I do not want to use #setZOrderOnTop as I do want to overlap the
  camera preview with some icons, and using #setZOrderOnTop(true) would
  cause the camera preview to display on top of the overlay icons.
 
  Any idea why #setZOrderMediaOverlay(true) misbehaves occasionally? I
  am on Honeycomb MR1 on Motorola Xoom.
 
  Thanks,
  Shri
 
  RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
  android
android:orientation=horizontal
android:layout_width=match_parent
android:layout_height=match_parent
 
  SurfaceView
android:id=@+id/some_video
android:layout_width=match_parent
android:layout_height=match_parent /
 
  !-- Camera preview border --
  RelativeLayout
android:id=@+id/camera_preview_and_overlays
android:layout_width=100dip
android:layout_height=50dip 
!-- Camera preview. #setZOrderMediaOverlay(true) will be called
  for this. --
SurfaceView
  android:id=@+id/camera_preview
  android:layout_width=match_parent
  android:layout_height=match_parent/
ImageView
  android:id=@+id/overlay_icon
  android:layout_width=match_parent
  android:layout_height=match_parent/
 
  /RelativeLayout
  /RelativeLayout

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Using Options Menu in a multi-Fragment Activity

2011-07-27 Thread Dianne Hackborn
You will need to have the activity populate the options menu and call to the
current fragment when an item is selected.

On Tue, Jul 26, 2011 at 3:39 PM, Sam sam.oak...@blork.co.uk wrote:

 I have a FragmentActivity which hosts a FragmentStatePagerAdapter. The
 pager contains multiple instances of the same fragment, in order that
 the user can swipe between the items in a list. I want to be able to
 provide the user with an options menu which will act only on the
 visible item.

 For example, I have a list of images displayed in imageviews inside
 fragments. I want an option menu item allowing the user to set the
 image as their wallpaper.

 At the moment when I try this, when onPrepareOptionsMenu is called,
 the code is called in multiple fragments (usually the current + next
 one). The same when an item is selected. This causes the wrong image
 to be set as the wallpaper.

 How can I prevent the options menu triggering for more than the
 currently visible fragment?

 Question also posted to StackOverflow:

 http://stackoverflow.com/questions/6831544/using-options-menu-in-a-multi-fragment-activity

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Turning off all of the APPS running in the background or setting the highest priority on my APP!!!

2011-07-26 Thread Dianne Hackborn
android:priority is for IntentFilter matching, it has nothing to do with
thread priority.  Also third party apps can't get an android:priority  0.

On Tue, Jul 26, 2011 at 10:37 AM, Sebastian Tomaszewski 
stomasze101...@gmail.com wrote:

 Hello Mark,
 Thank you for your reply, I greatly appreciate it.
 Fortunately...come on...  :)... I guess there is a reason behinid it
 is there?
 So does that mean that android:priority=*2147483647* didn't do anything
 for me in my Manifest.   I read somewhere that this could have helped?... A
 little bit confused here, but maybe I might have misread this...

 http://developer.android.com/guide/topics/manifest/intent-filter-element.html#priority

 Nevertheless, would the application that is running be considred as
 Foreground Process?  Please let me know.

 Thank you and Best Regards,


 Sebo

 On Tue, Jul 26, 2011 at 4:20 AM, Mark Murphy mmur...@commonsware.comwrote:

 On Fri, Jul 22, 2011 at 8:31 PM, Sebo stomasze101...@gmail.com wrote:
  Quick question, do you know if there is a way to turn off any APPS
  that run in the background (e-mail/GPS...), so my application while it
  is running won't be interrupted at all(Except for the OS of
  course)?

 Fortunately, this is not possible.

  OR is there a way to tell when my application starts that my APP is
  the highest prioiryt in the whole system?

 The foreground process is already the highest prioiryt [sic] in the
 whole system.

    I tried setting my
  Acitivity prioity (In the Manifest) to the highest possible and that
  didn't work that well.

 There is no Acitivity prioity (In the Manifest).

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

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

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


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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: My service never runs more than few ours while other services run for days

2011-07-26 Thread Dianne Hackborn
It is very likely that the other services are also being killed and
restarted.  If you look at the uptime in Running Services, this is the time
since the service was *originally* started.  That is, how long it has been
*wanting* to run without break.  If it gets killed and restarted by the
system, that time doesn't break.

In fact in the current implementation, after a service has been running
continually for around 1/2 hour, it gets dropped down into the background
process LRU list to make sure it eventually gets killed and restarted.  We
don't want services sitting there running for days with memory leaks and
eventually eating away all of the RAM that we'd like to use for caching
background processes. :)

On Tue, Jul 26, 2011 at 1:18 PM, Indicator Veritatis mej1...@yahoo.comwrote:

 Your advice is certainly sound, but I can sympathize with the OP's
 Service envy, thinking that his Service should also be able to
 persist for days like certain others.

 Then again, since he is talking about taking up as much as 10MB, he
 should not be surprised that his gets killed more often than the
 others. Any service that is going to persist for so long has to be
 MUCH more lightweight than that, unless it is a system service.

 BTW: there has got to be a better way to do this than wait forever for
 incoming TCP PDUS: somebody in this group once mentioned WebTCP,
 though it was never clear to me how that solves the problem.

 On Jul 26, 8:39 am, TreKing treking...@gmail.com wrote:
  On Fri, Jul 22, 2011 at 10:03 PM, scmailon scmai...@gmail.com wrote:
   Any idea suggestion is very wellcome :)
 
  Don't attempt to keep you service alive indefinitely - it can and will be
  killed when necessary. Instead, code it to take this reality into
 account.
 
 
 -
  TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
  transit tracking app for Android-powered devices

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




-- 
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] Issue with screen layout in 3.2

2011-07-25 Thread Dianne Hackborn
If you are in compatibility mode, it is obvious because your entire UI is
scaled up using bitmap scaling.

If you aren't sure, don't say you support xlarge screens, and use the button
at the bottom to switch between compatibility and normal modes.

By default unless you explicitly say you don't support large screens, you
will *not* be run in compatibility mode but the button will be available for
the user to switch compatibility mode on.

I don't think your issue is related to compatibility mode, but there isn't
enough  information provided to help diagnose further.

On Mon, Jul 25, 2011 at 1:58 PM, Vector-Code gkvector...@gmail.com wrote:

 Upon the release of SDK 13, I tested my application against the new
 version and was distressed to find that it was no longer laying out
 properly in HC 3.2. I checked the documentation, found the new
 compatibility mode and added the xlargeScreens=true element to my
 manifest.

 This did not correct the problem.

 Even with the added tag, my application lays out exactly as if I had
 not added the tag, although the compatibility button is no longer
 present.

 The specific problem is that a subview within my application should be
 approximately 2 inches wide by 3.5 inches tall. Under versions 3.0 and
 3.1, it lays out just this way. Under 3.2, however, in landscape mode,
 the subview matches the height of the screen. In portrait mode, the
 size of the subview is correct, but the children within it are not
 positioned correctly.

 How can I TRULY disable compatibility mode.

 BTW, I also cannot get a cursor or highlight text in an edittext in
 any version of HC even though I've specificly requested them.

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




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

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

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

[android-developers] For a good time...

2011-07-25 Thread Dianne Hackborn
(1) Get a Xoom running Android 3.2.
(2) Get an Apple Magic Trackpad.
(3) Pair the trackpad to the Xoom.
(4) Have a good time!

I bring this up partly because I think it is cool (and all thanks go to Jeff
for the feature), but also because if you are wondering as developers how in
the future you may need to modify your app to work on devices without a
touch screen...  well, the answer may be not much at all. ;)

This is also the motivation for new feature constants like
http://developer.android.com/reference/android/content/pm/PackageManager.html#FEATURE_FAKETOUCH_MULTITOUCH_DISTINCTsince
a non-touch device that includes a multi-touch trackpad can provide
basically full interaction with Android's touch UI for many typical apps.
 If you don't need direct interaction (such as needed to touch game control
buttons or draw figures on the screen), a multitouch trackpad can provide a
quite good user experience.  Non-multitouch trackpads (represented by
FEATURE_FAKETOUCH) don't work as well since all touch interactions with the
screen require awkward use of a hardware button to instigate.

-- 
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 know what internal process runs an application

2011-07-25 Thread Dianne Hackborn
A string is useful to be able to look at the process information in the
debugger, and the most common use for this is to have multiple .apks share a
process to run in (not run parts of a single .apk in multiple processes), so
a string provides the ability to do scoping and generally not go insane.

On Mon, Jul 25, 2011 at 8:05 PM, elDoudou the.edouard.merc...@gmail.comwrote:

 Thank you Indicator Veritatis for your clear answer.

 For you, what I intend to do is impossible. I cannot figure out why
 the Android team declared an android:process attribute, and do not
 expose that value at runtime to the application, because this
 information is only an instruction on whether a dedicated Linux
 process should be allocated for a specific component type (Activity,
 Service, BroadcastReceiver, ContentProvider ...): the fact that this
 actually names the Linux process this way is an implementation detail
 and a coincidence. If the process should be anonymous containers and
 that it is not supposed to be available from the API at runtime, why
 not having design an android:process value with an ordinal? I now
 know that I need to review the Android source code for better
 understanding that android:process thing.

 BTW: my application has about 100 activities (I did not say
 hundreds ;), because this is a very large application, and I already
 put into common many activities. For information, I'm not totally a
 rookie: I have already been developing about 40 Android applications
 (see http://code.google.com/p/droid4me for some of them), and I have
 been developing now for 25 years (which, of course, does not involve
 that I'm a good developer ;).

 Regards,
 Édouard

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

2011-07-25 Thread Dianne Hackborn
And the point is...?

On Fri, Jul 22, 2011 at 12:42 AM, gjs garyjamessi...@gmail.com wrote:


 http://android-developers.blogspot.com/2011/07/multiple-apk-support-in-android-market.html

 On Jul 22, 2:40 pm, Dianne Hackborn hack...@android.com wrote:
  Having a drawable-small indicates a more fundamental problem with what
 you
  are doing.  Why are you doing such a thing?  What is the configuration of
  this device?  You really need to provide more detail of exactly what you
 are
  doing and the problematic behavior you are seeing.
 
 
 
 
 
 
 
 
 
  On Thu, Jul 21, 2011 at 9:54 AM, Alex alexdavisspec...@gmail.com
 wrote:
   Hey, I have recently come across a situation where drawable-hdpi
   resources on a small-screen, hdpi device look terrible. I would like
   to force smallscreen devices to use mdpi resources.
 
   Copying (or resizing) all the pertinent drawables from /drawable-mdpi
   to /drawable-small causes too much APK size inflation to justify, and
   it would be *another* item in the resource maintenance hassle.
 
   My first idea was to create xml reference files in /drawable-small
   that reference the drawable-mdpi resources, but i dont know how to
   hard-link to a specific resolution's (in this case mdpi) drawable
   via the @drawable/ syntax.
 
   Whats my way out?
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
 
  --
  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: popupwindow

2011-07-25 Thread Dianne Hackborn
Abstract classes and interfaces both have their downsides:

- Abstract classes don't allow multiple inheritance, resulting in an
explosion of tiny classes.
- Interfaces tend to result in a hard to maintain framework because it is a
lot harder to introduce new functionality (can't add a new method with a
default implementation for old apps).  Plus not being able to have
convenience functions can make the interface version less useful.

Also the inability to have default implementation in interfaces makes it
more annoying in places to control what appears in the SDK, since we can't
use our @hide tricks or else third party apps can't implement it because
they can't implement the needed hidden methods.

I go back and forth between the two.  I think I have settled on interfaces
for small little things with one or two methods (callbacks like all the
things on ListView) and abstract classes for larger protocols.

One thing I am sure of, however: protected sucks.

On Sun, Jul 24, 2011 at 9:42 PM, Zsolt Vasvari zvasv...@gmail.com wrote:

 An interface is exactly just that (plus constant declerations).  With
 abstract classes, you can have static methods and everything else that
 comes with a proper class.  The drawback is, of course, that you can
 only inherit from at most one abstract class.

 I cannot think of even a single example, off the top of my head, where
 an abstract class in Android could have also been defined as an
 interface without losing any functionality.



 On Jul 25, 12:05 pm, Indicator Veritatis mej1...@yahoo.com wrote:
  Those many cases for this there is no particularly good reason one
  was picked over the other are most likely, I hope, the cases where I
  gave up on trying to figure out why the Android team chose to make the
  one 'abstract class' and the other 'public interface';)
 
  On Jul 21, 10:28 pm, Dianne Hackborn hack...@android.com wrote:
 
 
 
   On Thu, Jul 21, 2011 at 8:16 PM, Indicator Veritatis 
 mej1...@yahoo.comwrote:
 
They do not pause to explain, for example ... why some classes are
 defined
a public abstract classes, while very similar other classes are
defined as interfaces.
 
   Well hopefully you generally don't care.  And to be honest, in many
 cases
   for this there is no particularly good reason one was picked over the
 other.
   ;)
 
   --
   Dianne Hackborn
   Android framework engineer
   hack...@android.com
 
   Note: please don't send private questions to me, as I don't have time
 to
   provide private support, and so won't reply to such e-mails.  All such
   questions should be posted on public forums, where I and others can see
 and
   answer them.- Hide quoted text -
 
  - Show quoted text -

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




-- 
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 know what internal process runs an application

2011-07-22 Thread Dianne Hackborn
Be we are still not getting to the core problem -- why do you need to have
your app initialized certain different ways depending on these uses?  How
have you gotten to this point?  It is the fundamental problem.  This is just
not naturally how Android works -- processes are simply containers to host
specific components like activities and services.

On Mon, Jul 18, 2011 at 11:19 AM, elDoudou the.edouard.merc...@gmail.comwrote:

 Thank you Diane.

 I may have a problem with my design, but if I'm wrong, I'd be
 delighted to be well guided.

 I would like my application to initialize a certain way when it is
 started with an Activity (for instance, I want to set up some caching
 stuff), whereas when launched via a Service, I do not need it to be
 initialized that way. The solution that I have found so far is to
 override the Application.onCreate() method, so as to be notified
 every time the application process starts, and quick-initialize some
 stuff.

 I have declared two android:processes because I thought that it
 might be possible to distinguish the cause of the application process
 start, but if you say that it is not possible to determine the
 android:process responsible for the start of the process, how can I
 solve my problem, please?

 Do you have in mind another design pattern which enables the
 application to be notified at startup, whatever Activity,
 BroadcastReceiver, Service causes its process to start so as to
 initialize some stuff, and to distinguish a specific Service where no
 initialization is supposed to be run, please?

 I would be very grateful to the person who is able to unblock me. And
 please, do not tell me that I have a design problem eventually ;)

 Regards,
 Édouard


 On 14 juil, 20:05, Dianne Hackborn hack...@android.com wrote:
  Sorry, there is no way to know.  Processes are basically anonymous
  containers in which to run code.  If you are needing to distinguish them,
  you have a problem in your design.
 
  On Tue, Jul 12, 2011 at 1:43 AM, elDoudou the.edouard.merc...@gmail.com
 wrote:
 
 
 
 
 
 
 
 
 
   Hello Doug and thank you.
 
   The process id does not indicate the Android declared process in the
   AndroidManifest.xml file, unfortunately. What I need to know is the
   android:process which causes the process to start. If I declare a
   service in the manifest with a specific process name (tag
   android:process), how do I know at runtime when this specific
   service process causes the Application::onCreate() method to be
   invoked, please?
 
   Thank you for your time and support. Regards,
   Édouard
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, 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] What layout the normal 2.3 WVGA 800x480 emulator use?

2011-07-21 Thread Dianne Hackborn
On Thu, Jul 21, 2011 at 7:43 AM, Zwiebel hunzwie...@gmail.com wrote:

 I have a program what looks like good on my HVGA emulator, everything
 is fine with it (however I don't know why it is use the hdpi drawable,
 when I have layout-normal-mdpi file too, with drawable-layout-mdpi
 file too.),


layout-normal-mdpi is really wrong.  drawable-layout-mdpi shouldn't even
compile.

First.

*Always* have a default resource.  So you should have a layout/foo.xml file.
 This is the basic layout of your app.  The one that will be used if nothing
else matches the device.

Second.

Layouts care about screen size, drawables care about screen density.  If you
have a resource that selects both a screen size and density (-normal-mdpi)
there is a 99.9% chance this is not what you want.

So if you want to have an alternative layout for tablet screens, in addition
to your layout/foo.xml, you would have a layout-xlarge/foo.xml.

Third.

Densities are for bitmaps.  They are used to select between different
alternative bitmaps that are available.  The platform assumes that if it
doesn't have a matching resource for a particular density, it can pick
another and it will be scaled appropriately.  If what you are selecting is
not a bitmap then it can't actually be scaled and you can end up with
resources being used that you don't want.

So if you want to have two different bitmaps one for mdpi and one for hdpi
screens, they would be drawable-mdpi/icon.png and drawable-hdpi/icon.png.

Note also that densities are the one exception to our rule always have a
default resource -- because we assume we can scale densities, some density
will always match no matter what the screen is, so they can all serve as
defaults.

-- 
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: restart application after Android's killed it

2011-07-21 Thread Dianne Hackborn
On Thu, Jul 21, 2011 at 4:12 PM, nadam ad...@anyro.se wrote:

 This is not true for my devices. At least not after manually
 destroying an app using a task manager. I get the same behavior from
 launcher icon and back button. On HTC Hero with Android 2.1, I always
 end up in the launcher activity. On Nexus S with Android 2.3.4 and
 Motorola Xoom with Android 3.0.1, I always end up in the last activity
 that was displayed.


Starting with 2.2 task managers can only kill background processes, doing
the same thing the low memory killer does.  Prior to 2.2, they could do a
full force stop which would whack the state of the application.

-- 
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] Does a device running Android have to license a JVM?

2011-07-21 Thread Dianne Hackborn
Android's VM is Dalvik, which is under the Apache 2.0 license.

On Thu, Jul 21, 2011 at 10:15 AM, DavidGarnett davidngarn...@gmail.comwrote:

 I'm not sure this is a question for Android app developers, but here
 goes...

 Does a device running Android have to license a JVM?  Some upfront
 information suggests that a JVM is built in to Android, which I hope
 would mean that the device manufacturer wouldn't need to pay Oracle
 for a JVM license.

 Of course, the manufacturure would have to port Android to the
 device ...

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




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

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

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

Re: [android-developers] Re: Fragment isAdded() issue ?

2011-07-21 Thread Dianne Hackborn
Committing a fragment is asynchronous; isAdded() doesn't return true until
the transaction is committed.

On Thu, Jul 21, 2011 at 9:33 AM, Gab gabriel.del...@gmail.com wrote:

 I have a same problem, my fragment lost the reference of activity
 after pause/resume...
 I don't understand the fragment's lifecycle.

 On 19 juil, 15:10, Guian guiandou...@gmail.com wrote:
  well well ...
 
  here is the fix I used :
 
  on the creation of my fragment I add a test in fragment.getActivity()
  is null ...
 
  if(testFragment == null || testFragment.getActivity()==null)
  testFragment = (TestFragment) TestFragment.instantiate(context,
  com.mypackage.test.MyFragment);
 
  and I recreate a previously build fragment which I think isn't very
  optimised ...
 
  any comment/advise on this is welcome.
 
  On 19 juil, 14:31, Guian guiandou...@gmail.com wrote:
 
   here is the source code forisAdded:
 
   /**
* Return true if the fragment is currently added to its activity.
*/
   final public booleanisAdded() {
   return mActivity != null  mAdded;
   }
 
   indeed ... mActivity is null...
 
   I guess I have to recreate this fragment from scratch since I've lost
   its activity owner ?
   what cause this reference on mActivity being lost ?
   if its the onPause = onResume,  what's the point of having a onPause
   onResume methods to implement in Fragment, if we have to recreate it
   anyway ?
 
   On 19 juil, 12:23, Guian guiandou...@gmail.com wrote:
 
I've seen thatisAdded() can return false even if the field 'mAdded'
in the Fragment is true ?
(seen in the 'Variables' view in eclipse )
 
does anybody know why ?
 
On 19 juil, 11:46, Guian guiandou...@gmail.com wrote:
 
 I can't understand how this piece of code :
 
 if(!fragmentsToAdd.isAdded())
 ft.add( R.id.parent, fragmentsToAdd, myFragment);
 
 can lead to this exeption :
 
 FATAL EXCEPTION: main
 java.lang.IllegalStateException: Fragment already added:
 TestFragment{40856358 #0 id=0x7f060024 myFragment}
 at android.app.BackStackRecord.doAddOp(BackStackRecord.java:322)
 at android.app.BackStackRecord.add(BackStackRecord.java:316)
 at com.mypackage.test.MyActivity.onTabSelected(MyActivity.java:164)
 
 does the  isAdded()  function works fine ?
 
 ( used with android 3.1, it happens when leaving the app in pause
 state, then resume it and change Tab from the action bar. )
 
 any cu

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Bi-directional IPC and data transfer in between an application and multiple services from other applications

2011-07-21 Thread Dianne Hackborn
This is an example of a Service using Messenger that allows multiple clients
to register for updates:

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/MessengerService.html

And the client code:

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/MessengerServiceActivities.html

On Wed, Jul 20, 2011 at 11:48 PM, winnie vineet.0...@gmail.com wrote:

 I have one application, to which many other services (from other
 applications say 3rd party apps) can be subscribed. And I need to get
 updated data into my application from the other applications, and so I
 require have bi-directional communication from my application to other
 services. The kind of data that I require from all the services is
 same.

 Right now using Messenger and Bound Services serves my purpose for bi-
 directional communication between my application and a service from
 ONE other application. But now I am stuck how can I extend it to
 support MULTIPLE services.
 I know I can get the ComponentName in the callback function
 onServiceConnected(ComponentName, IBinder) and so I can get the
 corresponding IBinder interface from the corresponding service (using
 just one ServiceConnection for all). But when  we unbind any service,
 then we unbind it with ServiceConnection as a parameter, so would it
 unbind all of my subscribed services which are attached via that
 ServiceConnection? Do I really need to have multiple
 ServiceConnections for every service? I am getting really confused
 with this. Could someone throw some light into possible solution?

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

2011-07-21 Thread Dianne Hackborn
You don't want to do that.  SQLite databases are not intended to store large
blobs of data.

On Thu, Jul 21, 2011 at 12:34 AM, chinna872 mayuri.medishe...@gmail.comwrote:

 Hi all,
how to store images directly in the sqlite database from the
 camera


 Regarding
 --
 chinna872

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

2011-07-21 Thread Dianne Hackborn
No.

We shouldn't let you force stop the system UI, either.

On Thu, Jul 21, 2011 at 12:02 AM, chibinho chibinho1...@gmail.com wrote:

 Hi, everyone. Android 3.0 status bar is always appear . And I find it
 can be disappear when use setting  system ui  force close. May I
 develop an app which can auto force close the system ui ? Does Android
 have provide this API?

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

2011-07-21 Thread Dianne Hackborn
Having a drawable-small indicates a more fundamental problem with what you
are doing.  Why are you doing such a thing?  What is the configuration of
this device?  You really need to provide more detail of exactly what you are
doing and the problematic behavior you are seeing.

On Thu, Jul 21, 2011 at 9:54 AM, Alex alexdavisspec...@gmail.com wrote:

 Hey, I have recently come across a situation where drawable-hdpi
 resources on a small-screen, hdpi device look terrible. I would like
 to force smallscreen devices to use mdpi resources.

 Copying (or resizing) all the pertinent drawables from /drawable-mdpi
 to /drawable-small causes too much APK size inflation to justify, and
 it would be *another* item in the resource maintenance hassle.

 My first idea was to create xml reference files in /drawable-small
 that reference the drawable-mdpi resources, but i dont know how to
 hard-link to a specific resolution's (in this case mdpi) drawable
 via the @drawable/ syntax.

 Whats my way out?

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




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

2011-07-21 Thread Dianne Hackborn
On Thu, Jul 21, 2011 at 8:16 PM, Indicator Veritatis mej1...@yahoo.comwrote:

 They do not pause to explain, for example ... why some classes are defined
 a public abstract classes, while very similar other classes are
 defined as interfaces.


Well hopefully you generally don't care.  And to be honest, in many cases
for this there is no particularly good reason one was picked over the other.
;)

-- 
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] Intent filter changed on Android 3.2?

2011-07-20 Thread Dianne Hackborn
YouTube still works and it hasn't been changed as far as I know, so I'm not
sure what could be impacting that.  The IntentFilter matching rules
certainly weren't changed in 3.1.

On Tue, Jul 19, 2011 at 11:57 PM, Tor tor.hough...@gmail.com wrote:

 Hello,

 I have an app that triggers on YouTube URLs, and it worked as designed
 until Android 3.1. Does anyone know what happened in 3.2 that prevents
 my app from launching? (I can't see any changes regarding intent-
 filters in the 3.2 documentation..)

 Kind regards,

 Tor

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

2011-07-20 Thread Dianne Hackborn
On Wed, Jul 20, 2011 at 12:04 AM, Zsolt Vasvari zvasv...@gmail.com wrote:

 Nope, but I am sure a lot of changes are not documented.  For example,
 1280x800 devices now report their screen size as 1280x752.


This was a bug fix -- the platform should have been reporting 1280x752,
because that is actually the amount of space available to apps even in
fullscreen.  Due to this bug, prior to MR2 apps that were relying on the
display metrics to tell them the actual space they would have (usually
games) were clipped at the bottom due to the system bar.  Given that the
system bar space is completely not usable by apps, not accounting for it
basically resulted in no way to do anything useful with the reported display
size because you couldn't know how much was being taken away from the app.

Also this needed to be accurate to support the new resource configuration
options.

-- 
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] Detecting app is pre-installed after it gets updated via android market

2011-07-20 Thread Dianne Hackborn
FLAG_SYSTEM means the app was originally installed on the system image.  If
your app is pre-installed, and an update is installed from Market,
FLAG_SYSTEM is still set for the updated app.

On Tue, Jul 19, 2011 at 8:08 PM, dan raaka danra...@gmail.com wrote:

 I have a app with versionCode=1, pre-installed on the device (ie. the app
 is placed under /system/app partition)
 Then I post an app updated, versionCode=2, on the android market and the
 user download the updates the app. So, the updated app on the device is
 located @ /data/app

 Under this scenario .. will the below piece of code properly detect that
 the app is a system app ?

if((pkgInfo.applicationInfo.flags 
 ApplicationInfo.FLAG_SYSTEM)!=0){
isSysInstalled = true;
}

 -Dan

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

2011-07-20 Thread Dianne Hackborn
Prior to 2.3 the sensors were turned off when the screen went off in order
to reduce battery use.  This was changed on 2.3, though it's possible we are
actually going to end up regretting that change. :p

Also even as of 2.3, I wouldn't be surprised if some device's drivers are
still turning off the sensor hardware as part of their power management when
the screen goes off.

On Wed, Jul 20, 2011 at 8:53 AM, Chris Conry cjco...@gmail.com wrote:

 And your guess was completely correct. Thank you. The problem is
 still happening, as soon as I hit the power button the data stops logging.
 Is there something else im missing about wakelock?


 On Wed, Jul 20, 2011 at 11:26 AM, Mark Murphy mmur...@commonsware.comwrote:

 Use adb logcat, DDMS, or the DDMS perspective in Eclipse to examine
 LogCat and look at the stack trace associated with your runtime error.
 My guess is that you do not hold the WAKE_LOCK permission.

 On Wed, Jul 20, 2011 at 11:21 AM, Chris Conry cjco...@gmail.com wrote:
  Thanks for the replys,
  Looking into it the partial wake lock should be my solution, but it isnt
  implementing well. I keep getting a runtime error on acquire(). my code
  looks like:
  PM = (PowerManager)
 getSystemService(Context.POWER_SERVICE);
  WL= PM.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, Wakelock);
  WL.acquire();
  I put this in the onStartCommand(), is that incorrect? Should
  only acquire the wakelock when the screen turns off?
  Thank you
  On Wed, Jul 20, 2011 at 3:59 AM, Filip Havlicek 
 havlicek.fi...@gmail.com
  wrote:
 
  Acquire a partial wake lock, that should help.
 
  2011/7/20 Jan Nielsen j...@air-port.dk
 
  The common ways to sleep in java, only counts cpu time on the Android
  platform.
  So a Thread.sleep(60 * 1000); may become 5 or 10 minutes if the phone
  is in standby, since it only counts when the cpu is awake.
 
  afaik you need to use AlarmManager to get called when the phone is in
  standby.
  Even a handler postDelayed wont work, as that is also wake time.
 
  On 19 Jul., 23:20, Chris Conry cjco...@gmail.com wrote:
   I'm trying to build an app that logs sensor data(using a service),
 and
   stores it into an SQLite database. My problem is that it stops
 logging
   when
   the screen is off. It works perfectly fine when the screen is on,
 but
   when i
   turn the screen off the data doesn't start logging until I turn the
   screen
   on. The process isn't being killed, because it works when the screen
   comes
   back on.
  
   I've tried implementing it as a Thread. I think that wont work
 because
   it
   needs a context for the database. And I read that using
   startForeground,
   but it didn't change.
  
   Any Suggestions? Can anyone help?
  
   Thank you
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to
 android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to
 android-developers@googlegroups.com
  To unsubscribe from this group, 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



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

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

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




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

Note: please don't send private questions to me, as I don't

Re: [android-developers] Re: Service Being paused on screen off.

2011-07-20 Thread Dianne Hackborn
The only two types of wakelocks are partial and full.  A full wakelock will
keep the screen from automatically turning off, and the screen being on will
definitely mean the sensors are running.  Once the user presses the power
button and turns the screen off, though, you are in no better a state than
holding a partial wake lock.

On Wed, Jul 20, 2011 at 11:40 AM, Filip Havlicek
havlicek.fi...@gmail.comwrote:

 If you are trying to develop a market application, I think there is no
 workaround. If you just want to experiment with the accelerometer data, you
 can try different types of wakelock as Mark suggested, some of them might
 work. Or just keep the device awake while you do the experiments (although
 you might need to recharge the device every few hours). It might be possible
 to do something about it on the OS level if you root your devices, although
 that would need a bit more digging.

 Best regards,
 Filip Havlicek

 2011/7/20 Chris Conry cjco...@gmail.com

 Thanks for the answers,
 Makes sense now, I am using the myTouch 4g and LG ally, sadly both of them
 I guess turn off their sensors. Its good to hear that the Nexus and some 2.3
 device keep it on and hopefully other manufacturers adopt this.

 I guess i'm going to try and find a work around. Any suggestions?
 Thank you

 On Wed, Jul 20, 2011 at 12:42 PM, Filip Havlicek 
 havlicek.fi...@gmail.com wrote:

 Partial wake lock works just fine with accelerometer sensor on Nexus One
 2.2 (tested this for over than 6 months as a part of my research), although
 this might not be the case for different combination of device and OS
 version.


 2011/7/20 Dianne Hackborn hack...@android.com

 Prior to 2.3 the sensors were turned off when the screen went off in
 order to reduce battery use.  This was changed on 2.3, though it's possible
 we are actually going to end up regretting that change. :p

 Also even as of 2.3, I wouldn't be surprised if some device's drivers
 are still turning off the sensor hardware as part of their power management
 when the screen goes off.

 On Wed, Jul 20, 2011 at 8:53 AM, Chris Conry cjco...@gmail.com wrote:

 And your guess was completely correct. Thank you. The problem is
 still happening, as soon as I hit the power button the data stops logging.
 Is there something else im missing about wakelock?


 On Wed, Jul 20, 2011 at 11:26 AM, Mark Murphy mmur...@commonsware.com
  wrote:

 Use adb logcat, DDMS, or the DDMS perspective in Eclipse to examine
 LogCat and look at the stack trace associated with your runtime error.
 My guess is that you do not hold the WAKE_LOCK permission.

 On Wed, Jul 20, 2011 at 11:21 AM, Chris Conry cjco...@gmail.com
 wrote:
  Thanks for the replys,
  Looking into it the partial wake lock should be my solution, but it
 isnt
  implementing well. I keep getting a runtime error on acquire(). my
 code
  looks like:
  PM = (PowerManager)
 getSystemService(Context.POWER_SERVICE);
  WL= PM.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, Wakelock);
  WL.acquire();
  I put this in the onStartCommand(), is that incorrect? Should
  only acquire the wakelock when the screen turns off?
  Thank you
  On Wed, Jul 20, 2011 at 3:59 AM, Filip Havlicek 
 havlicek.fi...@gmail.com
  wrote:
 
  Acquire a partial wake lock, that should help.
 
  2011/7/20 Jan Nielsen j...@air-port.dk
 
  The common ways to sleep in java, only counts cpu time on the
 Android
  platform.
  So a Thread.sleep(60 * 1000); may become 5 or 10 minutes if the
 phone
  is in standby, since it only counts when the cpu is awake.
 
  afaik you need to use AlarmManager to get called when the phone is
 in
  standby.
  Even a handler postDelayed wont work, as that is also wake time.
 
  On 19 Jul., 23:20, Chris Conry cjco...@gmail.com wrote:
   I'm trying to build an app that logs sensor data(using a
 service), and
   stores it into an SQLite database. My problem is that it stops
 logging
   when
   the screen is off. It works perfectly fine when the screen is
 on, but
   when i
   turn the screen off the data doesn't start logging until I turn
 the
   screen
   on. The process isn't being killed, because it works when the
 screen
   comes
   back on.
  
   I've tried implementing it as a Thread. I think that wont work
 because
   it
   needs a context for the database. And I read that using
   startForeground,
   but it didn't change.
  
   Any Suggestions? Can anyone help?
  
   Thank you
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to
 android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to
 android-developers

Re: [android-developers] How to include libevent using NDK?

2011-07-20 Thread Dianne Hackborn
It doesn't matter if you can get that built, NDK apps can;t directly open
input devices.

On Wed, Jul 20, 2011 at 11:16 AM, ElFrog nky...@gmail.com wrote:

 I want to convert my c files(which implemented with libevent) to
 library using NDK.
 But when I build these files, it failed. (Of course I already
 installed libevent API)

 The first error was
 event2/event.h : No such files or 

 so i copied  directory which contained event.h to jni and

 LOCAL_C_INCLUDES := $(LOCAL_PATH)/event/include

 in Android.mk  and solved

 but after that, builder couldn't find libevent library, and I also
 typed

 LOCAL_LDLIBS += -L$(SYSROOT)/usr/local/lib/ -levent

 and error occurs like


 /home/username/android-ndk-r5c/toolchains/arm-linux-
 androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-
 androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: cannot
 find -levent

 how can i fix it??


 I used android-ndk-r5c and installed libevent-2.0.12-stable version.
 And my machine is Ubuntu 11.04


 Android.mk:

 ...

 include $(CLEAR_VARS)

 #LOCAL_STATIC_LIBRARIES := LOCAL_WHOLE_STATIC_LIBRARIES

 LOCAL_MODULE:=  blah blah
 LOCAL_SRC_FILES := \
manager.c \
asdf.c \

 LOCAL_C_INCLUDES := $(LOCAL_PATH)/event/include

 LOCAL_LDLIBS += -L$(SYSROOT)/usr/local/lib/ -levent




 include $(BUILD_SHARED_LIBRARY)



 Error
 Compile thumb  : asfd = dsfr.c
 Compile thumb  : sdfr = asdfn.c
 SharedLibrary  : libasfdwadfsga.so
 /home/asdfsad/android-ndk-r5c/toolchains/arm-linux-androideabi-4.4.3/
 prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/
 4.4.3/../../../../arm-linux-androideabi/bin/ld: cannot find -levent
 collect2: ld returned 1 exit status
 make: *** [/home/elfrog/workspace/DTNManager/obj/local/armeabi/
 libdtn_manager.so] 오류 1


 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: restart application after Android's killed it

2011-07-20 Thread Dianne Hackborn
That has nothing to do with what happens when the process is killed.

Processes being killed in the background is invisible to the user.  The UI
flow they go through is absolutely not intended to change just based on
whether a process is killed, because it is basically random when that will
happen.

On Wed, Jul 20, 2011 at 10:35 AM, lbendlin l...@bendlin.us wrote:

 if you want to return to a particular activity when the application is
 (re)launched you can specify that in the manifest

 android:launchMode=singleTask
 android:alwaysRetainTaskState=true

 are two things worth reading about.

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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 can I find how many home screens?

2011-07-19 Thread Dianne Hackborn
On Tue, Jul 19, 2011 at 3:04 PM, Hal Harrison
closeenough.bac...@gmail.comwrote:

 You have at this point loaded a Drawable for the current static
 wallpaper...
  but there is no up-to-date static wallpaper, because you have just
 replaced
 it with your own wallpaper.  Your wallpaper should absolutely positively
 not
 be trying to load the current static wallpaper here.  There are no
 guarantees that this is up-to-date or even valid.

 The point at which I do this is early on in
 WallpaperService.onCreate(), before I instantiate
 WallpaperManager.Engine and well before my WallpaperManager.Engine's
 onSurfaceCreated(SurfaceHolder hldr) callback with
WPcan = hldr.lockCanvas();
WPcan.drawBitmap(...);

 Isn't it drawBitmap() that replaces the old with my new? And, I get
 the old Drawable early on by instantiating a WallpaperManager which,
 according to documentation will, Retrieve a WallpaperManager
 associated with the given Context. On the emulators I've always
 received what I expect. When is this Drawable not up-to-date or not
 valid? Am I missing some emulator state I should be testing?


You are now the wallpaper.  You are supposed to be drawing the wallpaper;
whatever Drawable is returned by WallpaperService is out of date because
there is no longer a static wallpaper, *you* are the wallpaper.

The implementation of a wallpaper service simply should not be retrieving
the wallpaper drawable.



 The current launcher can set the desired
 wallpaper width to whatever it wants.
 I'm unclear about the launcher: Does it only handle the application
 drawer, the wallpaper and icons on the home screen(s), or both? Can
 I, as an application programmer, replace the launcher with my own, or
 is this something phone vendors do? Phrased another way, normally who
 owns the placement and scrolling of shortcuts, widgets, and folders
 across the device screen--Android, the phone distributor, or someone
 else?


Launcher is just an app.  It is what is launched when you press home.  And
yes, you can find numerous apps on Market that implement different kinds of
launchers that people can use insteadl of the build-in one.


  (c) upon exit from preview mode, some way to set which home screen (of
  icons and widgets) will show next.
  No that is up to the application sitting on top of the home screen, and
 can
 change as you move between such apps.
 I find no way in the emulators to invoke Living wallpapers and
 therefore get into my preview mode except from a home screen.
 Therefore exit from my app's preview mode always returns to a home
 screen. Maybe I'm missing something.


I can do it with an ADB shell command.  Someone else can invoke it.  Maybe
in the future the setting for the wallpaper will be in the settings app.

Just don't assume that you know such subtle details of UI flow like this.
 These kinds of things change.

-- 
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 lock current orientation at runtime?

2011-07-18 Thread Dianne Hackborn
I wouldn't suggest putting it in a Service unless it is really something you
want to have executing when the user is outside of your app.

For example, a browser typically wouldn't associate a Service with
networking, because all of its networking is there to serve the UI.

On Mon, Jul 18, 2011 at 2:01 PM, Indicator Veritatis mej1...@yahoo.comwrote:

 What? Why would a restart of your Activity be a problem while waiting
 for an HTTP response? You DO have the HTTP response in a separate
 thread and Service, don't you?

 On Jul 16, 3:41 pm, Brad bradfull...@gmail.com wrote:
  Hi,
 
  I'm trying to lock my activity to the current orientation to prevent
  an orientation change from restarting my activity while I'm waiting
  for a http response.
 
  So I'm trying to use this:
 
  setRequestedOrientation(getResources().getConfiguration().orientation);
 
  And it works fine for portrait (orientation == 1), but when the device
  is in landscape it's getting a value of 2 which ==
 
  ActivityInfo.SCREEN_ORIENTATION_USER
 
  And this doesn't lock the screen.
 
  Does anyone have any idea why I'm getting this instead of LANDSCAPE?
  Any suggestions for a better way to lock the current orientation?
 
  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 lock current orientation at runtime?

2011-07-17 Thread Dianne Hackborn
Note that basically everything you do for dealing with a configuration
change is *exactly* the same thing you need to do to correctly handle your
app being killed in the background if the user has (temporarily) left its
UI.  Thus making sure you deal correctly with a config change is a really
good way to test that you are also able to correctly restore if your process
needs to be restarted.

If you have transient data that shouldn't be restored (such as a running
thread), just use Activity.onRetainNonConfigurationInstance():

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

(Or as the current document recommends, the more convenient new Fragment
APIs.)

On Sat, Jul 16, 2011 at 9:17 PM, Brad bradfull...@gmail.com wrote:

 Dianne, thanks for the response - you're probably right, I should just
 bite the bullet.

 I'd like to vent a little though about what a hassle it is to deal
 with orientation changes.   It must be the #1 source of bugs in the
 apps that I've come across (including my own apps).   iOS does a lot
 of things wrong, but it makes orientation changes so much easier than
 Android.   I still haven't found a way to preserve the state of an
 activity that launches another dialog style activity that gets an
 orientation change - I end up shoving everything in the db or passing
 the state data to the dialog class.   I'm no guru so I'm probably
 doing something wrong there, but I wish to God that we could go back
 in time and come up with a better way to deal with orientation changes
 that didn't involve killing and reconstructing the entire activity!

 Ok, done w/the vent.  Having said all that I still enjoy programming
 for Android more than Apple even though I sell a lot more apps on the
 App Store vs the Market :-)

 Brad

 On Jul 16, 8:53 pm, Dianne Hackborn hack...@android.com wrote:
  Those are two different orientations.
 
  The Configuration constants:
 http://developer.android.com/reference/android/content/res/Configurat...
 
  The constants for set/getRequestedOrientation():
 http://developer.android.com/reference/android/content/pm/ActivityInf...
 
  Beyond that, I would strongly recommend not doing what you are trying to
 do.
   This would result in a UI flow that is very counter to what the user
  expects -- that either an app is going to run in a particular
 orientation,
  or allow them to rotate their screen as they would elsewhere.  Ending up
  locked into whatever orientation they happened to launch the app in is
 just
  not how things should work.
 
  Besides which, there are all kinds of edge cases you'll never get right
 --
  for example what happens if they press home to leave your app, rotate
 their
  device, and then task switch back to your app?  Or as another poster
  mention, if you lock the screen into portrait like this and they flip the
  lid on their keyboard the orientation won't change to landscape, which is
  not what they are going to want.
 
  You really, really just need to code your activity correctly to be able
 to
  destroy and re-create the activity.
 
 
 
 
 
 
 
 
 
  On Sat, Jul 16, 2011 at 3:41 PM, Brad bradfull...@gmail.com wrote:
   Hi,
 
   I'm trying to lock my activity to the current orientation to prevent
   an orientation change from restarting my activity while I'm waiting
   for a http response.
 
   So I'm trying to use this:
 
   setRequestedOrientation(getResources().getConfiguration().orientation);
 
   And it works fine for portrait (orientation == 1), but when the device
   is in landscape it's getting a value of 2 which ==
 
   ActivityInfo.SCREEN_ORIENTATION_USER
 
   And this doesn't lock the screen.
 
   Does anyone have any idea why I'm getting this instead of LANDSCAPE?
   Any suggestions for a better way to lock the current orientation?
 
   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

Re: [android-developers] How to lock current orientation at runtime?

2011-07-16 Thread Dianne Hackborn
Those are two different orientations.

The Configuration constants:
http://developer.android.com/reference/android/content/res/Configuration.html#ORIENTATION_LANDSCAPE

The constants for set/getRequestedOrientation():
http://developer.android.com/reference/android/content/pm/ActivityInfo.html#screenOrientation

Beyond that, I would strongly recommend not doing what you are trying to do.
 This would result in a UI flow that is very counter to what the user
expects -- that either an app is going to run in a particular orientation,
or allow them to rotate their screen as they would elsewhere.  Ending up
locked into whatever orientation they happened to launch the app in is just
not how things should work.

Besides which, there are all kinds of edge cases you'll never get right --
for example what happens if they press home to leave your app, rotate their
device, and then task switch back to your app?  Or as another poster
mention, if you lock the screen into portrait like this and they flip the
lid on their keyboard the orientation won't change to landscape, which is
not what they are going to want.

You really, really just need to code your activity correctly to be able to
destroy and re-create the activity.

On Sat, Jul 16, 2011 at 3:41 PM, Brad bradfull...@gmail.com wrote:

 Hi,

 I'm trying to lock my activity to the current orientation to prevent
 an orientation change from restarting my activity while I'm waiting
 for a http response.

 So I'm trying to use this:

 setRequestedOrientation(getResources().getConfiguration().orientation);

 And it works fine for portrait (orientation == 1), but when the device
 is in landscape it's getting a value of 2 which ==

 ActivityInfo.SCREEN_ORIENTATION_USER

 And this doesn't lock the screen.

 Does anyone have any idea why I'm getting this instead of LANDSCAPE?
 Any suggestions for a better way to lock the current orientation?

 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 can I find how many home screens?

2011-07-15 Thread Dianne Hackborn
Wow that sounds like you are making it way too complicated, and way too
fragile.  A few comments:

On Fri, Jul 15, 2011 at 1:08 PM, Hal Harrison
closeenough.bac...@gmail.comwrote:

 1. Upon exit from preview mode the system will always show the panel
 of icons and widgets last showing before preview mode.


You should not be doing special things upon exit of preview mode.  Don't
assume there is some flow that will happen there.  An engine will be
created, and told whether or not it is in preview mode.  That is it.  Don't
make dependencies between these.


 In WallpaperService.onCreate() I get wallpaper width from
WallpaperManager.getDrawable() and getBitmap() and getWidth(),
 and


You have at this point loaded a Drawable for the current static wallpaper...
 but there is no up-to-date static wallpaper, because you have just replaced
it with your own wallpaper.  Your wallpaper should absolutely positively not
be trying to load the current static wallpaper here.  There are no
guarantees that this is up-to-date or even valid.

There are already APIs on the engine to get the desired size for the
wallpaper: Engine.getDesiredMinimumWidth() and
Engine.getDesiredMinimumHeight().

Also be sure to handle onDesiredSizeChanged().

2.  device screen width in pixels = wallpaper width / 2;
 However many homescreens there are,


No you can not assume that.  The current launcher can set the desired
wallpaper width to whatever it wants.


 3.  offset to center panel of wallpaper = the negative of (device
 screen width / 2);


You can get the screen size with
Service.getResources().getDisplayMetrics().width/heightPixels.

To compute your center position, it is just standard centering if a smaller
container (display size) in a larger container (desired wallpaper size):
(getDesiredMinimumWidth()-widthPixels)/2.


 Therefore, during preview mode I show this center panel. Upon exit
 from preview mode I get my first onOffsetsChanged() callback and can
 calculate the real number of home screens and manage my background
 accordingly.


In preview mode I would say you should just show a preview.  Don't even try
to show multiple panes, it doesn't make sense there.  This is why we tell
the engine it is in this special preview mode.

Perhaps in the future some live wallpaper applications would be better
 served if the system exposed additional information it obviously has:
 (a) during onCreate(), some direct way to get device screen size and
 number of home screens,


You can already get the display size through DisplayMetrics.  You will not
get the number of home screens.  Again, that concept doesn't strongly
exist.


 (b) upon entry to preview mode, some way to get which home screen was
 last showing


No just show a preview.


 (c) upon exit from preview mode, some way to set which home screen (of
 icons and widgets) will show next.


No that is up to the application sitting on top of the home screen, and can
change as you move between such apps.

-- 
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] qHD layouts?

2011-07-14 Thread Dianne Hackborn
There is no such thing as a qHD layout.  Just write your layout to adjust to
the screen size using layout managers and such.

Worth saying again: do not target specific screen sizes.  You will be
continually unhappy.

On Thu, Jul 14, 2011 at 9:59 AM, Greg Donald gdon...@gmail.com wrote:

 What do I need to name my layout folders to get a qHD device to notice
 them?  I have tried layout-large and layout-large-port but the device
 refuses to use them and still uses my layouts from my layout and
 layout-port folders.

 The device I am working with is the EVO 3D.  The resolution is
 960x540, which isn't listed here:

 http://developer.android.com/guide/practices/screens_support.html

 The device is drawing my app in the top middle of the screen, with
 huge black borders around it, even with my layout's height and width
 both being set to fill_parent.

 How do I support qHD with proper layouts?


 --
 Greg Donald
 destiney.com | gregdonald.com

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




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

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

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

Re: [android-developers] Re: How to know what internal process runs an application

2011-07-14 Thread Dianne Hackborn
Sorry, there is no way to know.  Processes are basically anonymous
containers in which to run code.  If you are needing to distinguish them,
you have a problem in your design.

On Tue, Jul 12, 2011 at 1:43 AM, elDoudou the.edouard.merc...@gmail.comwrote:

 Hello Doug and thank you.

 The process id does not indicate the Android declared process in the
 AndroidManifest.xml file, unfortunately. What I need to know is the
 android:process which causes the process to start. If I declare a
 service in the manifest with a specific process name (tag
 android:process), how do I know at runtime when this specific
 service process causes the Application::onCreate() method to be
 invoked, please?

 Thank you for your time and support. Regards,
 Édouard

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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: startService() runs the service in a seperate process?

2011-07-14 Thread Dianne Hackborn
No that is absolutely not true.

Services run in the same process as other components (unless you explicitly
change this with android:process).

Services run in the same THREAD as your other components.

All of this is documented here:
http://developer.android.com/reference/android/app/Service.html

In particular:
 What is a Service?

Most confusion about the Service class actually revolves around what it is *
not*:

   - A Service is *not* a separate process. The Service object itself does
   not imply it is running in its own process; unless otherwise specified, it
   runs in the same process as the application it is part of.
   - A Service is *not* a thread. It is not a means itself to do work off of
   the main thread (to avoid Application Not Responding errors).

On Thu, Jul 14, 2011 at 1:27 AM, kamiseq kami...@gmail.com wrote:

 services are running in different process, you can bind to it so any
 activity could exchange data with it. start service just starts
 service

 hope that helped

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] How come extending ListActivity results in a crash

2011-07-14 Thread Dianne Hackborn
It's because you have a bug in your code.  You should consider debugging it.
:)

On Wed, Jul 13, 2011 at 2:54 PM, Steven Bruce stevebruc...@gmail.comwrote:

 I have changed my Bluetooth class from extends Activity to extends
 ListActivity. Now everytime I run the program BOOM!! It bombs out!
 What the hell is going on??

 Steve

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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 can I find how many home screens?

2011-07-13 Thread Dianne Hackborn
This is part of the information in onOffsetsChanged(), give by the step
size.  Sorry for the lacking documentation there; you can get more
information about their meaning from here:

http://developer.android.com/reference/android/app/WallpaperManager.html#setWallpaperOffsetSteps(float,
float)

On Wed, Jul 13, 2011 at 4:44 PM, Hal Harrison
closeenough.bac...@gmail.comwrote:

  No, sorry. I can envision a home screen implementation with infinite
  home screens.

 Thanks, Mark, for the reply. I was afraid of that and am looking at my
 problem again.

 What about this?

 Occasionally onOffsetsChanged() gives an xStep of 0.0 or -1.0.
 Otherwise it consistently gives 0.5 (emulator 2.1 with three home
 screens) or 0.25 (emulator 2.2 with five home screens). Therefore, I
 assume:

 (1 / xStep) + 1 = number of current home screens.

 Any problem with my assumption?  //at least until xStep gets
 infinitesimally small : )

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] App behaves wired after the task is killed by a TaskKiller

2011-07-13 Thread Dianne Hackborn
A task killer doesn't do anything more than the platform would when it needs
to kill your process when it is in the background.  You just need to deal
with this case.

On Wed, Jul 13, 2011 at 9:22 AM, dillipk codersnet2...@gmail.com wrote:

 Hello,
   My app have some issues after being killed by Task Killer.

 Sequence: -
 - Run the app
 - Press HOME key
 - Kill all the tasks by TaskKiller
 - Again run the app..

  At this point, instead of starting the App gracefully(by starting the
 first screen which is a splash screen), it directly go to some other
 screen with EMPTY data.. Whole app behaves wired and the data is empty
 everywhere.


 Can my app listen to any event, when it is killed by a TaskKiller..? I
 tried debugging by going to onDestroy(), but it never got fired..

 Any help on this would greatly appreciated..

 Thanks in advance..

 DK

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

2011-07-12 Thread Dianne Hackborn
Yes you'll need to do this after your view hierarchy is attached to the
window manager.

On Tue, Jul 12, 2011 at 7:13 PM, Nikolay Elenkov
nikolay.elen...@gmail.comwrote:

 On Wed, Jul 13, 2011 at 6:54 AM, Mark mbus...@bitwisecontrols.com wrote:
  I am trying (unsuccessfully thus far) to dim the system bar on
  Honeycomb devices. My current layout contains a single WebView. The
  following is called in my bundle's onCreate routine.

 Maybe it doesn't work from onCreate()? Try calling it in onStart()
 or onResume().

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

2011-07-11 Thread Dianne Hackborn
Not with a third party app.

On Mon, Jul 11, 2011 at 1:35 PM, garaus m.shu...@gmail.com wrote:

 There is a situation when user wants to make possible to lock/disable
 external storage, in other words make it not mountable until this
 option enabled after password entered. For instance when somebody's
 tablet has been stolen or lost when screen wasn't locked. Even if data
 encrypted it still will observable on the non-locked device.
 Is the any way disable external storage programmatic?

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

2011-07-10 Thread Dianne Hackborn
It will only destroy activities if you have a large number of them on your
stack.  In practice, I think most apps will hit an out of memory error on
their local heap before encountering this (and don't have significantly deep
stacks), so are unlikely to encounter it.

On Sun, Jul 10, 2011 at 8:17 AM, nadam a...@anyro.se wrote:

 In a low memory situation Android can shut down apps and has some
 logic to prioritize which apps to shut down first. I have read some
 comments that Android can also partially destroy an app by destroying
 Activities that are not currently used. Since I haven't found any
 documentation about this, I suspect that this could be a
 misunderstanding and that what they are experiencing is in fact that
 the whole app has been destroyed and then the app has been started
 again by the user.

 Example:
 1. The app starts and creates ActivityA
 2. ActivityA starts ActivityB
 3. ActivityB starts another app, for instance Google Maps
 4. Android destroys only ActivityA due to low memory

 But what actually happened:
 4. Android destroys the whole app due to low memory
 5. The user presses the back-button
 6. The app starts again and creates ActivityB
 7. Developer thinks (based on stack-traces) that the app has been
 running all the time but only ActivityA was destroyed

 If Android can in fact destroy just a single Activity, how is the
 decision made between destroying unused Activities in the least 5
 prioritized apps vs. completely destroying the least 2 prioritized
 apps?

 Or is the partial destroying just a myth (like the destroying statics
 myth)?

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Closing AppWidget when force closing an application

2011-07-10 Thread Dianne Hackborn
If that causes your app widget to break, there is probably something wrong
with your implementation.  App widgets by design don't rely on their app
running all of the time.  When the user interacts with the app widget, this
should be through an Intent being sent to an app component that will cause
it to launch if needed.

On Tue, Jul 5, 2011 at 10:38 AM, Marcos Fábio mfpere...@gmail.com wrote:

 Hi All,

 I'm trying to close (remove from home) my AppWidget when the user goes
 to (Settings - Applications - Manage applications) and click on
 'Force Stop' button of my application.

 The application closes, but the AppWidget keeps on Home and doesn't
 work.

 BR,

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] R: How to know if screen is locked

2011-07-10 Thread Dianne Hackborn
Did you try this?

http://developer.android.com/reference/android/app/KeyguardManager.html#inKeyguardRestrictedInputMode()

On Sun, Jul 10, 2011 at 8:03 AM, Federico Pelloni 
federico.pell...@gmail.com wrote:

 Anybody?

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

2011-07-04 Thread Dianne Hackborn
What phone is it?  Have you tried the ApiDemos examples on it that use the
sensor to see if they work?  Have you tried other applications from Market
on it that are known to work?

On Mon, Jul 4, 2011 at 3:21 PM, Mike D mdavie...@gmail.com wrote:

 Thanks for pointing me at the post, it makes sense.

 However I'm still only ever getting negative degrees when the phone is
 in landscape no matter which direction I'm sitting.

 I did try and find the function Display.getRotation() but I can't seem
 to use that function. I am using getRotationMatrix which is what
 everyone else is using in the examples I've seen.

 Anyone got any idea's why my phone is always telling me that North is
 somewhere to my right when it's in landscape? Or is it a fault with
 the phone? I'm using the wildfire google version 2.2.1.

 Thanks
 Michael

 On Jun 30, 1:13 am, Dianne Hackborn hack...@android.com wrote:
  http://android-developers.blogspot.com/2010/09/one-screen-turn-deserv...
 
 
 
 
 
 
 
 
 
  On Wed, Jun 29, 2011 at 10:22 AM, Mike D mdavie...@gmail.com wrote:
   Hi guys,
 
   I've been playing around with orientation (especially in relation to
   the real world so finding north is very useful) and started with the
   google api example.
 
   While investigating how to change that so it worked while the phone
   was in landscape I found out that I was using depricated components.
   So now I'm using the acceloromiter and the magnetic field to find the
   orientation which I found in a mixture of examples on the web.
 
   This again works great while in portrain but landscape gives weird
   answers?
 
   I've done some experiments with looking at the different between
   landscape and portrait but can't seem to find out what's going on and
   how to correct the app to allow me to switch between portrain and
   landscape on the fly.
 
   I don't think it's quite as simple and minusing 90 degrees but I'm
   willing to be wrong.
 
   Here's my SensorListener onSensorChanged
 
   int type = event.sensor.getType();
  float[] data;
  if (type == Sensor.TYPE_ACCELEROMETER) {
  data = mGData;
  } else if (type == Sensor.TYPE_MAGNETIC_FIELD) {
  data = mMData;
  }
 
 for (int i=0 ; i3 ; i++){
  data[i] = event.values[i];
  }
 
  SensorManager.getRotationMatrix(mR, mI, mGData,
   mMData);
 
  SensorManager.getOrientation(mR, mOrientation);
  float incl = SensorManager.getInclination(mI);
  String endl = System.getProperty(line.separator);
  if (mCount++  50) {
  final float rad2deg = (float)(180.0f/Math.PI);
  mCount = 0;
  txZ.setText(Azimuth:  +
   (int)(mOrientation[0]*rad2deg) + 
   degrees + endl +
  Pitch:  +
   (int)(mOrientation[1]*rad2deg) +  degrees + endl +
  Roll:  +
   (int)(mOrientation[2]*rad2deg) +  degrees + endl +
  incl: + (int)(incl*rad2deg));
  }
 
   Many Thanks
   Michael
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, 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

Re: [android-developers] Re: Force hdpi drawables on mdpi-xlarge devices

2011-07-03 Thread Dianne Hackborn
It uses a facility that is under development in the platform to do mipmap
style drawables.  It isn't in any way running at hdpi; it is loading
application icons to have a larger size.

On Sun, Jul 3, 2011 at 1:03 AM, Federico Carnales fedecarna...@gmail.comwrote:

 On May 23, 7:49 pm, Dianne Hackborn hack...@android.com wrote:
  Don't force the Xoom to use hdpi.  You will be inconsistent with every
 other
  app, all of which are using the Xoom's correct density which is mdpi.
 
  Why do you want to do this?
 
  As I've said, Galaxy Tab made a design decision to use a larger density
 and
  thus have a blown up UI.  Again use the density the device reports so you
  are consistent with the UI in the rest of the device.
 
  Trying to play games like this is only going to lead to pain.  Use the
  density the device reports.

 Doesn't the stock Honeycomb launcher force HDPI drawables for the app
 icons?

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




-- 
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: Force hdpi drawables on mdpi-xlarge devices

2011-07-03 Thread Dianne Hackborn
Yes as I said this is some initial work on doing mipmaps, and oh hey look at
that if you are doing a mipmap there is a larger bitmap there that can be
used if you want a larger size image.

On Sun, Jul 3, 2011 at 2:16 PM, nadam a...@anyro.se wrote:

 Just tested this on my Motorola XOOM with Android 3.0.1 and it is
 using the icon.png from res/drawable-hdpi even though the device is
 mdpi.

 On 3 Juli, 10:05, Federico Carnales fedecarna...@gmail.com wrote:
  On May 23, 7:49 pm, Dianne Hackborn hack...@android.com wrote:
 
   Don't force the Xoom to use hdpi.  You will be inconsistent with every
 other
   app, all of which are using the Xoom's correct density which is mdpi.
 
   Why do you want to do this?
 
   As I've said, Galaxy Tab made a design decision to use a larger density
 and
   thus have a blown up UI.  Again use the density the device reports so
 you
   are consistent with the UI in the rest of the device.
 
   Trying to play games like this is only going to lead to pain.  Use the
   density the device reports.
 
  Doesn't the stock Honeycomb Launcher force HDPI drawables for the app
  icons?

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




-- 
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] Aw: AsyncTask, Runnable Thread, ???

2011-07-01 Thread Dianne Hackborn
I think the change will be in Ice Cream Sandwich.  Probably shouldn't have
written the documentation the way it is, the next release is so
meaningless. :p

On Fri, Jul 1, 2011 at 11:56 AM, Mark Murphy mmur...@commonsware.comwrote:

 On Fri, Jul 1, 2011 at 2:33 PM, Kostya Vasilyev kmans...@gmail.com
 wrote:
  Ah, yes, you're right, 3.0 shipped with no change wrt. to previous
 versions,
  sorry.
 
  http://groups.google.com/group/android-developers/msg/3deeb36dccb4e9a5

 Yeah, I have an eye out for when this change actually occurs and the
 promised explanation. I'm hoping it comes with a brass band or
 something to make it blindingly obvious to everyone what to do,
 particularly supporting older devices.

 --
 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.5 Available!

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




-- 
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] Orientation in landscape

2011-06-29 Thread Dianne Hackborn
http://android-developers.blogspot.com/2010/09/one-screen-turn-deserves-another.html

On Wed, Jun 29, 2011 at 10:22 AM, Mike D mdavie...@gmail.com wrote:

 Hi guys,

 I've been playing around with orientation (especially in relation to
 the real world so finding north is very useful) and started with the
 google api example.

 While investigating how to change that so it worked while the phone
 was in landscape I found out that I was using depricated components.
 So now I'm using the acceloromiter and the magnetic field to find the
 orientation which I found in a mixture of examples on the web.

 This again works great while in portrain but landscape gives weird
 answers?

 I've done some experiments with looking at the different between
 landscape and portrait but can't seem to find out what's going on and
 how to correct the app to allow me to switch between portrain and
 landscape on the fly.

 I don't think it's quite as simple and minusing 90 degrees but I'm
 willing to be wrong.

 Here's my SensorListener onSensorChanged

 int type = event.sensor.getType();
float[] data;
if (type == Sensor.TYPE_ACCELEROMETER) {
data = mGData;
} else if (type == Sensor.TYPE_MAGNETIC_FIELD) {
data = mMData;
}

   for (int i=0 ; i3 ; i++){
data[i] = event.values[i];
}

SensorManager.getRotationMatrix(mR, mI, mGData,
 mMData);

SensorManager.getOrientation(mR, mOrientation);
float incl = SensorManager.getInclination(mI);
String endl = System.getProperty(line.separator);
if (mCount++  50) {
final float rad2deg = (float)(180.0f/Math.PI);
mCount = 0;
txZ.setText(Azimuth:  +
 (int)(mOrientation[0]*rad2deg) + 
 degrees + endl +
Pitch:  +
 (int)(mOrientation[1]*rad2deg) +  degrees + endl +
Roll:  +
 (int)(mOrientation[2]*rad2deg) +  degrees + endl +
incl: + (int)(incl*rad2deg));
}

 Many Thanks
 Michael

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] ANR Reason: keyDispatchingTimedOut when drawing overlay on map?

2011-06-28 Thread Dianne Hackborn
When the ANR happens all of the process's stacks are written to this file,
with the process being accused of the ANR first.  All this is doing is
dumping the file so you can look at it.  So you just want to look at it some
time after the ANR, before another ANR happens.

On Tue, Jun 28, 2011 at 7:51 AM, Boozel boozelcl...@gmail.com wrote:

 Can you give me some more information on how to use this? do i run it after
 the ANR?
 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] battery status check

2011-06-28 Thread Dianne Hackborn
This has nothing to do with Android, it is Motorola's driver and/or
hardware.

I argued with them about this whole 10% increment thing on the Droid.  Sad
to see they are still doing it.

On Tue, Jun 28, 2011 at 6:32 AM, Mystic Prowler coolmar...@gmail.comwrote:

 Well, i have a Motorola Droid X running 2.3.3, and it does that no matter
 what OS it has. Is there a way to change it a hack?


 On Tue, Jun 28, 2011 at 7:13 AM, Mark Murphy mmur...@commonsware.comwrote:

 On Tue, Jun 28, 2011 at 7:00 AM, Mystic Prowler coolmar...@gmail.com
 wrote:
  Juts asking, why is that when Android phones are charging or
 discharging, it
  shows in 10% intervals and below 20% it goes down to 5% intervals. Can
 it be
  changed to 1% intervals for more accuracy?

 That is up to the device manufacturer. Some devices report 1%
 intervals all along. Others -- notably some Motorola devices -- behave
 has you describe.

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




-- 
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] Why is it so slow to light on the phone

2011-06-28 Thread Dianne Hackborn
There is nothing in the system code that knows or cares that the wallpaper
is a live wallpaper.  In fact the static wallpaper is just a live
wallpaper that is implement by the system and draws a static image.

My first guest would be that your wallpaper is consuming a lot of CPU and
thus slowing down other stuff.

On Tue, Jun 28, 2011 at 6:25 PM, June Hello
junehelloworld.he...@gmail.comwrote:

 Dear all,

 I have encountered a problem. If I use live wallpaper and make phone be in
 sleep state, then I press power key to turn the phone on

 I find it is very slow to light the phone on. If I use static wallpaper, it
 is relatively fast.

 So I wonder what is the main cause? and where is the relative source  code?

 thanks in advance.

 Best Regards!

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




-- 
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] Gmail, content providers, and formalising support..

2011-06-27 Thread Dianne Hackborn
This is purely an issue for Google with their gmail application.

I don't know that much about what goes on with the Google apps, but I
suspect it is very unlikely for there to be an API like this.  At the very
least, I would say giving the user access to read all of your e-mails is
*way* more serious than just throwing it behind an install-time permission.
 Consider other things that need more than that: IMEs, device admins, etc.

So I would not hold my breath for this.

On Mon, Jun 27, 2011 at 3:58 AM, Mark Murphy mmur...@commonsware.comwrote:

 On Sun, Jun 26, 2011 at 6:42 PM, Mark mmcg...@gmail.com wrote:
  With honeycomb, something has changed with the provider, thus breaking
  the functionality of these apps, and yes i realise again the response
  will be tough luck, thats what happens when you use unsupported apis
  and functionality, and i *completely* appreciate that. What i'm
  interested in is more if there will ever be concrete support for
  developers to access the gmail content provider or some equivalent api
  to provide the kind of functionality people actively require these
  days?

 I inquired about formalizing support for these undocumented content
 providers recently, and the answer was that it is not a priority.

 Of all of them, Gmail would seem to be the least likely to be
 supported, simply because it is not in the AOSP.

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

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

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




-- 
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] ANR Reason: keyDispatchingTimedOut when drawing overlay on map?

2011-06-27 Thread Dianne Hackborn
Do adb shell cat /data/anr/traces.txt to see what your app was busy doing
at that point.  This is the very first step you need to take: understand
what your app is doing that is causing the ANR.

The next step I would take from that, if it is not enough to solve the
problem, is profile your app.

Note that the ANR dialog happens after your application has been
unresponsive for 5 seconds.  This is a heck of a long time.

On Mon, Jun 27, 2011 at 7:32 AM, Boozel boozelcl...@gmail.com wrote:

 Hi i'm trying to draw an overlay onto a google map but i sometimes get an
 ANR Reason: keyDispatchingTimedOut .
 Can any one tell me what the best structure is to do the drawing and
 prevent this?
 My code is below. Thanks in advance for any help

 public class MyMap extends MapActivity {
 /** Called when the activity is first created. */
  DBHelper dbhelp;
 final String TAG = SignalSpot;
 String [][]rows;
  MapView mapView;
 Paint mPaint;
 Handler serviceHandler;
 RunTask rt;
  MyLocationOverlay myLocationOverlay;
 @Override
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.map);

 dbhelp = new DBHelper(this);

 refreshHeatmapData();
 //TODO periodically refresh heatmap

 mapView = (MapView) findViewById(R.id.mapview);
 mapView.setBuiltInZoomControls(true);

 myLocationOverlay = new MyLocationOverlay(this, mapView);
 mapView.getOverlays().add(myLocationOverlay);

 serviceHandler = new Handler();
 rt = new RunTask();
 serviceHandler.postDelayed(rt ,5*1000);

 myLocationOverlay.enableMyLocation();

 mapView.getOverlays().add(new MyOverlay());
 }

 @Override
 public void onDestroy()
 {
  super.onDestroy();
  myLocationOverlay.disableMyLocation();
  serviceHandler.removeCallbacks(rt);
 }

 public void refreshHeatmapData()
 {rows = dbhelp.getAllRows(-1);}


 @Override
 protected boolean isRouteDisplayed() {
 return false;
  }
  class MyOverlay extends Overlay{
 public MyOverlay(){}

 public void draw(Canvas canvas, MapView mapv, boolean shadow){
 super.draw(canvas, mapv, shadow);

 Projection p = mapv.getProjection();

 Log.i(TAG,MAP NO OF ROWS: +rows.length);

 for(int i=0;irows.length;i++)
 { Log.i(TAG,ACtual Data to draw: +rows[i][2]+, +rows[i][3]);
  int x = (int)(Double.parseDouble(rows[i][2])*1E6);
  int y = (int)(Double.parseDouble(rows[i][3])*1E6);
  Log.i(TAG,Drawing point No:+i+ @ +x+,+y);
  GeoPoint in = new GeoPoint(x,y);
 Log.i(TAG,GEO POINT- lat: +in.getLatitudeE6()+, lon:
 +in.getLongitudeE6());
 Point pixels = p.toPixels(in,null);
 double ss = Double.parseDouble(rows[i][4]);
 //test code for constant circle when zooming
float radius = p.metersToEquatorPixels(100);

RadialGradient g = new RadialGradient(pixels.x, pixels.y,
 radius,getColor2(ss) , null,TileMode.CLAMP);

Paint gp = new Paint();
 gp.setShader(g);
 //myCanvas.drawCircle(x, y, radius, gp);

 canvas.drawCircle(pixels.x, pixels.y, radius, gp);

 }

 }
  }
   class RunTask implements Runnable
 {
 public void run()
  { Log.i(TAG,Map data refresh run task);
 refreshHeatmapData();
  serviceHandler.postDelayed( this, 5*1000 );
 }
 }
  }

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

2011-06-27 Thread Dianne Hackborn
You can't do this.  You must go through the UI.

2011/6/27 Jérôme Beau javar...@gmail.com

 By debugging the Android source code, I can see that the native activity
 manager returns -1 (IActivityManager.START_INTENT_NOT_RESOLVED), when asked
 to:

 startActivity(
 android.app.ActivityThread$ApplicationThread@40513a00,

 Intent { act=android.intent.action.PACKAGE_INSTALL
 dat=/android_asset/Android-release.apk
 typ=application/vnd.android.package-archive flg=0x1000 },
 application/vnd.android.package-archive,
 grantedUriPermissions = null,
 grantedMode = 0,
 resultWho = 0,
 requestCode = -1,
 onlyIfNeeded = false,
 debug = false
 )

 Does someone know if this because nobody listens (have intent filters)
 to android.intent.action.PACKAGE_INSTALL ? Such a Intent constant seems to
 be used nowhere.

 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] Question on Broadcast receiver with some prioroty set and category set as Home

2011-06-25 Thread Dianne Hackborn
(1) Third party applications can't have a priority higher than 0.
(2) A receiver is different than an activity, and will not handle intents
that are being used to launch an activity, so your receiver here will never
have any reason to run.

On Sat, Jun 25, 2011 at 2:54 AM, Sudeep Sharma sudeep.andr...@gmail.comwrote:

 Hi,
   I have an application set as Home category having higher priority
 than the normal Home app. This is to show my app first as soon as the phone
 boots up.

 I have a broadcast receiver also within my manifest which also has same
 category home with priority even more than of my activity.

 Problem is when the phone is booted i do not see control coming in the
 Broadcast reciever (xyzReciever) at all although its priority is higher than
 that of activity.

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

 not applicable for Broadcast recievers?

 *Activity Properties*
 activity android:name=.ABC
   android:launchMode=singleTask
   android:clearTaskOnLaunch=true
   android:configChanges=keyboardHidden|orientation
   android:excludeFromRecents=true 
 intent-filter android:priority=*101*
 action android:name=android.intent.action.MAIN /
 category android:name=android.intent.category.HOME /
 category android:name=android.intent.category.DEFAULT /
 /intent-filter


 *Reciever properties*
 receiver android:name=.xyzReciever
 intent-filter android:priority=*102*
 action android:name=android.intent.action.MAIN /
 category android:name=android.intent.category.HOME /
 category android:name=android.intent.category.DEFAULT /
 /intent-filter
 /receiver
 Please respond I shall be thankful.

 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] Full screen on HTC sensation (qHD)

2011-06-24 Thread Dianne Hackborn
Your application is running in screen size compatibility mode.  The easiest
way to fix this it to set an android:targetSdkVersion of 4 or greater.  More
info here:

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

On Thu, Jun 23, 2011 at 7:01 AM, GekkeHenkie wiel...@gmail.com wrote:

 Hi,

 I'm creating my first android app, which I derived from the
 BluetoothChat example.

 However, on my phone (HTC sensation with qHD resolution, 540 bij 960
 pixels) the lowest inch of the screen and a few lines at the sides are
 not used by the app. See these images:

 http://dl.dropbox.com/u/16350275/android/withoutmenu.png
 http://dl.dropbox.com/u/16350275/android/withmenu.png

 The layout-items are set to fill_parent so I expected something like
 this (scaled, but set at right resolution in eclipse):
 http://dl.dropbox.com/u/16350275/android/eclipse.png

 Has anybody an idea where I should look to fix this? So far I didn't
 find any reference in the projectfiles to the screenresolution.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Launch timeout has expired, giving up wake lock!

2011-06-24 Thread Dianne Hackborn
This means that your main thread is continually running, pumping message
through its message queue without ever going idle.  If that is what you
want, there is nothing to fix.  This is why the log message is a warning,
not an error.

On Fri, Jun 24, 2011 at 11:12 AM, dario ber...@gmail.com wrote:

 Hello

 I tryed to start Activity from other Activity

 startActivity(Main.this,Game.class);


 and when Game activity is show on the screen after 1-2 sec its go left
 and make black screen and its write this warrning

 05-17 10:07:24.819: WARN/ActivityManager(73): Launch timeout has
 expired, giving up wake lock!
 05-17 10:07:24.849: WARN/ActivityManager(73): Activity idle timeout
 for ActivityRecord{40968180 game.android.test/.Game}

 what I can to fix?

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Honeycomb: How can I set the Mouse position?

2011-06-24 Thread Dianne Hackborn
No it is not.

On Fri, Jun 24, 2011 at 2:19 PM, Devomat mo...@2aba.de wrote:

 Hi,

 I have a Asus Transformer with Dock-Keyboard + external USB Mouse. Now
 I wont to set the mouse pointer at a specific position. Is that
 possible?

 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] Device administration disabling

2011-06-23 Thread Dianne Hackborn
This is deliberately not supported.  The current device admin API is not for
an admin to own the device, it is for it to share sensitive things it is
protecting with the user's device.

On Thu, Jun 23, 2011 at 9:42 AM, garaus m.shu...@gmail.com wrote:

 Hi everybody,

 Device administration app can't not be uninstalled if it is not
 disabled. User can disable Device Administrators from the settings.
 When company gives android devices to its employees, company wants to
 have a control over devices, their statuses and policies, but user can
 easily get rid of that control. Does anybody know how it is possible
 to prevent user from disabling Device Administrators?
 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: Jackson Object Mapping is so slow in the process with an Activity.

2011-06-23 Thread Dianne Hackborn
Attaching the debugger turns off the JIT, and requires that Dalvik code
running in that process do some work to keep in sync with the debugger.
 When you do a Binder call, you are having code execute in another process,
which is not running under the debugger.

On Thu, Jun 23, 2011 at 9:37 AM, Kostya Vasilyev kmans...@gmail.com wrote:

 Yeah, pretty much any application-side code takes a hit under the debugger,
 not just JSON parsing.

 Android API methods that are implemented as Binder (RPC) calls don't seem
 to take a hit, but any Java code within the application does, and that
 includes the framework as well.

 Thanks for sharing the information, though.

 You might want to test on a real device to get more real-world performance
 numbers. The emulator (even 1.6 on a fast machine) is slower than a
 mid-grade phone, and each version of Android gets progressively slower when
 emulated.

 -- Kostya

 2011/6/23 idleSun idle...@gmail.com

 It turns out that it is slow when I run it in debug mode. So it is not
 a big deal. However, if you have a heavy jackson use and want to debug
 your code then you got to be really patient.


 On Jun 22, 10:59 am, idleSun idle...@gmail.com wrote:
  I am using pretty complicated JSON data with Object Mapping to Java
  Classes that are of course also pretty complicated (inheritance depth

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] How to used new Canvas()?

2011-06-23 Thread Dianne Hackborn
Getting stuck in lockCanvas() has nothing to do with creating a new
Canvas...

On Thu, Jun 23, 2011 at 1:51 PM, Baodong Chen chenbdche...@gmail.comwrote:

 Hi All:
  Can anyone be so kind to give me an example to show how to used new
 Canvas() to create my own Canvas object
  and how to use it to draw something like a Bitmap and the show my
 Canvas object on device's display?
  I want to do this becasue in my APP, i am doing follows in a native
 thread through JNI call:
 Canvas c = mSurfacerHolder.lockCanvas() ;
  c.dramBitmap();
 mSurfacerHolder.unlockCanvasAndPost();

  and on some devices,sometimes my APP freezed, and I found my draw
 thread is freezed in lockCanvas() call.


  best regards, 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] Fullscreen surface view

2011-06-22 Thread Dianne Hackborn
Why are you setting anyDensity to false?  Don't do that.

And really, it's 2011.  Just set android:targetSdkVersion to = 4 and let
the default modern values for these be used. :)

On Tue, Jun 21, 2011 at 11:46 PM, Martin Wallgren martin.wallgren.it@
gmail.com wrote:

 Hi,

 I'm trying to create a SurfaceView that covers the screen and that
 does not have any scaling.

 In My AndroidManifest I have

supports-screens
android:smallScreens=true
android:normalScreens=true
android:largeScreens=true
android:anyDensity=false /

 and in the constructor of my surfaceView I do
  getHolder().setFixedSize(screenWidth, screenHeight); // 480, 800 in
 my current emulator

 The call I get to surfaceChanged is indeed the correct dimensions
  06-22 06:37:28.889: DEBUG/AnimatorThread(690): surfaceChanged
 width=480 heigth=800

 But when I lock the canvas I get a canvas that is only 320, 533
  06-22 06:37:28.969: DEBUG/AnimatorThread(690): Canvas[w=320, h=533]

 I believe this has to do with dpi scaling. When I draw a bitmap that
 is 480x800 to that canvas it will only get painted within the bounds
 of the canvas (of course), and the pixels outside the canvas does not
 get painter.

 What can I do to get a fullscreen SurfaceView that has the same size
 on the canvas as the pixel dimensions of the screen?

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Any frameworks for app development on Android based tablets

2011-06-22 Thread Dianne Hackborn
You're crazy.  Don't use that, it sucks.  It doesn't even let you use
multiple inheritance.

On Wed, Jun 22, 2011 at 11:49 AM, Justin Anderson magouyaw...@gmail.comwrote:

 * I've heard good things about Google's Android SDK for development of
 apps for Android-based tablet devices.*

 I second that! You can do all sorts of things with Google's Android SDK for
 Android-based tablet devices.

 Thanks,
 Justin Anderson
 MagouyaWare Developer
 http://sites.google.com/site/magouyaware



 On Wed, Jun 22, 2011 at 12:46 PM, TreKing treking...@gmail.com wrote:

 On Tue, Jun 21, 2011 at 3:27 PM, spr myofferma...@gmail.com wrote:

  we are currently evaluating/
 exploring any open-source or commercial frameworks that support
 development of apps for Android-based tablet devices. Please suggest
 if you have already come across any such frameworks or vendors.


 I've heard good things about Google's Android SDK for development of apps
 for Android-based tablet devices.


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


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


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] how to get a toast exactly on buttons

2011-06-22 Thread Dianne Hackborn
It really isn't what toasts are for.  There are, however, other options like
PopupWindow.

On Wed, Jun 22, 2011 at 12:06 PM, TreKing treking...@gmail.com wrote:

 On Tue, Jun 21, 2011 at 12:19 PM, ali ashraf ali.21.ash...@gmail.comwrote:

 i have around 14 different XML. In each XML i have 26 buttons all have
 different positions using android:layoutAlignLeft=300sp... etc
 Like button1 to button26 are set in such a way that all scatter on the
 UI. This way i have 14 xml. All XML have the same 26 buttons at
 different positions. These XML come on the UI randomly i.e at run time
 it is decided tht which XML will take the UI.


 That sounds ... lovely.


  PROBLEM:-

 as any of the XML gets inflated on the UI and when i click on the button i
 want a toast exactly on the button.


 You can't do that, AFAIK. That is, you cannot specify a location for a
 Toast.


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


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




-- 
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: Generic resizable appwidgets in Android 3.1

2011-06-22 Thread Dianne Hackborn
Yes this is for widgets whose layouts can resize.  Specifically, it is for
things like the new list app widgets and such that intrinsically have an
expandable amount of content.

On Wed, Jun 22, 2011 at 4:03 PM, Zsolt Vasvari zvasv...@gmail.com wrote:

 While I don't know the answer.  I think resizable widgets are for
 things like lists where you would use a weight=1 type of setup to
 fill up all the space given to you.

 So basically, you need to fit your entire layout into the smallest
 possible size you gave in the desriptor and then size one or more of
 the views to fill up the the extra space, if any.

 I don't believe it's a generic replacement for a 1x1, 2x2, 3x3 type of
 widget where you actually use different layouts to display more info.

 On Jun 23, 3:14 am, String sterling.ud...@googlemail.com wrote:
  Following on from my other resizable appwidgets post from this morning,
  this is a cross-post from StackOverflow, where the question has had all
 of 9
  views...
 
  I was happy to see support for resizable appwidgets arrive with Android
 3.1,
  but I'm stumped on how to make them actually work.
 
  I'm no appwidget novice, and have no problem adding
 
  android:resizeMode=horizontal|vertical
 
  to my appwidget definition XML. And that works as far as it goes, the
 widget
  is nominally resizable (long-press on it and handles appear that let me
 drag
  the border to different sizes).
 
  Two problems, though:
 
  First, it doesn't appear that my code gets called when the widget is
  resized. A breakpoint set in myonReceive() handler never gets hit, logcat
  messages I put in never appear, and so forth.
 
  Second, assuming that I can get into my code, I can't see anywhere in the
  docs to get the current size of the widget. I'm already using calls to
  AppWidgetProviderInfo.minWidth and .minHeight, but those only reflect the
  minimum dimensions given in the XML, they don't change at runtime.
 
  So, how is one meant to actually implement a resizable widget?
 
  String

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

2011-06-22 Thread Dianne Hackborn
Your views do need to have an android:id assigned to them to be able to
save/restore their state automatically (otherwise they wouldn't be able to
correlate the data between the old and new view hierarchies).

On Wed, Jun 22, 2011 at 1:30 PM, TreKing treking...@gmail.com wrote:

 On Wed, Jun 22, 2011 at 3:16 PM, EmbSysPro char...@embsyspro.com wrote:

 Firstly, what you state has not been my experience and it did not and
 does not work on my devices.  Perhaps there is another issue involved,
 but the only reason I went to such toil is expressly because I had to
 do so for every field to remain the same upon an orientation change.
 I've got both an android v2.2.1 device and an android v1.5 device and
 they both exhibit the behavior that I describe above.  But both are
 from the same vendor and I'll need to investigate why I'm seeing what
 I'm seeing.


 Very strange. One of my Activities is a simple form with an EditText and
 some Checkboxes. I do NOT save and restore state in this Activity. If I
 enter text in the EditText and check some boxes, then rotate my phone, all
 data is restored, as expected.

 This is on Nexus One 2.3.4, G1 with 1.6 and just ran it on a 1.5 AVD for
 shits and giggles. All work as expected.

 It would be a sad state of affairs indeed if every developer had to
 manually save and restore every single piece of static UI data in every
 Activity in this fashion.

 Try getting rid of one of your save / restore combos and see what happens.


  Secondly, since I had suffered from the same problem as Suresh and the
 only answer he was receiving was advising him to RTFM I thought that I
 would try to help.


 I was not faulting you for trying to help, if that's what you took from my
 post. My response to the OP was RTFM because his question was so vague and
 generic and the concepts for his broad query are explained in the
 documentation.


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

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




-- 
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: Strange device?

2011-06-21 Thread Dianne Hackborn
Don't believe written documentation at this point, there has been some chaos
in this.  The current official numbers used by the platform implementation
are:

Normal -- 320dp x 480dp
Large - 480dp x 640dp
XLarge - 720dp x 960dp

Technically in the impl Small is just smaller than normal, but as per the
CDD the smallest this can be is 320dp x 426dp.

* *I really need to write a blog post about this, especially on conjunction
with some other stuff coming up. :}

On Mon, Jun 20, 2011 at 9:57 PM, Zsolt Vasvari zvasv...@gmail.com wrote:

 Dianne, I found the following table in attrs_manifest.xml

attr name=screenSize
!-- A small screen configuration, at least 240x320db. --
enum name=small value=200 /
!-- A normal screen configuration, at least 320x480db. --
 
enum name=normal value=300 /
!-- A large screen configuration, at least 400x530db. --
enum name=large value=400 /
!-- An extra large screen configuration, at least
 600x800db. --
enum name=xlarge value=500 /
/attr

 Are those correct?  I couldn't find the code where it would do the
 checking -- I guess it's in native code.

 On Jun 21, 10:17 am, Zsolt Vasvari zvasv...@gmail.com wrote:
  Thanks, Dianne.  I am actually happy that OEMs are trying to push the
  envelop with these devices.  Some of these strange form factors may
  stick.
 
  So the division point between normal and large is 480dp x 640dp.
 
  Can you please tell me (or point me to a source) what the division
  points between small/normal and large/xlarge are?
 
  On Jun 21, 9:51 am, Dianne Hackborn hack...@android.com wrote:
 
 
 
   Yeah, 240/160.  hdpi == 240, mdpi == 160.
 
   This device should not normally run applications on both screens.
 
   Actually, this is what they did:
 https://market.android.com/details?id=com.kyocera.tabletmodeextension...
 
   So it is a compatible device for purposes of passing the CDD, but you
 can
   download an app of theirs that makes it incompatible.
 
   Writing the CDD sometimes feels like trying to do a deal with the
 devil. :p
 
   On Mon, Jun 20, 2011 at 6:41 PM, Zsolt Vasvari zvasv...@gmail.com
 wrote:
Got it.  It's the density float in DisplayMetrics.
 
On Jun 21, 9:36 am, Zsolt Vasvari zvasv...@gmail.com wrote:
 I am sorry, how did you get
 
 533dp x 640dp
 
 from
 
 800x960 hdpi screen?
 
 Can you please provide this calculation?  Obviously, you divided by
 1.5, but where did the 1.5 magic constant come from?  I would like
 to
 use this info to determine in my app if I am running on a screen at
 least LARGE and do some stuff differently.
 
 On Jun 21, 9:19 am, Dianne Hackborn hack...@android.com wrote:
 
  To be compatible, a device like this would need to run apps in
 only one
of
  the screens.  What it means to run in two screens is not well
 defined.
 
  Fwiw, the division point between normal and large is 480dp x
 640dp.  So
a
  800x960 hdpi screen is 533dp x 640dp, just barely classifying as
 large.
 On
  the other hand the aspect ratio of that screen is only 1.2, which
 is
not
  compatible according to the CDD.  It is also not compatible to
 change
the
  screen configuration, so there are two reasons it must run
 applications
on
  one screen for compatibility.
 
  On Mon, Jun 20, 2011 at 5:24 PM, Zsolt Vasvari 
 zvasv...@gmail.com
wrote:
   The Flipout has a 320x240 screen.  Ths is definetely the
 Kyocera
Echo.
 
   My only question when supporting this device is if the screen
   consdered Medium or Large?  4.7 seems to be borderline on the
 screen
   size chart.
 
   On Jun 20, 11:40 pm, Dan dan.schm...@gmail.com wrote:
My bet is the Motoroal Ruth/Flipout
 
   http://phandroid.com/motorola-flipout/
 
On Jun 19, 6:56 pm, Zsolt Vasvari zvasv...@gmail.com
 wrote:
 
 As part of my app, if I notice a screen size/DPI combo I
 haven't
 tested on, I pop-up a dialog and ask the user to send me an
e-mail
 about that.
 
 Here's what I got yesterday:
 
 Display width: 800
 Display height: 960
 Display DPI: 240
 
 Anybody has a clue as to what kind of device has a 800x960
squarish
 screen.  The HDPI indiciates that it's a phone.  I asked
 the
user, but
 he hasn't come back to me -- my guess it's something
 unreleased.-
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

Re: [android-developers] Saving a NinePatch to Temp Storage

2011-06-21 Thread Dianne Hackborn
There is no easy way to do this.  You will need to manually generate a PNG
image that has included in it a 9-patch chunk whose contents match the
description here:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=include/utils/ResourceTypes.h;h=10baa11a5114a4efd3ddb1d7fc4d870d8a2e8401;hb=HEAD#l45

On Tue, Jun 21, 2011 at 6:37 AM, Jake Colman col...@ppllc.com wrote:


 I am trying to allow the user to specify the background color of a
 ninepatch that is part of my res/drawble directory.  The modified
 ninepatch will then be set as the background image for my widget.  I
 realize that you cannot change the contents of res/drawble so I have to
 write the image to temporary storage and then use setImageFromURI to
 point at the modified ninepatch.

 I cannot figure out, however, how to save the image.

 I have the following code:

 Drawable bg = this.getResources().getDrawable(R.drawable.appwidget_bg);
 bg.mutate();
 bg.setColorFilter( color, PorterDuff.Mode.MULTIPLY );

 What method can I now use to write this out?  There do not seem to be
 any methods on Drawable that will persist an image.  Is there a helper
 class that I need to use?  I did look at BitmapFactory but, unless I
 misunderstood, it didn't seem to be the solution.

 Is there a preferred location to use for this kind of temporary file?

 Is there a better recommended way of doing what I am trying to do?

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




-- 
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: Strange device?

2011-06-21 Thread Dianne Hackborn
Yes that is the main thing I am talking about there being some chaos in the
definitions. :/

On Mon, Jun 20, 2011 at 11:58 PM, Zsolt Vasvari zvasv...@gmail.com wrote:

 Ok, thanks.

 I am testing on the original 7 Galaxy Tab, which is a 600x1024 HDPI
 device, which gives 400dpx683dp, so unless I am misunderstanding you,
 it should be classificed as a Normal screen device, but it seems to be
 pulling resources from the Large folders.

 Is there special handling for just this case, or is it really supposed
 to be an OR instead of an AND when it comes to width/height sizes?


 On Jun 21, 2:37 pm, Dianne Hackborn hack...@android.com wrote:
  Don't believe written documentation at this point, there has been some
 chaos
  in this.  The current official numbers used by the platform
 implementation
  are:
 
  Normal -- 320dp x 480dp
  Large - 480dp x 640dp
  XLarge - 720dp x 960dp
 
  Technically in the impl Small is just smaller than normal, but as per the
  CDD the smallest this can be is 320dp x 426dp.
 
  * *I really need to write a blog post about this, especially on
 conjunction
  with some other stuff coming up. :}
 
 
 
 
 
  On Mon, Jun 20, 2011 at 9:57 PM, Zsolt Vasvari zvasv...@gmail.com
 wrote:
   Dianne, I found the following table in attrs_manifest.xml
 
  attr name=screenSize
  !-- A small screen configuration, at least 240x320db. --
  enum name=small value=200 /
  !-- A normal screen configuration, at least 320x480db. --
 
  enum name=normal value=300 /
  !-- A large screen configuration, at least 400x530db. --
  enum name=large value=400 /
  !-- An extra large screen configuration, at least
   600x800db. --
  enum name=xlarge value=500 /
  /attr
 
   Are those correct?  I couldn't find the code where it would do the
   checking -- I guess it's in native code.
 
   On Jun 21, 10:17 am, Zsolt Vasvari zvasv...@gmail.com wrote:
Thanks, Dianne.  I am actually happy that OEMs are trying to push
 the
envelop with these devices.  Some of these strange form factors may
stick.
 
So the division point between normal and large is 480dp x 640dp.
 
Can you please tell me (or point me to a source) what the division
points between small/normal and large/xlarge are?
 
On Jun 21, 9:51 am, Dianne Hackborn hack...@android.com wrote:
 
 Yeah, 240/160.  hdpi == 240, mdpi == 160.
 
 This device should not normally run applications on both screens.
 
 Actually, this is what they did:
  https://market.android.com/details?id=com.kyocera.tabletmodeextension.
 ..
 
 So it is a compatible device for purposes of passing the CDD, but
 you
   can
 download an app of theirs that makes it incompatible.
 
 Writing the CDD sometimes feels like trying to do a deal with the
   devil. :p
 
 On Mon, Jun 20, 2011 at 6:41 PM, Zsolt Vasvari zvasv...@gmail.com
 
   wrote:
  Got it.  It's the density float in DisplayMetrics.
 
  On Jun 21, 9:36 am, Zsolt Vasvari zvasv...@gmail.com wrote:
   I am sorry, how did you get
 
   533dp x 640dp
 
   from
 
   800x960 hdpi screen?
 
   Can you please provide this calculation?  Obviously, you
 divided by
   1.5, but where did the 1.5 magic constant come from?  I would
 like
   to
   use this info to determine in my app if I am running on a
 screen at
   least LARGE and do some stuff differently.
 
   On Jun 21, 9:19 am, Dianne Hackborn hack...@android.com
 wrote:
 
To be compatible, a device like this would need to run apps
 in
   only one
  of
the screens.  What it means to run in two screens is not well
   defined.
 
Fwiw, the division point between normal and large is 480dp x
   640dp.  So
  a
800x960 hdpi screen is 533dp x 640dp, just barely classifying
 as
   large.
   On
the other hand the aspect ratio of that screen is only 1.2,
 which
   is
  not
compatible according to the CDD.  It is also not compatible
 to
   change
  the
screen configuration, so there are two reasons it must run
   applications
  on
one screen for compatibility.
 
On Mon, Jun 20, 2011 at 5:24 PM, Zsolt Vasvari 
   zvasv...@gmail.com
  wrote:
 The Flipout has a 320x240 screen.  Ths is definetely the
   Kyocera
  Echo.
 
 My only question when supporting this device is if the
 screen
 consdered Medium or Large?  4.7 seems to be borderline on
 the
   screen
 size chart.
 
 On Jun 20, 11:40 pm, Dan dan.schm...@gmail.com wrote:
  My bet is the Motoroal Ruth/Flipout
 
 http://phandroid.com/motorola-flipout/
 
  On Jun 19, 6:56 pm, Zsolt Vasvari zvasv...@gmail.com
   wrote:
 
   As part of my app, if I notice a screen size/DPI combo
 I
   haven't
   tested on, I pop-up a dialog and ask the user to send
 me an
  e-mail
   about

Re: [android-developers] Will static variables in a non-activity class remain in memory?

2011-06-20 Thread Dianne Hackborn
I wouldn't say yes.  Calling it often does not make sure it remains in
memory.  You are only guaranteed it will remain in memory for as long as
your app is in the foreground, that is as long as its process is required as
per:
http://developer.android.com/guide/topics/fundamentals/processes-and-threads.html

Once your app is no longer in the foreground -- because the user pressed
home, went to a notification, received a call, etc -- then your process may
be killed at any point and all bets are off.

On Mon, Jun 20, 2011 at 12:24 PM, Kostya Vasilyev kmans...@gmail.comwrote:

 Yes. This data will stay in memory for as long as the process is alive.


 2011/6/20 Droid rod...@gmail.com

 I am storing an ArrayList in a static variable in an ordinary (non
 activity) java class.
 It works correctly when I load it from an activity, but will it be
 guaranteed to remain
 in memory even when my activity is not calling it often?

 Here is the class:

 package com.maps.spoken;

 import java.util.ArrayList;

 public class NoWordRepeats {

public static ArrayListString ar = new ArrayListString();

 }

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




-- 
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] Cant stop service

2011-06-20 Thread Dianne Hackborn
You are responsible for stopping whatever work your service does in its
onDestroy().

You can look at the current state of all actively running services with adb
shell dumpsys activity services.  Make sure your service is actually in
there.  If it isn't, you aren't cleaning up your worker.

On Mon, Jun 20, 2011 at 1:34 PM, Boozel boozelcl...@gmail.com wrote:

 The service continues to write to the log

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

2011-06-20 Thread Dianne Hackborn
Hi, that is an impressive amount of work.

One thing I would suggest -- Android isn't really so divided into the areas
you use (human interface, system, multimedia, etc) and I think trying to
shove the pieces of it into those categories make this diagram a lot more
confusing than it needs to be, with a lot of lines crossing over other parts
of the diagram.

For example why is AccountManagerService under human interface?  It
doesn't do any UI, it just keeps track of the accounts the user has added to
their device.  Likewise LocationManagerService.

I can think of a couple different ways to organize the chart:

- As layers, with lower-level parts building on top of higher-level ones.
 For example, at the bottom is the hardware, next the Linux kernel, then
core user space pieces like init and the services it starts such as zygote,
installd, etc., then the system_process and things that run in it
(PackageManagerService, WindowManagerService, ActivityManagerService,
ClipboardManagerService, LocationManagerService, and on and on), and then
the client-side frameworks built on that (the view hierarchy, app package,
etc).

- Build a spine of the central part of Android: linux, zygote,
PackageManagerService, WindowManagerService, ActivityManagerService and
related items.  This is somewhat like your system category, but really the
core parts of the system (for example Launcher2 and Settings have nothing to
do with this).  Then you can have separate topical sections for sub-systems
that build out from this: the audo system, content providers, telephony,
etc.

On Mon, Jun 13, 2011 at 8:05 AM, Constantine conan...@gmail.com wrote:

 Hi Android developers,

 I am designing detailed diagram of Android internals. You can find it
 here: http://www.makelinux.net/android/internals/
 What do you think about it?
 Have you any ideas how to improve it?

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




-- 
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] skia / purging [x]k from font cache [y entries] - what does it mean? was Re: Custom Fonts

2011-06-20 Thread Dianne Hackborn
Well having it printed every second or so indicates you are pretty severely
thrashing the cache, which can certainly impact performance.  For example
drawing your UI may not be fitting in the cache so each frame you draw
requires re-rendering glyphs back in to the cache.  If that is the case,
look at doing things like reducing the number of distinct font sizes or
families/styles you are using to have less impact on the cache.

On Sun, Jun 19, 2011 at 11:33 PM, Adam Ratana adam.rat...@gmail.com wrote:

 Thanks for the speedy replies Romain and Diane. I take it now that we
 should not worry about it, beyond the typical known concerns for real-time
 drawing and rendering, etc.  Appreciated --

 Adam


 On Monday, June 20, 2011 2:22:14 AM UTC-4, Romain Guy (Google) wrote:

 Skia's font cache doesn't count towards your heap limit.

 On Sun, Jun 19, 2011 at 11:19 PM, Adam Ratana adam@gmail.com wrote:
  Thank you for responding; it seems to be freeing up quite often,
 probably
  several to more than several meg of memory a second (if the numbers are
  right), depending on how often the view is invalidated.  I know we are
  working with limited heap space, is this something we can optimize in
 our
  implementation or should we not be concerned at all?  Most of the text
 is
  the same, but could be generated with new string instances for example.
   Thanks,
  Adam
 
  On Monday, June 20, 2011 12:58:03 AM UTC-4, Dianne Hackborn wrote:
 
  It just means it needs to flush old data from the font cache.  You may
 see
  this a lot if you are for example drawing at a large number of sizes,
 as you
  fill up the font cache with glyphs in a lot of sizes and old glyphs
 need to
  be removed to make room.
 
  On Sun, Jun 19, 2011 at 9:17 PM, Adam Ratana adam...@gmail.com
 wrote:
 
  Hello, I am noticing the same with an implementation for some new
  functionality I'm experimenting with.  I am doing a lot of
 canvas.drawText
  calls on a custom View canvas, using the system font though.  Are you
 doing
  canvas.drawText a lot, Samuh?
  Also a bump in case anyone reading has knowledge on this subject.
   Wondering am I doing something stupid here, trying to avoid
 jankiness.
 
  On Wednesday, June 1, 2011 2:10:27 PM UTC-4, Samuh wrote:
 
  We are using four different custom fonts across our app. These files
  are bundled in Assets and are opened in onCreate of every Activity.
 
  While studying the logs of our app we keep observing the following
 log
  from Skia decoder.
 
  01-01 19:19:51.585: DEBUG/skia(1510): purging 197K from font cache
 [20
  entries]
 
  What does the above mean? And how does it affect performance?
 
  Is it desirable?
 
  Thanks.
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to androi...@googlegroups.com

  To unsubscribe from this group, send email to
  android-d...@googlegroups.com

  For more options, visit this group at
  http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en
 
 
  --
  Dianne Hackborn
  Android framework engineer
  hac...@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-d...@googlegroups.com
  To unsubscribe from this group, send email to
  android-develop...@**googlegroups.com
  For more options, visit this group at
  http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en

 --
 Romain Guy
 Android framework engineer
 roma...@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




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

Re: [android-developers] How to use whole screen on 1024x480 Android device (Acer Iconia Smart)?

2011-06-20 Thread Dianne Hackborn
That screen is outside of the compatible range of aspect ratios defined by
the CDD, so they presumably are limiting what an application sees to remain
compatible.  You will need to talk with the manufacturer about any APIs they
provide for applications to turn off that compatibility support.

On Sun, Jun 19, 2011 at 11:49 PM, Oliver oliver.trach...@gmail.com wrote:

 When running manually compiled Android apps on the Acer Iconia Smart,
 there always remains a black bar at the bottom of the screen that is
 not usable by the apps. This happens for my own as well as other apps
 compiled from source. Pre-installed apps do not show this behavior and
 make use of the whole screen.

 The device has a 1024x480 screen, but I can only make use of 855×480
 pixels. This is the size reported by
 getResources().getDisplayMetrics().

 So far, any attempts to fix the issue have failed, including:

 - manually changing the display metrics (using
 getResources().updateConfiguration(config, metrics).

 - setting all possible attributes of supports-screens to true in the
 Android manifest.

 android:minSdkVersion is set to 10, corresponding to the Android 2.3.3
 version on the device.

 Any ideas? Did anybody successfully deploy self-compiled apps on this
 device that make use of the entire screen estate?

 -Oliver

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

2011-06-20 Thread Dianne Hackborn
Sorry, third party applications can't get this permission.  You need to
launch the system's app widget picker for it to interact with the user to
determine what widget your app can display.

On Sun, Jun 19, 2011 at 1:27 AM, Bacon021 wei.pg...@gmail.com wrote:

 I am developing an launcher, and want to use the bindAppWidgetId
 method in my desktop edit mode, but the system notify me that the uid
 don't have the permission.
 I checked the permission definition, it's protect level is indeed
 system /signature, is there any method to realize the binding function
 without the change the certificate to system?


 I ever find a similar question and the answer was that the application
 only can use the UI selector to bind the app widget, I just want to
 know whether there is a workaround method to bind the widget ID?

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

2011-06-20 Thread Dianne Hackborn
To be compatible, a device like this would need to run apps in only one of
the screens.  What it means to run in two screens is not well defined.

Fwiw, the division point between normal and large is 480dp x 640dp.  So a
800x960 hdpi screen is 533dp x 640dp, just barely classifying as large.  On
the other hand the aspect ratio of that screen is only 1.2, which is not
compatible according to the CDD.  It is also not compatible to change the
screen configuration, so there are two reasons it must run applications on
one screen for compatibility.

On Mon, Jun 20, 2011 at 5:24 PM, Zsolt Vasvari zvasv...@gmail.com wrote:

 The Flipout has a 320x240 screen.  Ths is definetely the Kyocera Echo.

 My only question when supporting this device is if the screen
 consdered Medium or Large?  4.7 seems to be borderline on the screen
 size chart.

 On Jun 20, 11:40 pm, Dan dan.schm...@gmail.com wrote:
  My bet is the Motoroal Ruth/Flipout
 
  http://phandroid.com/motorola-flipout/
 
  On Jun 19, 6:56 pm, Zsolt Vasvari zvasv...@gmail.com wrote:
 
 
 
   As part of my app, if I notice a screen size/DPI combo I haven't
   tested on, I pop-up a dialog and ask the user to send me an e-mail
   about that.
 
   Here's what I got yesterday:
 
   Display width: 800
   Display height: 960
   Display DPI: 240
 
   Anybody has a clue as to what kind of device has a 800x960 squarish
   screen.  The HDPI indiciates that it's a phone.  I asked the user, but
   he hasn't come back to me -- my guess it's something unreleased.- 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




-- 
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] skia / purging [x]k from font cache [y entries] - what does it mean? was Re: Custom Fonts

2011-06-20 Thread Dianne Hackborn
Yes, that will do it.  Note that each angle you draw a glyph at needs a new
entry in the cache for the bitmap of the glyph drawn at that angle.

On Mon, Jun 20, 2011 at 6:42 PM, Adam Ratana adam.rat...@gmail.com wrote:

 After seeing this response, I spent some time to figure out exactly what I
 was doing now that was causing this to appear in the logs so much.  I was
 puzzled because I wasn't using many styles or colors, the same font, same
 color.  I turned off alpha blending, and removed all the items I was drawing
 until I was left with 1, and it was still overloading the cache.  I narrowed
 it down to doing:

 canvas.save();
 canvas.rotate(rotationAngle, p.x, p.y); // this is the offending line
 canvas.drawText(text, p.x, p.y, paint);
 canvas.restore();

 If I rotate and then draw text (this is an AR type implementation where the
 text is rotating with the phone), this is where the font cache fills up,
 with just 1 static piece of text.  Commenting out the above line doesn't.
  Even with a large number of text items, NOT rotating the canvas before
 drawing the text, doesn't fill the cache.

 This seems kind of strange to me that this would fill the cache, but, is
 there another way to do this to not fill the cache?




 On Mon, Jun 20, 2011 at 7:43 PM, Dianne Hackborn hack...@android.comwrote:

 Well having it printed every second or so indicates you are pretty
 severely thrashing the cache, which can certainly impact performance.  For
 example drawing your UI may not be fitting in the cache so each frame you
 draw requires re-rendering glyphs back in to the cache.  If that is the
 case, look at doing things like reducing the number of distinct font sizes
 or families/styles you are using to have less impact on the cache.




 --
 Adam Ratana
 adam.rat...@gmail.com

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




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

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

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

Re: [android-developers] Re: Strange device?

2011-06-20 Thread Dianne Hackborn
Yeah, 240/160.  hdpi == 240, mdpi == 160.

This device should not normally run applications on both screens.

Actually, this is what they did:
https://market.android.com/details?id=com.kyocera.tabletmodeextensionfeature=search_result

So it is a compatible device for purposes of passing the CDD, but you can
download an app of theirs that makes it incompatible.

Writing the CDD sometimes feels like trying to do a deal with the devil. :p

On Mon, Jun 20, 2011 at 6:41 PM, Zsolt Vasvari zvasv...@gmail.com wrote:

 Got it.  It's the density float in DisplayMetrics.

 On Jun 21, 9:36 am, Zsolt Vasvari zvasv...@gmail.com wrote:
  I am sorry, how did you get
 
  533dp x 640dp
 
  from
 
  800x960 hdpi screen?
 
  Can you please provide this calculation?  Obviously, you divided by
  1.5, but where did the 1.5 magic constant come from?  I would like to
  use this info to determine in my app if I am running on a screen at
  least LARGE and do some stuff differently.
 
  On Jun 21, 9:19 am, Dianne Hackborn hack...@android.com wrote:
 
 
 
   To be compatible, a device like this would need to run apps in only one
 of
   the screens.  What it means to run in two screens is not well defined.
 
   Fwiw, the division point between normal and large is 480dp x 640dp.  So
 a
   800x960 hdpi screen is 533dp x 640dp, just barely classifying as large.
  On
   the other hand the aspect ratio of that screen is only 1.2, which is
 not
   compatible according to the CDD.  It is also not compatible to change
 the
   screen configuration, so there are two reasons it must run applications
 on
   one screen for compatibility.
 
   On Mon, Jun 20, 2011 at 5:24 PM, Zsolt Vasvari zvasv...@gmail.com
 wrote:
The Flipout has a 320x240 screen.  Ths is definetely the Kyocera
 Echo.
 
My only question when supporting this device is if the screen
consdered Medium or Large?  4.7 seems to be borderline on the screen
size chart.
 
On Jun 20, 11:40 pm, Dan dan.schm...@gmail.com wrote:
 My bet is the Motoroal Ruth/Flipout
 
http://phandroid.com/motorola-flipout/
 
 On Jun 19, 6:56 pm, Zsolt Vasvari zvasv...@gmail.com wrote:
 
  As part of my app, if I notice a screen size/DPI combo I haven't
  tested on, I pop-up a dialog and ask the user to send me an
 e-mail
  about that.
 
  Here's what I got yesterday:
 
  Display width: 800
  Display height: 960
  Display DPI: 240
 
  Anybody has a clue as to what kind of device has a 800x960
 squarish
  screen.  The HDPI indiciates that it's a phone.  I asked the
 user, but
  he hasn't come back to me -- my guess it's something unreleased.-
 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
 
   --
   Dianne Hackborn
   Android framework engineer
   hack...@android.com
 
   Note: please don't send private questions to me, as I don't have time
 to
   provide private support, and so won't reply to such e-mails.  All such
   questions should be posted on public forums, where I and others can see
 and
   answer them.- Hide quoted text -
 
   - Show quoted text -- 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




-- 
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] new Fragments

2011-06-19 Thread Dianne Hackborn
That log is just a warning, and unrelated fragments, and not causing such an
issue.

Let's still step back -- are you actually having a fragment displayed at
all?  Make sure you are actually getting it displayed before then trying to
hide and show it.  (And after adding a fragment starts out shown so there is
no reason to hide it unless you are doing some special specific stuff.)

On Sun, Jun 19, 2011 at 12:18 PM, New Developer secur...@isscp.com wrote:

 To Dianne

 Thank you for all your support

 I have managed to get the fragment concept working

 I call  show()
 FragmentTransaction fMgr = getFragmentManager().beginTransaction();
  fMgr.show(visitScreen);
  fMgr.commit();

 And then when done I call hide()
 FragmentTransaction fMgr = getFragmentManager().beginTransaction();
  fMgr.hide(visitScreen);
  fMgr.commit();


 I just have a new problem  But When I recall the function with the .show()

 06-19 15:17:50.720: WARN/InputManagerService(21637): Window already
 focused, ignoring focus gain of:
 com.android.internal.view.IInputMethodClient$Stub$Proxy@4169e988

 and Do not see the  Fragment  ?  any ideas

 Thanks again for everything




 On Jun 19, 2011, at 1:40 AM, Dianne Hackborn wrote:

 Committing a fragment transaction is asynchronous.  You should let it run
 and do its thing; don't call getView() outside of the fragment's own
 lifecycle.

 Have you tried any of the API demos?  There are lots of them.  I suggest
 starting off with one of those known working demos, found here:


 http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/index.html

 On Sat, Jun 18, 2011 at 8:10 PM, New Developer secur...@isscp.com wrote:

 Here is what I have can you see something obvious

 in my MainActivity  I call the  Fragment using

 FragmentTransaction   fMgr  = getFragmentManager().beginTransaction();
 VisitMenu fragment  = new VisitMenu();
 fMgr.add(R.id.menu2, fragment);
 fMgr.commit();

 fMgr.show(fragment);

 Log.w(CHECK , Check  1 + fragment.getView()
 );
 Log.w(CHECK , Check  2 + fragment.view
 );

 Both Check 1  and Check 2  return NULL

 My Fragment Has this

 public class VisitMenu extends Fragment {
  private  View  parent= null;
  public   View  view  = null;

  @Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container,
 Bundle bundle) {
  view  = inflater.inflate(R.layout.visit_menu, container, false);
  parent= container;
  return view;
  }
 }

 and ideas welcome

 Thanks in advance



 On Jun 18, 2011, at 10:40 PM, New Developer wrote:

 I have the SDK Updater done  and installed the  Compatibility package

 When I putextends   FragmentActivity

 I still get  FragmentActivity cannot be resolved to a type

 With the offer to change to Fragment

 and ideas

 thanks again




 On Jun 18, 2011, at 1:11 AM, Dianne Hackborn wrote:

 Xav's blog post explains how to get the support library, which has
 FragmentActivity, through the SDK updater:

 http://android-developers.blogspot.com/2011/03/fragments-for-all.html

 On Fri, Jun 17, 2011 at 8:16 PM, New Developer secur...@isscp.comwrote:

 Dianne
 Thanks  and yes is was your blogspot article at the bottom that refers to
  FragmentActivity

 But I can not find this anywhere  and when I type it ,  it is unknown

 thanks again

 On Jun 17, 2011, at 7:57 PM, Dianne Hackborn wrote:

 Blog posts:


 http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html
 http://android-developers.blogspot.com/2011/03/fragments-for-all.html

 SDK documentation:

 http://developer.android.com/guide/topics/fundamentals/fragments.html
 http://developer.android.com/reference/android/app/Fragment.html

 I would suggest that for now you ignore the fragment tag; all it is, is
 a convenience for doing certain things.  Learn how to directly use the
 Fragment APIs and how those work with activities, and then once you are done
 with those basic concepts you can throw in fragment layout tags.

 (I should probably adjust the Fragment java doc to reflect this approach
 as well.)

 On Fri, Jun 17, 2011 at 4:42 PM, New Developer secur...@isscp.comwrote:

 Could someone please clarify the method in which to use fragment

 There is a Main Activity which has a  fragment  element within it's
 layout

 this fragment element is then loaded to a class the extends  Fragment
 But does the fragment class then have it's own activity ?  or
 how do you access the elements within the fragment ?
 For discussion let us say the fragment has a Button and EditText

 Under  a normal activity  you could access it with
 (Button) findViewbyId(R.id.button);   but when I put this into a
 fragment extended class
 findViewById  gives an error ?

 Also there is one article on Fragment which has a FragmentActivity  or
 ActivityFragment
 But I can not find this anywhere

 Thanks in advance

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

Re: [android-developers] skia / purging [x]k from font cache [y entries] - what does it mean? was Re: Custom Fonts

2011-06-19 Thread Dianne Hackborn
It just means it needs to flush old data from the font cache.  You may see
this a lot if you are for example drawing at a large number of sizes, as you
fill up the font cache with glyphs in a lot of sizes and old glyphs need to
be removed to make room.

On Sun, Jun 19, 2011 at 9:17 PM, Adam Ratana adam.rat...@gmail.com wrote:

 Hello, I am noticing the same with an implementation for some new
 functionality I'm experimenting with.  I am doing a lot of canvas.drawText
 calls on a custom View canvas, using the system font though.  Are you doing
 canvas.drawText a lot, Samuh?

 Also a bump in case anyone reading has knowledge on this subject.
  Wondering am I doing something stupid here, trying to avoid jankiness.


 On Wednesday, June 1, 2011 2:10:27 PM UTC-4, Samuh wrote:

 We are using four different custom fonts across our app. These files
 are bundled in Assets and are opened in onCreate of every Activity.

 While studying the logs of our app we keep observing the following log
 from Skia decoder.

 01-01 19:19:51.585: DEBUG/skia(1510): purging 197K from font cache [20
 entries]

 What does the above mean? And how does it affect performance?

 Is it desirable?

 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] list view with alpha transparency effect

2011-06-18 Thread Dianne Hackborn
Use this:

http://developer.android.com/reference/android/widget/AbsListView.html#setCacheColorHint(int)

http://developer.android.com/reference/android/widget/AbsListView.html#attr_android:cacheColorHint

Note that doing this means that ListView can't use important drawing
optimizations, so on many devices this will cause scrolling to be noticeably
less smooth.

On Sat, Jun 18, 2011 at 10:27 AM, Greg Donald gdon...@gmail.com wrote:

 I have a list view using a layout that has a background color of #8000.

 When I scroll the list, the list item background color change to a
 solid color, in this case black.  Seems it's ignoring the alpha
 transparency value on scroll.

 Is there a way to make it not do that?


 Thanks.


 --
 Greg Donald
 destiney.com | gregdonald.com

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




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

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

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

Re: [android-developers] new Fragments

2011-06-18 Thread Dianne Hackborn
Committing a fragment transaction is asynchronous.  You should let it run
and do its thing; don't call getView() outside of the fragment's own
lifecycle.

Have you tried any of the API demos?  There are lots of them.  I suggest
starting off with one of those known working demos, found here:

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/index.html

On Sat, Jun 18, 2011 at 8:10 PM, New Developer secur...@isscp.com wrote:

 Here is what I have can you see something obvious

 in my MainActivity  I call the  Fragment using

 FragmentTransaction   fMgr  = getFragmentManager().beginTransaction();
 VisitMenu fragment  = new VisitMenu();
 fMgr.add(R.id.menu2, fragment);
 fMgr.commit();


 fMgr.show(fragment);


 Log.w(CHECK , Check  1 + fragment.getView()
 );
 Log.w(CHECK , Check  2 + fragment.view
 );

 Both Check 1  and Check 2  return NULL

 My Fragment Has this

 public class VisitMenu extends Fragment {
  private  View  parent= null;
  public   View  view  = null;


  @Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container,
 Bundle bundle) {
  view  = inflater.inflate(R.layout.visit_menu, container, false);
  parent= container;
  return view;
  }

 }

 and ideas welcome

 Thanks in advance



 On Jun 18, 2011, at 10:40 PM, New Developer wrote:

 I have the SDK Updater done  and installed the  Compatibility package

 When I putextends   FragmentActivity

 I still get  FragmentActivity cannot be resolved to a type

 With the offer to change to Fragment

 and ideas

 thanks again




 On Jun 18, 2011, at 1:11 AM, Dianne Hackborn wrote:

 Xav's blog post explains how to get the support library, which has
 FragmentActivity, through the SDK updater:

 http://android-developers.blogspot.com/2011/03/fragments-for-all.html

 On Fri, Jun 17, 2011 at 8:16 PM, New Developer secur...@isscp.com wrote:

 Dianne
 Thanks  and yes is was your blogspot article at the bottom that refers to
  FragmentActivity

 But I can not find this anywhere  and when I type it ,  it is unknown

 thanks again

 On Jun 17, 2011, at 7:57 PM, Dianne Hackborn wrote:

 Blog posts:


 http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html
 http://android-developers.blogspot.com/2011/03/fragments-for-all.html

 SDK documentation:

 http://developer.android.com/guide/topics/fundamentals/fragments.html
 http://developer.android.com/reference/android/app/Fragment.html

 I would suggest that for now you ignore the fragment tag; all it is, is
 a convenience for doing certain things.  Learn how to directly use the
 Fragment APIs and how those work with activities, and then once you are done
 with those basic concepts you can throw in fragment layout tags.

 (I should probably adjust the Fragment java doc to reflect this approach
 as well.)

 On Fri, Jun 17, 2011 at 4:42 PM, New Developer secur...@isscp.comwrote:

 Could someone please clarify the method in which to use fragment

 There is a Main Activity which has a  fragment  element within it's
 layout

 this fragment element is then loaded to a class the extends  Fragment
 But does the fragment class then have it's own activity ?  or
 how do you access the elements within the fragment ?
 For discussion let us say the fragment has a Button and EditText

 Under  a normal activity  you could access it with
 (Button) findViewbyId(R.id.button);   but when I put this into a fragment
 extended class
 findViewById  gives an error ?

 Also there is one article on Fragment which has a FragmentActivity  or
 ActivityFragment
 But I can not find this anywhere

 Thanks in advance

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




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



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

Re: [android-developers] Re: super.onCreate(savedInstanceState)

2011-06-17 Thread Dianne Hackborn
The safest thing to do is call super first during creation, last during
destroy, and the others don't matter.

But in practice as long as you call to the super and are working today, we
won't break you tomorrow.

On Fri, Jun 17, 2011 at 1:24 PM, Indicator Veritatis mej1...@yahoo.comwrote:

 Now the next thing they/we need to know to keep from breaking things
 in future implementations is: do these calls always come first in the
 overrides, or can they come at any point, as long as they get called?

 On Jun 15, 12:42 am, Dianne Hackborn hack...@android.com wrote:
  Are you just asking why you are required to call super.onCreate()?  If
 so,
  you are required to call the super class of that and onStop() and
 onResume()
  and others just to prevent apps from forgetting to call the base class
  implementation and causing them to break when the platform changes in the
  future and does stuff in those implementations.
 
  On Tue, Jun 14, 2011 at 6:39 AM, Android herle.san...@gmail.com wrote:
   The Reason we use onCreate(savedInstanceState) because, upon
   super.onCreate() it will reach the Activity (parent class of any
   activity) class to load the savedInstanceState. (beacause the demo
   activity class we have created is not capable of loading the saved
   state) Yeah, we normaly don't set any saved instance state, but
   android framework made such a way that, we should be calling that.
 
   Please correct me if i am 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
 
  --
  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: How does launcher get the applications' icons and corresponding text

2011-06-17 Thread Dianne Hackborn
You really don't need the source code.  There are simple APIs on
PackageManager to load icons and resources.

On Fri, Jun 17, 2011 at 10:13 AM, Kevin TeslaCoil Software 
ke...@teslacoilsw.com wrote:

 It does.

 Source for Launcher2 is available:

 https://android.git.kernel.org/?p=platform/packages/apps/Launcher2.git;a=summary

 On Jun 17, 10:37 am, June Hello junehelloworld.he...@gmail.com
 wrote:
  Does launcher load icons by using PackageManager as well, I think I need
 to
  learn the source code.
 
  Thanks a lot for your help
 
 
 
 
 
 
 
  On Fri, Jun 17, 2011 at 11:22 PM, TreKing treking...@gmail.com wrote:
   On Fri, Jun 17, 2011 at 9:31 AM, June_Hello 
   junehelloworld.he...@gmail.com wrote:
 
   I encountered with a question. Where and how  does the launcher get
   the icon and text of the application which has
 
   be installed in the phone, Is this information stored in database, or
   any other way else? and how can I get another
 
   app's icon which is showed on launcher from another my own.
 
   Any time you want information about other packages installed on the
 device,
   first stop should be PackageManager.
 
  
 ---
 --
   TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
   transit tracking app for Android-powered devices
 
--
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en

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

2011-06-17 Thread Dianne Hackborn
Blog posts:

http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html
http://android-developers.blogspot.com/2011/03/fragments-for-all.html

SDK documentation:

http://developer.android.com/guide/topics/fundamentals/fragments.html
http://developer.android.com/reference/android/app/Fragment.html

I would suggest that for now you ignore the fragment tag; all it is, is a
convenience for doing certain things.  Learn how to directly use the
Fragment APIs and how those work with activities, and then once you are done
with those basic concepts you can throw in fragment layout tags.

(I should probably adjust the Fragment java doc to reflect this approach as
well.)

On Fri, Jun 17, 2011 at 4:42 PM, New Developer secur...@isscp.com wrote:

 Could someone please clarify the method in which to use fragment

 There is a Main Activity which has a  fragment  element within it's layout

 this fragment element is then loaded to a class the extends  Fragment
 But does the fragment class then have it's own activity ?  or
 how do you access the elements within the fragment ?
 For discussion let us say the fragment has a Button and EditText

 Under  a normal activity  you could access it with
 (Button) findViewbyId(R.id.button);   but when I put this into a fragment
 extended class
 findViewById  gives an error ?

 Also there is one article on Fragment which has a FragmentActivity  or
 ActivityFragment
 But I can not find this anywhere

 Thanks in advance

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




-- 
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] new Fragments

2011-06-17 Thread Dianne Hackborn
Xav's blog post explains how to get the support library, which has
FragmentActivity, through the SDK updater:

http://android-developers.blogspot.com/2011/03/fragments-for-all.html

On Fri, Jun 17, 2011 at 8:16 PM, New Developer secur...@isscp.com wrote:

 Dianne
 Thanks  and yes is was your blogspot article at the bottom that refers to
  FragmentActivity

 But I can not find this anywhere  and when I type it ,  it is unknown

 thanks again

 On Jun 17, 2011, at 7:57 PM, Dianne Hackborn wrote:

 Blog posts:


 http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html
 http://android-developers.blogspot.com/2011/03/fragments-for-all.html

 SDK documentation:

 http://developer.android.com/guide/topics/fundamentals/fragments.html
 http://developer.android.com/reference/android/app/Fragment.html

 I would suggest that for now you ignore the fragment tag; all it is, is a
 convenience for doing certain things.  Learn how to directly use the
 Fragment APIs and how those work with activities, and then once you are done
 with those basic concepts you can throw in fragment layout tags.

 (I should probably adjust the Fragment java doc to reflect this approach as
 well.)

 On Fri, Jun 17, 2011 at 4:42 PM, New Developer secur...@isscp.com wrote:

 Could someone please clarify the method in which to use fragment

 There is a Main Activity which has a  fragment  element within it's
 layout

 this fragment element is then loaded to a class the extends  Fragment
 But does the fragment class then have it's own activity ?  or
 how do you access the elements within the fragment ?
 For discussion let us say the fragment has a Button and EditText

 Under  a normal activity  you could access it with
 (Button) findViewbyId(R.id.button);   but when I put this into a fragment
 extended class
 findViewById  gives an error ?

 Also there is one article on Fragment which has a FragmentActivity  or
 ActivityFragment
 But I can not find this anywhere

 Thanks in advance

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




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


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] How to force close the app when using multiple activity

2011-06-16 Thread Dianne Hackborn
Why do you want to do this?  What are you trying to accomplish?  This is not
something normal for an application to do.

On Thu, Jun 16, 2011 at 12:47 AM, HariRam hariram1...@gmail.com wrote:


 How to quit the app or force close the app when multiple activity running
 in background. I tried to give system.exit(0), but this will works only
 having single activity. In my app i have 3 activity when i tried
 system.exit it kills that particular activity and go back to previous
 activity. please guide me to solve this..
 --
 Thanks and
 Regards
 Hariram

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




-- 
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] Save user options in reboot

2011-06-16 Thread Dianne Hackborn
Ultimately the only stuff that is going to be saved across a reboot is stuff
written to a file.  It doesn't matter how you do it -- with a SQLite
database, with SharedPreferences, by writing your own file -- you need to
put it in a file.

On Thu, Jun 16, 2011 at 11:31 AM, Amita Dev amita.develo...@gmail.comwrote:

 Hi,
 Is it possible to save user selected options even after reboot of
 device?
 I would like to not to write all of my data in a file and then read it
 back.

 How do all applications save data even after reboot?

 Thanks,
 -A

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

<    1   2   3   4   5   6   7   8   9   10   >