[android-developers] Re: Depth buffer issue: Advice for anyone experiencing problem

2011-01-16 Thread Andrew Smith
genpfault on StackOverflow.com pointed out that you need to use a
value of 65536 with glClearDepthx to get the result you expect from a
value of 1. I have confirmed that this is correct. So this is more a
case of incorrect documentation, rather than a bug as such.

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


[android-developers] Re: two list selectors or new state for the current selector

2011-01-16 Thread poohtbear
Hi Kostya.
1. i know how to add a new attribute to the selector, i can do it
programatically using the original list's selector and save me some
work.
2. in StateListDrawable you have a protected method that acts on those
states, and it's stated specifically that you need to override it to
act on your own states, so just adding a state will not do, i need my
own StateListDrawable.
3. how and where in ListView the selector states are determined ?
KeyDown\KeyUp events ? pointerPressed events ? is there a  main
function where it all goes to to set the current selector state on a
specific list item that i can override ? i'm not sure this method wont
be private making me override lots of other methods...
4. it would have been easier if you could just post a simple selector
xml and a short ListView example that uses the new state, what you
wrote here is pretty much just stating the obvious in high level
without giving the specific details i wondered about...

5. i think i explained that i can't just 'set the background' because
than the selected and clicked drawables will be hidden by that
background. i didn't check though what will happen if the background
will be StateListDrawable itself.

On Jan 13, 5:21 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 You can probably do this by:

 - Creating your own styleable to declare the new attribute;
 - Creating your own state-list drawable to use the new atribute;
 - Setting it as the listSelector for the list view;
 - Subclassing ListView to propagate the new attribute value into the
 selector.

 On the other hand, it's probably going to be easier to just set the
 background color in your adapter's getView.

 -- Kostya

 13.01.2011 18:01,poohtbearпишет:



  I have a list view with relativeLayout with all sorts of widgets
  (TextViews, RatingBars, ImageViews etc...).
  I use my own adapter to populate the ListView.

  The items in the adapter, besides being selected \ pressed \not
  focused have an extra state: 'viewed'.
  Baiscally i want that items that have state viewed set to true will be
  drawn with blue background and items with viewed set to false with
  white\transparent background.

  The problem is that i can't set the background on the View itself
  since it will hide the selector, i'm not sure regarding adding extra
  state since i know how to add it using addState on the current
  selector, but i have no clue how to cause the list to use the extra
  state, or how to use different selector for different item types.

  Any help ?

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

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


Re: [android-developers] Re: BOOT_COMPLETED not being heard

2011-01-16 Thread Kevin Duffey
Curious, too late for 2.3.. but is there any reason the boot notification
cant be sent out AFTER the sdcard is mounted? Does it take that long to
mount it? Would have thought a flash memory card, much like SSD, would be
pretty darn fast to mount.

On Sat, Jan 15, 2011 at 10:49 PM, Dianne Hackborn hack...@android.comwrote:

 Sorry, you can point them to that documentation if you want.  This is a
 pretty fundamental aspect of the behavior of the SD card.


 On Sat, Jan 15, 2011 at 10:16 PM, Zsolt Vasvari zvasv...@gmail.comwrote:

 That's all good, but the end users don't understand these restrictions
 and downrank your app if you don't offer the SD card option.  I've
 experienced this first hand -- even if my app is only 1MB.



 On Jan 16, 11:44 am, Dianne Hackborn hack...@android.com wrote:
  Yes because the apps on SD card are not mounted by the time the boot
  completed broadcast is sent.
 
  The restrictions, including BOOT_COMPLETED, are documented here:
 
  http://developer.android.com/guide/appendix/install-location.html
 
  http://developer.android.com/guide/appendix/install-location.htmlNote
 that
  it should be clear by this that the feature is *not* intended for use by
  most applications.  The target for it is really large games or other
 large
  applications that are self-contained and don't interact with other parts
 of
  the system.  The fact that the app can disappear at any point in order
 to
  transfer data with the SD card is limiting in what it makes sense for
 such
  apps to do.
 
 
 
 
 
  On Sat, Jan 15, 2011 at 6:47 PM, Zsolt Vasvari zvasv...@gmail.com
 wrote:
   Really?  That's not good.  I am really starting to think that the move
   to SD card option is more trouble than it's worth.
 
   Of course, not offerring this is an invitation for morons who give 1-
   stars for any app that doesn't offer it, no matter how small.
 
   On Jan 16, 10:33 am, Ken H hunt1...@gmail.com wrote:
Figured out the problem...a little pissed by it.
 
Apparently, if your app is designed to listen for the BOOT_COMPLETED
broadcast, and you allow it to be moved to the SD card, it will not
hear the BOOT_COMPLETED message. Annoying to say the least.
 
Just out of curiosity, after spending several hours trying to fix
 it,
does anybody know why this is?
 
Ken H
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 android-developers%2Bunsubs­cr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
 
  --
  Dianne Hackborn
  Android framework engineer
  hack...@android.com
 
  Note: please don't send private questions to me, as I don't have time to
  provide private support, and so won't reply to such e-mails.  All such
  questions should be posted on public forums, where I and others can see
 and
  answer them.- Hide quoted text -
 
  - Show quoted text -

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


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

Re: [android-developers] Re: two list selectors or new state for the current selector

2011-01-16 Thread Kostya Vasilyev
2 - I haven't had to override StateListDrawable when adding a new state for
my drawables. I only had to override getDrawableState in the view (subclass)
to make sure that my new state gets propageted into the drawable's state
array.

3 - No, I don't. I just know there is a separate drawable for the selector.

Looking at the source, AbsListView has a onCreateDrawableState() method that
you can override (it's a framework method that is meant to be overriden, so
it's protected).

http://www.netmite.com/android/mydroid/frameworks/base/core/java/android/widget/AbsListView.java

And it looks like AbsListView just copies its own state into the selector
state (same file, drawableStateChanged).

So the issue is how to push your state, which is per-item, into the list
view selector. I would do this with a custom interface in the adapter, there
are probably other ways too.

4 - I haven't actually done the exact thing you're trying to do, so don't
have code I could post. I am sharing some ideas, hoping that they might be
useful to you.

5 - Gmail for Android uses the background color to indicate read / unread
state for messages (in the message list view). This background is overriden
by the selector, just like you are saying, but frankly, I never noticed
until now, when I went to check what it looks like there.

Here is another idea - if you are building a non-standard,
graphics-intensive UI, perhaps you could use a selector drawable that shows
pressed/selected states in a non-standard way, too. I did this for my
current project, and quite liked the look (YMMV):

http://kmansoft.wordpress.com/2011/01/11/checkable-image-button/

-- Kostya

2011/1/16 poohtbear eyaltg...@gmail.com

 Hi Kostya.
 1. i know how to add a new attribute to the selector, i can do it
 programatically using the original list's selector and save me some
 work.
 2. in StateListDrawable you have a protected method that acts on those
 states, and it's stated specifically that you need to override it to
 act on your own states, so just adding a state will not do, i need my
 own StateListDrawable.
 3. how and where in ListView the selector states are determined ?
 KeyDown\KeyUp events ? pointerPressed events ? is there a  main
 function where it all goes to to set the current selector state on a
 specific list item that i can override ? i'm not sure this method wont
 be private making me override lots of other methods...
 4. it would have been easier if you could just post a simple selector
 xml and a short ListView example that uses the new state, what you
 wrote here is pretty much just stating the obvious in high level
 without giving the specific details i wondered about...

 5. i think i explained that i can't just 'set the background' because
 than the selected and clicked drawables will be hidden by that
 background. i didn't check though what will happen if the background
 will be StateListDrawable itself.

 On Jan 13, 5:21 pm, Kostya Vasilyev kmans...@gmail.com wrote:
  You can probably do this by:
 
  - Creating your own styleable to declare the new attribute;
  - Creating your own state-list drawable to use the new atribute;
  - Setting it as the listSelector for the list view;
  - Subclassing ListView to propagate the new attribute value into the
  selector.
 
  On the other hand, it's probably going to be easier to just set the
  background color in your adapter's getView.
 
  -- Kostya
 
  13.01.2011 18:01,poohtbearпишет:
 
 
 
   I have a list view with relativeLayout with all sorts of widgets
   (TextViews, RatingBars, ImageViews etc...).
   I use my own adapter to populate the ListView.
 
   The items in the adapter, besides being selected \ pressed \not
   focused have an extra state: 'viewed'.
   Baiscally i want that items that have state viewed set to true will be
   drawn with blue background and items with viewed set to false with
   white\transparent background.
 
   The problem is that i can't set the background on the View itself
   since it will hide the selector, i'm not sure regarding adding extra
   state since i know how to add it using addState on the current
   selector, but i have no clue how to cause the list to use the extra
   state, or how to use different selector for different item types.
 
   Any help ?
 
  --
  Kostya Vasilyev -- WiFi Manager + pretty widget --
 http://kmansoft.wordpress.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.comandroid-developers%2bunsubscr...@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 

Re: [android-developers] Re: BOOT_COMPLETED not being heard

2011-01-16 Thread Marcin Orlowski
On 16 January 2011 07:49, Dianne Hackborn hack...@android.com wrote:
 Sorry, you can point them to that documentation if you want.  This is a
 pretty fundamental aspect of the behavior of the SD card.

Are you kidding? I'd say that forseeing such user behaviour is pretty
fundamental when you design anything. It'd not hurt too add a warning
popup telling user to confirm move to sd card and ack s/he
understand the risk of certain features of the app (which can easlily
be told in most cases based on app's Manifest) simply just won't work.
Assuming users are by default smart not stupid is stupid, not smart.

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


[android-developers] Re: BOOT_COMPLETED not being heard

2011-01-16 Thread Zsolt Vasvari
I agree.  A smart user wouldn't complain in the first place about
not having the Move to SD card option for a 1MB app.

On Jan 16, 6:12 pm, Marcin Orlowski webnet.andr...@gmail.com wrote:
 On 16 January 2011 07:49, Dianne Hackborn hack...@android.com wrote:

  Sorry, you can point them to that documentation if you want.  This is a
  pretty fundamental aspect of the behavior of the SD card.

 Are you kidding? I'd say that forseeing such user behaviour is pretty
 fundamental when you design anything. It'd not hurt too add a warning
 popup telling user to confirm move to sd card and ack s/he
 understand the risk of certain features of the app (which can easlily
 be told in most cases based on app's Manifest) simply just won't work.
 Assuming users are by default smart not stupid is stupid, not smart.

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

2011-01-16 Thread Mark Murphy
SlidingDrawer definitely exists. It may be there is a problem with it
and the Eclipse UI builder. Try adding it to your XML manually.

Here is a trivial sample project showing the use of a SlidingDrawer:

https://github.com/commonsguy/cw-android/tree/master/Fancy/DrawerDemo

On Sat, Jan 15, 2011 at 11:24 PM, Scott Deutsch surger...@gmail.com wrote:
 Hello group.

 I tried to add a Sliding Drawer through the visual xml builder thingy,
 but it is telling me The following classes cannot be found
 SlidingDrawer. Why is that?

 They they take that out in the SDK or something?

 What should I try?

 Thanks group!

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

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


Re: [android-developers] Re: BOOT_COMPLETED not being heard

2011-01-16 Thread Jonas Petersson

On 01/16/2011 12:21 PM, Zsolt Vasvari wrote:

I agree.  A smart user wouldn't complain in the first place about
not having the Move to SD card option for a 1MB app.


Opinion: It would be nice if the Move to SD card-function could detect 
that the application requests for instance BOOT_COMPLETED or has a 
widget etc and inform the user that those functions will no longer work 
as expected if the move is completed. This assumes that the application 
isn't installed on the SD by default and that the user understands the 
warning so I'm not really holding my breath for it.


I guess the best you can do as a developer is to detect that the app is 
running from SD and inform the user about the drawbacks on the next 
start. Hardly ideal, but better than nothing. At least the explanation 
can then be very specific as opposed to what a generic function would 
have to state.


As with many apps, it is not obvious that the automatic startup or 
widget function is a critical function of the application, it may just 
be a nice frill that is seldom used (I know my self that I really only 
ever use ONE widget and that one has no other function than being a 
widget - it shows the next few calendar items).


My few cents / Jonas


On Jan 16, 6:12 pm, Marcin Orlowskiwebnet.andr...@gmail.com  wrote:

On 16 January 2011 07:49, Dianne Hackbornhack...@android.com  wrote:


Sorry, you can point them to that documentation if you want.  This is a
pretty fundamental aspect of the behavior of the SD card.


Are you kidding? I'd say that forseeing such user behaviour is pretty
fundamental when you design anything. It'd not hurt too add a warning
popup telling user to confirm move to sd card and ack s/he
understand the risk of certain features of the app (which can easlily
be told in most cases based on app's Manifest) simply just won't work.
Assuming users are by default smart not stupid is stupid, not smart.




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

2011-01-16 Thread Kostya Vasilyev
Agreed.

The intended use case for move to sd was for games or multimedia
applications, but I see users wanting to move even small applications.

It's actually a valid case for applications that have large code, or use a
large amount of data / cache storage (so move to sd makes sense), and also
have a widget or a service.

For widgets, the home screen could indicate that the widget is disabled,
similar to how it already does for missing widget providers (the cannot
load gadget message, btw, shouldn't that be widget?). This is already
better than removing it from the home screen without any indication
whatsoever.

The launcher could also keep the RemoteViews until the memory card is again
available, and then reinstate the widget to full working state. It already
does almost the same thing on orientation changes.

For services, it would have been possible to listen for
ACTION_EXTERNAL_APPLICATIONS_AVAILABLE and restart your service / reset your
alarms then, execept that the affected applications do not receive this
broadcast (I don't understand why, so I must be missing something).

-- Kostya

2011/1/16 Jonas Petersson jonas.peters...@xms.se

 On 01/16/2011 12:21 PM, Zsolt Vasvari wrote:

 I agree.  A smart user wouldn't complain in the first place about
 not having the Move to SD card option for a 1MB app.


 Opinion: It would be nice if the Move to SD card-function could detect
 that the application requests for instance BOOT_COMPLETED or has a widget
 etc and inform the user that those functions will no longer work as expected
 if the move is completed. This assumes that the application isn't installed
 on the SD by default and that the user understands the warning so I'm not
 really holding my breath for it.

 I guess the best you can do as a developer is to detect that the app is
 running from SD and inform the user about the drawbacks on the next start.
 Hardly ideal, but better than nothing. At least the explanation can then be
 very specific as opposed to what a generic function would have to state.

 As with many apps, it is not obvious that the automatic startup or widget
 function is a critical function of the application, it may just be a nice
 frill that is seldom used (I know my self that I really only ever use ONE
 widget and that one has no other function than being a widget - it shows the
 next few calendar items).

My few cents / Jonas


  On Jan 16, 6:12 pm, Marcin Orlowskiwebnet.andr...@gmail.com  wrote:

 On 16 January 2011 07:49, Dianne Hackbornhack...@android.com  wrote:

  Sorry, you can point them to that documentation if you want.  This is a
 pretty fundamental aspect of the behavior of the SD card.


 Are you kidding? I'd say that forseeing such user behaviour is pretty
 fundamental when you design anything. It'd not hurt too add a warning
 popup telling user to confirm move to sd card and ack s/he
 understand the risk of certain features of the app (which can easlily
 be told in most cases based on app's Manifest) simply just won't work.
 Assuming users are by default smart not stupid is stupid, not smart.



 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-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=en


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

Re: [android-developers] Re: BOOT_COMPLETED not being heard

2011-01-16 Thread Mark Murphy
On Sun, Jan 16, 2011 at 8:24 AM, Kostya Vasilyev kmans...@gmail.com wrote:
 It's actually a valid case for applications that have large code

Bear in mind that a copy of the large code will also be on the
on-board storage.

 or use a
 large amount of data / cache storage (so move to sd makes sense), and also
 have a widget or a service.

The .apk file is saved on the external storage, but all private user
data, databases, optimized .dex files, and extracted native code are
saved on the internal device memory.

http://developer.android.com/guide/appendix/install-location.html

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

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


Re: [android-developers] Re: BOOT_COMPLETED not being heard

2011-01-16 Thread Kostya Vasilyev
2011/1/16 Mark Murphy mmur...@commonsware.com

 On Sun, Jan 16, 2011 at 8:24 AM, Kostya Vasilyev kmans...@gmail.com
 wrote:
  It's actually a valid case for applications that have large code

 Bear in mind that a copy of the large code will also be on the
 on-board storage.


Thanks for the link - I just re-read it more carefully than before. It's too
bad, seems like the only win is for application resources.

Still, I have to agree with Jonas - the app management screen has all the
necessary data to inform the the user about apps that contain widgets or
listen for boot_completed (or other components listed at that page), and
could do this even for apps that don't allow move to sd in the manifest.



  or use a
  large amount of data / cache storage (so move to sd makes sense), and
 also
  have a widget or a service.

 The .apk file is saved on the external storage, but all private user
 data, databases, optimized .dex files, and extracted native code are
  saved on the internal device memory.


 http://developer.android.com/guide/appendix/install-location.html

 --
 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.1 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


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

[android-developers] Re: Camera properties

2011-01-16 Thread Joe McCann
Fairly certain you'll have to include the permissions declaration.
The other parts would require some hackery, I suppose.

On Jan 15, 4:15 am, b_t bartata...@gmail.com wrote:
 Hi,

 is there any way to get camera properties without open it?
 I want to display camera properties but don't want to take a picture.
 I have to open camera, get properties, then release it:

         Camera camera = Camera.open();

         if (camera != null) {
                 parameters = camera.getParameters();
                 camera.release();
         }

 And it needs android.permission.CAMERA permission. :(

 Is there any solution?
 Tamás

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


[android-developers] WebView does not restoreState

2011-01-16 Thread Bost
Hallo,
my App uses a WebView. If the Webview is laoded by:

mwebView.loadData(htmlString, text/html,utf-8);

all worked fine, including saveState and restoreState in
onSaveInstanceState () and onRestoreInstanceState().

I added images to htmlString. Therefore I had to replace loadData by

mwebView.loadDataWithBaseURL(baseUrl, htmlString, text/html,utf-8,
null)

where baseUrl contains the images, which are included in htmlString by
the img-tag.

The text and the images are displayed.
But the view is not restored in onRestoreInstanceState(Bundle
savedInstanceState) by

mwebView.restoreState(savedInstanceState);

Any suggestions?

BTW, savePicture() and restorePicture(), what are they good for?

Regards
Bost

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


[android-developers] Re: ImageView, no scaling and gravity

2011-01-16 Thread Henrik Lindqvist
I've already tried that. It works if the bitmap is smaller than the
ImageView, it aligns to the right edge correctly. But, if the bitmap
is larger, its cropped at both left and right side. Seems like an
ImageView can't expand to be larger than it's parent, even inside an
FrameLayout.

Any trick to make a ImageView larger than it's parent FrameLayout?


On Jan 16, 7:20 am, Zsolt Vasvari zvasv...@gmail.com wrote:
 Use a layout that supports the android:layout_gravity attribute, such
 as FrameLayout.  The regular android:gravity is only used the
 TextViews to position the text if the view is larger than the text.

 On Jan 16, 11:12 am, Henrik Lindqvist henrik.lindqv...@gmail.com
 wrote:

  I have a runtime generated Bitmap, for a RemoteView, that I wan't
  displayed within a ImageView without scaling, so I use
  scaleType=center. Now, if the bitmap is smaller than the ImageView I
  wan't it to gravitate to the right. Or, if the bitmap is to large,
  crop the left side.

  ImageView seems to ignore gravity. I've tried everything. Nesing
  inside a FrameLayout etc, nothing works! Any other options?

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

2011-01-16 Thread Mark Murphy
On Sun, Jan 16, 2011 at 11:02 AM, Henrik Lindqvist
henrik.lindqv...@gmail.com wrote:
 I've already tried that. It works if the bitmap is smaller than the
 ImageView, it aligns to the right edge correctly. But, if the bitmap
 is larger, its cropped at both left and right side. Seems like an
 ImageView can't expand to be larger than it's parent, even inside an
 FrameLayout.

Of course. That's a rule for any container/child relationship in Android.

 Any trick to make a ImageView larger than it's parent FrameLayout?

Move it outside of the FrameLayout into some larger container. Or,
expand the FrameLayout.

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

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


Re: [android-developers] Re: ImageView, no scaling and gravity

2011-01-16 Thread Kostya Vasilyev
I think it should work to put it inside a frame layout with exact values for
width/height (specifying maximum image size before cropping occurs). Then on
the image view, specify layout_gravity=right, and width/height as
wrap_content.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com
16.01.2011 19:06 пользователь Mark Murphy mmur...@commonsware.com
написал:
 On Sun, Jan 16, 2011 at 11:02 AM, Henrik Lindqvist
 henrik.lindqv...@gmail.com wrote:
 I've already tried that. It works if the bitmap is smaller than the
 ImageView, it aligns to the right edge correctly. But, if the bitmap
 is larger, its cropped at both left and right side. Seems like an
 ImageView can't expand to be larger than it's parent, even inside an
 FrameLayout.

 Of course. That's a rule for any container/child relationship in Android.

 Any trick to make a ImageView larger than it's parent FrameLayout?

 Move it outside of the FrameLayout into some larger container. Or,
 expand the FrameLayout.

 --
 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.1 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

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

Re: [android-developers] Re: Depth buffer issue: Advice for anyone experiencing problem

2011-01-16 Thread Kostya Vasilyev
Sounds like the parameter is a 16:16 fixed point number, and that's what the
method name suffix is hinting at. It's glClearDepthx, not glClearDepthi for
a reason.

http://www.opengl.org/registry/specs/OES/OES_fixed_point.txt

--
Kostya Vasilyev -- http://kmansoft.wordpress.com
16.01.2011 11:09 пользователь Andrew Smith meeja...@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

[android-developers] Re: ImageView, no scaling and gravity

2011-01-16 Thread Henrik Lindqvist
On Jan 16, 5:04 pm, Mark Murphy mmur...@commonsware.com wrote:

 On Sun, Jan 16, 2011 at 11:02 AM, Henrik Lindqvist

 henrik.lindqv...@gmail.com wrote:
  I've already tried that. It works if the bitmap is smaller than the
  ImageView, it aligns to the right edge correctly. But, if the bitmap
  is larger, its cropped at both left and right side. Seems like an
  ImageView can't expand to be larger than it's parent, even inside an
  FrameLayout.

 Of course. That's a rule for any container/child relationship in Android.

If a child view can't be larger than it's parent, how does a
ScrollView work?


  Any trick to make a ImageView larger than it's parent FrameLayout?

 Move it outside of the FrameLayout into some larger container. Or,
 expand the FrameLayout.

I can't, it's an AppWidget.


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

 _Android Programming Tutorials_ Version 3.1 Available!

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


[android-developers] Re: ImageView, no scaling and gravity

2011-01-16 Thread Henrik Lindqvist

On Jan 16, 5:19 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 I think it should work to put it inside a frame layout with exact values for
 width/height (specifying maximum image size before cropping occurs). Then on
 the image view, specify layout_gravity=right, and width/height as
 wrap_content.


layout_gravity=right, and width/height as wrap_content is what I do
now. Almost works.

Setting width/height on the FrameLayout is a problem. It's an
AppWidget so I don't really know the size. How does this affect the
offset of the child?

If only ImageView could honor gravity this wouldn't be a problem. Or
setting custom typefaces through xml. Sigh.

 --
 Kostya Vasilyev --http://kmansoft.wordpress.com
 16.01.2011 19:06 пользователь Mark Murphy mmur...@commonsware.com
 написал:

  On Sun, Jan 16, 2011 at 11:02 AM, Henrik Lindqvist
  henrik.lindqv...@gmail.com wrote:
  I've already tried that. It works if the bitmap is smaller than the
  ImageView, it aligns to the right edge correctly. But, if the bitmap
  is larger, its cropped at both left and right side. Seems like an
  ImageView can't expand to be larger than it's parent, even inside an
  FrameLayout.

  Of course. That's a rule for any container/child relationship in Android.

  Any trick to make a ImageView larger than it's parent FrameLayout?

  Move it outside of the FrameLayout into some larger container. Or,
  expand the FrameLayout.

  --
  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.1 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.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

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


[android-developers] Mystery device missing style attributes?

2011-01-16 Thread Brill Pappin
I'm getting this exception:

java.lang.ArrayIndexOutOfBoundsException
at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:455)

from this code:

TypedArray array = 
context.getTheme().obtainStyledAttributes(style, 
new int[] { android.R.attr.textSize });

int textSize = array.getDimensionPixelSize(array.getResourceId(0, 0), 
defValue);


I'm expecting a standard value from the system since thats what I'm asking 
for.

It actually works on all devices I can get my hands on and of course the 
error reporting doesn't tell me anything useful except a stack trace.


Does anyone have a solution that might work instead of this one?

Does anyone know what device this might be?



I do know that it has to be a 2.2 device or better because I've made the 
minimum 2.2 (froyo)

At the moment the only idea I can come up with is to simply send a static 
value, but I'm obviously going to have to guess what the device is.


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

[android-developers] Re: getExternalStorageDirectory()

2011-01-16 Thread Bob Kerns
Actually, use:

File pathDir = Environment.getExternalStorageDirectory();

That is, don't use toString() unless and until you actually need it. A
File object is more useful.

Don't perform string operations to construct file paths.  For example,
write

File logDir = new File(pathDir, logg);
logDir.mkdirs();
File logFile = new File(logDir, generateLogDirName());
OutputStream logStream = new FileOutputStream(logfile);
BufferedWriter logWriter = new  BufferedWriter(new
OutputStreamWriter(logStream, UTF-8));

No toString() method needed -- wanted!

On Jan 14, 6:58 am, Kumar Bibek coomar@gmail.com wrote:
 The abolute path to the external storage might be different. The correct way
 to access the path is

 String fPathDir =
 Environment.
 getExternalStorageDirectory().toString();

 Don't care what it returns, just use this.

 Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com







 On Fri, Jan 14, 2011 at 1:59 PM, Nroblex aselb...@gmail.com wrote:
  Hello Gurus!

  I am very new to java and Android development. So this is perhaps a
  very simple question for you.

  I am developing on a HTC Desire and I am trying to create a loggdir on
  my storage card.
  if I use the suggested function getExternalStorageDirectory like this
  String fPathDir =
  Environment.getExternalStorageDirectory().toString();
  this returns /mnt/SdCard and not /SdCard.

  if I try to create a directory on in /mnt/SdCard/logg
  with mkdirs() it throws an exception, but if I create a directory in

  /SdCard/logg mkdirs() is successfull

  What am I missing here?

  Thanks in advance
  //Nroblex

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

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


Re: [android-developers] Re: getExternalStorageDirectory()

2011-01-16 Thread Kumar Bibek
Yup, thats better. :)

Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com



On Sun, Jan 16, 2011 at 11:15 PM, Bob Kerns r...@acm.org wrote:

 Actually, use:

 File pathDir = Environment.getExternalStorageDirectory();

 That is, don't use toString() unless and until you actually need it. A
 File object is more useful.

 Don't perform string operations to construct file paths.  For example,
 write

 File logDir = new File(pathDir, logg);
 logDir.mkdirs();
 File logFile = new File(logDir, generateLogDirName());
 OutputStream logStream = new FileOutputStream(logfile);
 BufferedWriter logWriter = new  BufferedWriter(new
 OutputStreamWriter(logStream, UTF-8));

 No toString() method needed -- wanted!

 On Jan 14, 6:58 am, Kumar Bibek coomar@gmail.com wrote:
  The abolute path to the external storage might be different. The correct
 way
  to access the path is
 
  String fPathDir =
  Environment.
  getExternalStorageDirectory().toString();
 
  Don't care what it returns, just use this.
 
  Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com
 
 
 
 
 
 
 
  On Fri, Jan 14, 2011 at 1:59 PM, Nroblex aselb...@gmail.com wrote:
   Hello Gurus!
 
   I am very new to java and Android development. So this is perhaps a
   very simple question for you.
 
   I am developing on a HTC Desire and I am trying to create a loggdir on
   my storage card.
   if I use the suggested function getExternalStorageDirectory like this
   String fPathDir =
   Environment.getExternalStorageDirectory().toString();
   this returns /mnt/SdCard and not /SdCard.
 
   if I try to create a directory on in /mnt/SdCard/logg
   with mkdirs() it throws an exception, but if I create a directory in
 
   /SdCard/logg mkdirs() is successfull
 
   What am I missing here?
 
   Thanks in advance
   //Nroblex
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.comandroid-developers%2Bunsubs
 cr...@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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

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

[android-developers] adb works, ddms shows nothing

2011-01-16 Thread neuron
adb works, I use it a lot. adb devices shows the device (a nexus one), 
shell/pull/push everything seems to work.

eclipse screws up, often.
ddms shows no devices connected, and in console I only get a few gtk window 
warnings.
Half the time when I start eclipse it keeps a neverending process running so 
i can't build anything. ddms shows no devices connected (and when I shut it 
down it doesn't quit properly, i have to ctrl+c it).

How can I debug this? (adb kill-server; adb start-server does not help)

This is on linux, ubuntu 10.10, kernel 2.6.37.

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

2011-01-16 Thread Anders Aagaard
I just left this running, and after about 2 minutes it works!

However, it'd be awsome to not have to wait for minutes every time I start
ddms.

On Sun, Jan 16, 2011 at 6:58 PM, neuron aagaa...@gmail.com wrote:

 adb works, I use it a lot. adb devices shows the device (a nexus one),
 shell/pull/push everything seems to work.

 eclipse screws up, often.
 ddms shows no devices connected, and in console I only get a few gtk window
 warnings.
 Half the time when I start eclipse it keeps a neverending process running
 so i can't build anything. ddms shows no devices connected (and when I shut
 it down it doesn't quit properly, i have to ctrl+c it).

 How can I debug this? (adb kill-server; adb start-server does not help)

 This is on linux, ubuntu 10.10, kernel 2.6.37.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-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=en




-- 
Weeks of coding can save you hours of planning.
- http://code.google.com/p/aagaande/

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

[android-developers] Re: How to change width of a SeekBar?

2011-01-16 Thread mark w
Hi guys appreciate the work on Vidtry.  Have been playing with it to see if 
I can get a customized look going on a media player for some mp4 that I 
have.  Was not having much luck trying to override the VideoView methods to 
get it to look how I wanted.  Is it right that the seek bar is the vertical 
block that shows current playing location, which can be dragged to change 
location? Would it be difficult to extend vidtry to include this?  Or maybe 
I can add the fast forward, fast backward buttons.  Thanks again.  Mark  

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

[android-developers] Re: Need help with sporadic exception ( SSL shutdown failed )

2011-01-16 Thread Dustin
Here's what I've learned in dealing with this particular problem on Android.

SSL connections are costly to set up.  Once set-up, the overhead of SSL 
isn't too bad.  To get around this issue, clients and servers can elect to 
keep a connection open, with the assumption that additional requests may be 
issued again soon (seconds or minutes).  Of course, keeping a connection 
open consumes valuable system resources, especially in high-transaction 
environment.  Clients and servers keep connections open via a keep alive 
strategy.

Servers are in complete control of how long a socket connection is kept 
alive.  However, a nice server will often tell the client how long it is 
willing to keep a socket open via a non-standard response header, 
Keep-Alive.  Examples of this header may look like this:

Keep-Alive: timeout=15, max=100
Keep-Alive: timeout=5, max=100
Keep-Alive: 300

The big issue with the Broken pipe is that a client doesn't know if the 
other side shut the connection down until it attempts to use the 
connection.  Thus, your client code grabs a connection from the connection 
manager, asks it to do something, only to get an IO Exception/Broken Pipe.

The solution I've found is to give a simple, custom keep-alive strategy as 
follows when you create your DefaultHttpClient:

mHttpClient.setKeepAliveStrategy(new ConnectionKeepAliveStrategy() {
@Override
public long getKeepAliveDuration(HttpResponse response, HttpContext 
context) {
return 60; // seconds
}
});

The Apache HttpClient tutorial page gives a better example if you are 
hitting various websites.  I chose to hard-code mine above because my client 
will hit one and only one HTTPS-enabled server which I have configured to 
have a keep-alive of 60 seconds.

Hope this helps!

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

2011-01-16 Thread Mark Murphy
On Sun, Jan 16, 2011 at 11:48 AM, Henrik Lindqvist
henrik.lindqv...@gmail.com wrote:
 Of course. That's a rule for any container/child relationship in Android.

 If a child view can't be larger than it's parent, how does a
 ScrollView work?

The visible bounds of the child are still not bigger than the visible
bounds of the parent.

  Any trick to make a ImageView larger than it's parent FrameLayout?

 Move it outside of the FrameLayout into some larger container. Or,
 expand the FrameLayout.

 I can't, it's an AppWidget.

Inflate a different layout for the app widget, one where the ImageView
is moved outside the FrameLayout into a larger container, or expand
the FrameLayout.

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

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

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Tracking someone else using Latitude (Android Tutorial Wanted)

2011-01-16 Thread Chris Grant
I have searched hard for a simple tutorial or example app that allows
a user to track the real-time location of someone else using Google
Latitude.  My goal is to track my wife while she runs and then build
up her stats and coarses using Latitude.  I can track myself no
problem via the many great tutorials out there, but have yet to find
an easy tutorial for tracking someone else..  My wife and I both have
gmail accounts and Android phones.

Does anyone out there have a snippet of code that shows how to do this
in an Android app?  Or can you point me to a real example?

Thanks,

Chris

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


[android-developers] Re: HttpURLConnection gives UnknownHostException

2011-01-16 Thread Paul Turchenko
Define INTRNET permossion in your manifest :)

On Jan 16, 9:47 am, Dan king...@gmail.com wrote:
 Thanks for the tips guys but none of these have solved the issue.

 On Jan 13, 10:39 pm, Rohan Dhamal rohandha...@gmail.com wrote:







  Hi,

     Please check once, if there is any timeout occurring while
  connecting with HttpURLConnection.

  On Jan 13, 1:23 am, Ankur Avlani ankuravl...@gmail.com wrote:

   True, I agree with what you say.  Its just that I feel, other apps should
   also break or give error.

   Anywayz, Thanks a lot for your inputs.

   regards,
   Ankur.

   On Wed, Jan 12, 2011 at 12:17 PM, Brill Pappin br...@pappin.ca wrote:
Well i suppose thats possible if your messing with the network stack,
but it's pretty low level for Java/Android.
I guess its also possible that the Android version you have has a
crappy stack or driver... or you have rooted it and have been messing
around under the covers so to speak.

There is nothing in Android really that would allow you to mess it up
that badly AFAIK, so I doubt it's your application causing the problem
if your not specifically getting under the covers.

However, the meaning of the exception is clear:

   http://download.oracle.com/javase/1.4.2/docs/api/java/net/UnknownHost...
and your app doesn't really control the process of translating a
domain to an ip.

- Brill Pappin

On Jan 12, 2:54 pm, Ankur Avlani ankuravl...@gmail.com wrote:
 Somehow I have this feeling it is related to my app only.  Other apps 
 on
the
 phone, I don't see any such issue.  Even when browsing on my phone, I
don't
 see any error.

 On Wed, Jan 12, 2011 at 11:41 AM, Kumar Bibek coomar@gmail.com
wrote:
  By Wi-Fi, I meant, you phone's Wi-Fi could be turning on and off. 
  There
is
  no other reason I can think of. It happens for me as well, 
  sometimes.

  Kumar Bibek
 http://techdroid.kbeanie.com
 http://www.kbeanie.com

  On Thu, Jan 13, 2011 at 1:10 AM, Ankur Avlani ankuravl...@gmail.com
wrote:

  I am sorry, that somehow doesn't convince me.  I am connected to 
  the
same
  wifi on my laptop and i never see any web page load error on my
laptop.

  On Wed, Jan 12, 2011 at 11:38 AM, Kumar Bibek coomar@gmail.com
wrote:

  Yup, then it's a problem with your Wi-Fi.

  Kumar Bibek
 http://techdroid.kbeanie.com
 http://www.kbeanie.com

  On Thu, Jan 13, 2011 at 1:07 AM, Ankur Avlani 
  ankuravl...@gmail.com
wrote:

  I am connected to network, I am on Wifi.  If i try again it 
  works.
 Its
  just random.

  On Wed, Jan 12, 2011 at 11:34 AM, Kumar Bibek 
  coomar@gmail.com
wrote:

  This error/exception comes because of no network connectivity.

  Kumar Bibek
 http://techdroid.kbeanie.com
 http://www.kbeanie.com

  On Thu, Jan 13, 2011 at 1:02 AM, Ankur Avlani 
ankuravl...@gmail.comwrote:

  Hi All,

  I am developing an application on Android.  I have seen that at
times
  when I try to connect using HttpURLConnection, for getting an
Image or
  anydata, I get the following error:

  01-12 11:24:05.073: WARN/System.err(16780):
  java.net.UnknownHostException: Host is 
  unresolved:www.XXX.com:80.

  Note: I get this error on my Motorolla Droid and not in 
  emulator.

  Any ideas?

  Thanks,
  Ankur

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

Re: [android-developers] Mystery device missing style attributes?

2011-01-16 Thread Dianne Hackborn
textSize is not defined in the platform's base theme.

These are the text size-related attributes in the theme:

   !-- Default appearance of text: color, typeface, size, and
style. --

attr name=textAppearance format=reference /

!-- Default appearance of text against an inverted background:

 color, typeface, size, and style. --

attr name=textAppearanceInverse format=reference /


!-- Text color, typeface, size, and style for large text.
Defaults to primary text color. --

attr name=textAppearanceLarge format=reference /

!-- Text color, typeface, size, and style for medium text.
Defaults to primary text color. --

attr name=textAppearanceMedium format=reference /

!-- Text color, typeface, size, and style for small text.
Defaults to secondary text color. --

attr name=textAppearanceSmall format=reference /


!-- Text color, typeface, size, and style for large inverse text.
Defaults to primary inverse text color. --

attr name=textAppearanceLargeInverse format=reference /

!-- Text color, typeface, size, and style for medium inverse
text. Defaults to primary inverse text color. --

attr name=textAppearanceMediumInverse format=reference /

!-- Text color, typeface, size, and style for small inverse text.
Defaults to secondary inverse text color. --

attr name=textAppearanceSmallInverse format=reference /

So the textSize attribute is rarely set as part of the base platform, except
inside of a TextAppearance style:

http://developer.android.com/reference/android/R.styleable.html#TextAppearance

So generally I wouldn't expect that code to work, unless textSize has been
explicitly supplied by you in a theme.  Instead, you need to retrieve the
resource of the TextAppearance size you want, and then can retrieve the
textSize from that.

That said, what *should* happen is you just get the default value you passed
in, because the theme doesn't hold its own value.  You should never get a
crash.  The obtainStyledAttributes() method is supposed to build an array of
values that corresponds to the array you passed in to it.  So a crash like
this is completely independent of whatever is defined in the theme, and just
an outright bug in whatever platform code it is running on.

Also your code has another issue where it is using array.getResourceId() --
once you do get down to the TextAppearance, generally the values there are
literals, not references to other resources.  So this also will always fail
(it doesn't have a resource id), even if textSize does have a value, again
resulting in you getting your default value.  You should just call
getDimensionPixelSize() with the array offset at which you want to retrieve
your value -- 0 in your case.

Oh.

That is probably the crash. :)  If for some reason there *is* some value for
textSize, if getResourceId() returns non-0, then you will pass a value  0
to getDimensionPixelSize(), which is outside the array you originally passed
in.

On Sun, Jan 16, 2011 at 9:24 AM, Brill Pappin br...@pappin.ca wrote:

 I'm getting this exception:

 java.lang.ArrayIndexOutOfBoundsException
 at
 android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:455)

 from this code:

 TypedArray array = 
 context.getTheme().obtainStyledAttributes(style,
 new int[] { android.R.attr.textSize });

 int textSize = array.getDimensionPixelSize(array.getResourceId(0, 0),
 defValue);


 I'm expecting a standard value from the system since thats what I'm asking
 for.

 It actually works on all devices I can get my hands on and of course the
 error reporting doesn't tell me anything useful except a stack trace.


 Does anyone have a solution that might work instead of this one?

 Does anyone know what device this might be?



 I do know that it has to be a 2.2 device or better because I've made the
 minimum 2.2 (froyo)

 At the moment the only idea I can come up with is to simply send a static
 value, but I'm obviously going to have to guess what the device is.


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-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=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] Hey guys i need some help With Install apps in memory card

2011-01-16 Thread Azzurra.com
I try many ways to install apps on my SD Card but not sucess.
Can somebody help me?
 
I have an HTC Magic with 2.1 android oficial of Brand inside

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

[android-developers] Re: ImageView, no scaling and gravity

2011-01-16 Thread Henrik Lindqvist
Wow, thanks. Your suggestion with a larger FrameLayout fixed it!

...LinearLayout etc...
FrameLayout
  android:layout_width=1000px
  android:layout_height=wrap_content
  android:layout_gravity=right
  ImageView
android:id=@+id/image
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_gravity=right
android:scaleType=center/
/FrameLayout
...LinearLayout etc...

You said a child view couldn't be larger than it's parent/container!?
Now the FrameLayout is forcefully wider than it's parents and the
whole app-widget.

Now, if I only could get the clipped edge faded for a nice ellipsize
effect. :)


On Jan 16, 7:38 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Sun, Jan 16, 2011 at 11:48 AM, Henrik Lindqvist

 henrik.lindqv...@gmail.com wrote:
  Of course. That's a rule for any container/child relationship in Android.

  If a child view can't be larger than it's parent, how does a
  ScrollView work?

 The visible bounds of the child are still not bigger than the visible
 bounds of the parent.

   Any trick to make a ImageView larger than it's parent FrameLayout?

  Move it outside of the FrameLayout into some larger container. Or,
  expand the FrameLayout.

  I can't, it's an AppWidget.

 Inflate a different layout for the app widget, one where the ImageView
 is moved outside the FrameLayout into a larger container, or expand
 the FrameLayout.

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

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

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


Re: [android-developers] Hey guys i need some help With Install apps in memory card

2011-01-16 Thread Dianne Hackborn
2.1 doesn't support installing apps on the SD card.

On Sun, Jan 16, 2011 at 2:05 PM, Azzurra.com zeus@gmail.com wrote:

 I try many ways to install apps on my SD Card but not sucess.
 Can somebody help me?

 I have an HTC Magic with 2.1 android oficial of Brand inside

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-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=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] Sharing files between apps

2011-01-16 Thread John Gaby
I have two applications which can access each others files.  To get a
path to a file in the other app, I am using the context.getDir(...)
function to get a path to the file for the running app, and then
changing the package name component of that path to the package name
of the other app.  This seems to work, but I am wondering if this is a
reliable way of doing this, or if there is another more appropriate
way.

Thanks.

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


Re: [android-developers] Sharing files between apps

2011-01-16 Thread TreKing
On Sun, Jan 16, 2011 at 4:27 PM, John Gaby jg...@gabysoft.com wrote:

 This seems to work, but I am wondering if this is a reliable way of doing
 this, or if there is another more appropriate way.


Don't know how reliable that is (seems a little hacky) but the more
appropriate way would probably be Content Provider.

-
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

Re: [android-developers] Sharing files between apps

2011-01-16 Thread Dianne Hackborn
That can break, there is no guarantee the apps are installed the same place,
for example if one is on the SD card and one isn't.

If you want to find out about an application, use
Context.createPackageContext() to create a Context configured for another
application.

(I assume you are doing tricks like creating the files world read/write to
allow access between them.  If so, note this can open up security holes.  I
would strongly recommend using one of the standard facilities for
interacting between them, such as a receiver, service, or content provider.
 And if you are using sharedUserId for this...  please do reconsider, this
locks you into that forever and has pretty deep repercussions on the apps
since they are now one unified entity whose permissions must be the union of
both apps etc.)

On Sun, Jan 16, 2011 at 2:27 PM, John Gaby jg...@gabysoft.com wrote:

 I have two applications which can access each others files.  To get a
 path to a file in the other app, I am using the context.getDir(...)
 function to get a path to the file for the running app, and then
 changing the package name component of that path to the package name
 of the other app.  This seems to work, but I am wondering if this is a
 reliable way of doing this, or if there is another more appropriate
 way.

 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.comandroid-developers%2bunsubscr...@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] Tracking someone else using Latitude (Android Tutorial Wanted)

2011-01-16 Thread Marcin Orlowski
On 16 January 2011 21:12, Chris Grant cwg...@gmail.com wrote:

 Does anyone out there have a snippet of code that shows how to do this
 in an Android app?  Or can you point me to a real example?

Not the answer you expect, but IMHO dedicated runner apps would
serve the purpose better and there're couple of such on Market.
Latitude is not reliable (if you ask me) and you won't get as frequent
reports as you may need.

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


[android-developers] Re: Sharing files between apps

2011-01-16 Thread John Gaby
 If you want to find out about an application, use
 Context.createPackageContext() to create a Context configured for another
 application.


This seems to be what I am looking for, however, when I call it with
the package name of the other app, it returns null (I get nothing from
logCat either).  I can use the PackageManager and retrieve the info
for that same package, so I am pretty sure I have the name correct and
the app is installed.  Do you have any ideas about what might be
wrong?

  And if you are using sharedUserId for this...  please do reconsider, this
 locks you into that forever and has pretty deep repercussions on the apps
 since they are now one unified entity whose permissions must be the union of
 both apps etc.)

I am using a sharedUserId, however, the two apps are unified.  In
fact, I would much rather have just a SINGLE app.  However, I want the
user to be able to install the app to the SD card, but it includes a
AppWidget component (which is optionally used) which cannot reside on
the SC card.  This seems to be forcing me to create two apps, may main
app, and a separate app to handle the AppWidget.  If there is a better
way to do this, I am all ears.

Thanks

On Jan 16, 2:54 pm, Dianne Hackborn hack...@android.com wrote:
 That can break, there is no guarantee the apps are installed the same place,
 for example if one is on the SD card and one isn't.

 If you want to find out about an application, use
 Context.createPackageContext() to create a Context configured for another
 application.

 (I assume you are doing tricks like creating the files world read/write to
 allow access between them.  If so, note this can open up security holes.  I
 would strongly recommend using one of the standard facilities for
 interacting between them, such as a receiver, service, or content provider.
  And if you are using sharedUserId for this...  please do reconsider, this
 locks you into that forever and has pretty deep repercussions on the apps
 since they are now one unified entity whose permissions must be the union of
 both apps etc.)



 On Sun, Jan 16, 2011 at 2:27 PM, John Gaby jg...@gabysoft.com wrote:
  I have two applications which can access each others files.  To get a
  path to a file in the other app, I am using the context.getDir(...)
  function to get a path to the file for the running app, and then
  changing the package name component of that path to the package name
  of the other app.  This seems to work, but I am wondering if this is a
  reliable way of doing this, or if there is another more appropriate
  way.

  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.comandroid-developers%2bunsubscr...@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: Sharing files between apps

2011-01-16 Thread Dianne Hackborn
On Sun, Jan 16, 2011 at 4:21 PM, John Gaby jg...@gabysoft.com wrote:

 This seems to be what I am looking for, however, when I call it with
 the package name of the other app, it returns null (I get nothing from
 logCat either).  I can use the PackageManager and retrieve the info
 for that same package, so I am pretty sure I have the name correct and
 the app is installed.  Do you have any ideas about what might be
 wrong?


Well no idea from just your paragraph description there. :)  This API
certainly works -- it is used a lot, for things like inflating the UI of app
widgets.


 I am using a sharedUserId, however, the two apps are unified.  In
 fact, I would much rather have just a SINGLE app.  However, I want the
 user to be able to install the app to the SD card, but it includes a
 AppWidget component (which is optionally used) which cannot reside on
 the SC card.  This seems to be forcing me to create two apps, may main
 app, and a separate app to handle the AppWidget.  If there is a better
 way to do this, I am all ears.


Oh my.  Well personally I would really strongly discourage doing that.  I
think you are going to end up with continual pain in app maintenance, not to
mention support for your users dealing with multiple apps like this.

-- 
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] Solution: Android INSTALL_FAILED_INSUFFICIENT_STORAGE error

2011-01-16 Thread Andrew Smith
The INSTALL_FAILED_INSUFFICIENT_STORAGE error is the bane of every
Android developer's life. It happens regardless of app size, or how
much storage is available. Rebooting the target device fixes the
problem briefly, but it soon comes back. There are hundreds (if not
thousands) of message board posts from people asking why the problem
occurs, but the folks at Google are frustratingly silent on the issue.

There is a simple workaround. If your test device is running Android
2.2 or later then add the android:installLocation attribute to your
application's manifest file, with the value preferExternal. This
will force the app to be installed on the device's external storage,
such as a phone's SD card.

For example:

  manifest xmlns:android=http://schemas.android.com/apk/res/android;
package=com.andrewsmith.android.darkness
android:installLocation=preferExternal

This is more of a band-aid than a fix, and it may not be ideal if you
want your finished app to install on the device's internal memory. But
it will at least make the development process a lot less frustrating.

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


[android-developers] Re: Preventing the search button from closing an AlertDialog?

2011-01-16 Thread Zsolt Vasvari
Just to bump this (as this is important for me), this close on the
Search press behavior is happening even if the dialog is set to non-
cancelable.  I think that's a flat out bug and may create a bug report
for it.

On Jan 16, 10:49 am, Zsolt Vasvari zvasv...@gmail.com wrote:
 I have to add that this effect EVERY dialog in the system.  So, for
 example, if you have an LVL or any type of important dialog where you
 must be notified of its closing, you better make sure that the user
 cannot just dismiss it using the Search button.

 On Jan 16, 10:44 am, Zsolt Vasvari zvasv...@gmail.com wrote:



  Hello,

  Is there a way to do what the title says?  I have a password security
  dialog built using AlertDialog.Builder.  The problem is that pressing
  the search button simply dismisses the dialog.  I need to notify the
  underlying activity that the dialog was dismiised so that I can quit
  the app.

  I've tried to set an onDismissListener which notifies the parent
  activiy.  This works OK, but the parent comes into view for a few
  second and then the app closes -- this is a security risk.  I have to
  mention that I have the background activity blurred out for security
  reasons and when the user presses the normal Cancel button on the
  dialog, the background activity is never fully visible again -- it
  just stays blurred, then it finishes.  On the other hand, when I hit
  the Search button, the background activity comes into full unblurred
  view and then it finishes maybe 2 seconds later.

  So ideal thing would be is to somehow catch and eat the search key
  press, but I cannot find a way to do this.

  Anyhow has any suggestions/ideas?- Hide quoted text -

 - Show quoted text -

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


[android-developers] Re: Solution: Android INSTALL_FAILED_INSUFFICIENT_STORAGE error

2011-01-16 Thread Zsolt Vasvari
That not a solution or even a band aid:  I absolutely wouldn't want my
app to be installed on the SD card by default due to its use of
widgets and it being a BOOT_COMPLETED receiver.

On Jan 17, 8:55 am, Andrew Smith meeja...@gmail.com wrote:
 The INSTALL_FAILED_INSUFFICIENT_STORAGE error is the bane of every
 Android developer's life. It happens regardless of app size, or how
 much storage is available. Rebooting the target device fixes the
 problem briefly, but it soon comes back. There are hundreds (if not
 thousands) of message board posts from people asking why the problem
 occurs, but the folks at Google are frustratingly silent on the issue.

 There is a simple workaround. If your test device is running Android
 2.2 or later then add the android:installLocation attribute to your
 application's manifest file, with the value preferExternal. This
 will force the app to be installed on the device's external storage,
 such as a phone's SD card.

 For example:

   manifest xmlns:android=http://schemas.android.com/apk/res/android;
     package=com.andrewsmith.android.darkness
     android:installLocation=preferExternal

 This is more of a band-aid than a fix, and it may not be ideal if you
 want your finished app to install on the device's internal memory. But
 it will at least make the development process a lot less frustrating.

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


[android-developers] Re: Sharing files between apps

2011-01-16 Thread John Gaby
 Well no idea from just your paragraph description there. :)  This API
 certainly works -- it is used a lot, for things like inflating the UI of app
 widgets.


The following is the routine that I wrote to test the function.  The
call to manager.getPackageInfo works, but the call to
GetPackageContents returns null.

private void Test()
{
String pkg = com.gabysoft.quizardwidget;

PackageManager manager= getPackageManager();
PackageInfoinfo;

try
{
info = manager.getPackageInfo(pkg, 0);

int v = info.versionCode;
}
catch (NameNotFoundException e)
{
}

Context c = GetPackageContext(pkg, CONTEXT_INCLUDE_CODE);
File file = c.getDir(data, Context.MODE_PRIVATE);
String path = file.getAbsolutePath();
}

 Oh my.  Well personally I would really strongly discourage doing that.  I
 think you are going to end up with continual pain in app maintenance, not to
 mention support for your users dealing with multiple apps like this.

I actually tend to agree, but I really hate to force the user to
install the app to internal memory (there is a fair amount of
content).  The feedback I have gotten so far from the users that I
have asked is that they would rather see a separate app than loose the
ability to install on the SD card.  Is there ANY other way to deal
with this?

Thanks.

On Jan 16, 4:46 pm, Dianne Hackborn hack...@android.com wrote:
 On Sun, Jan 16, 2011 at 4:21 PM, John Gaby jg...@gabysoft.com wrote:
  This seems to be what I am looking for, however, when I call it with
  the package name of the other app, it returns null (I get nothing from
  logCat either).  I can use the PackageManager and retrieve the info
  for that same package, so I am pretty sure I have the name correct and
  the app is installed.  Do you have any ideas about what might be
  wrong?

 Well no idea from just your paragraph description there. :)  This API
 certainly works -- it is used a lot, for things like inflating the UI of app
 widgets.

  I am using a sharedUserId, however, the two apps are unified.  In
  fact, I would much rather have just a SINGLE app.  However, I want the
  user to be able to install the app to the SD card, but it includes a
  AppWidget component (which is optionally used) which cannot reside on
  the SC card.  This seems to be forcing me to create two apps, may main
  app, and a separate app to handle the AppWidget.  If there is a better
  way to do this, I am all ears.

 Oh my.  Well personally I would really strongly discourage doing that.  I
 think you are going to end up with continual pain in app maintenance, not to
 mention support for your users dealing with multiple apps like this.

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

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

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


[android-developers] Re: Mystery device missing style attributes?

2011-01-16 Thread Zsolt Vasvari
This is a bit off-topic, but perhaphs not so much:

The single most confusing aspect of the Android platform, in my
opinion, this whole business with Themes/Styles/Stylable/Attributes.
Does anybody have a link to a good write-up on how this really works?
I know it's in the docs, but I find it a bit hard to follow.



On Jan 17, 4:39 am, Dianne Hackborn hack...@android.com wrote:
 textSize is not defined in the platform's base theme.

 These are the text size-related attributes in the theme:

            !-- Default appearance of text: color, typeface, size, and
 style. --

         attr name=textAppearance format=reference /

         !-- Default appearance of text against an inverted background:

              color, typeface, size, and style. --

         attr name=textAppearanceInverse format=reference /

         !-- Text color, typeface, size, and style for large text.
 Defaults to primary text color. --

         attr name=textAppearanceLarge format=reference /

         !-- Text color, typeface, size, and style for medium text.
 Defaults to primary text color. --

         attr name=textAppearanceMedium format=reference /

         !-- Text color, typeface, size, and style for small text.
 Defaults to secondary text color. --

         attr name=textAppearanceSmall format=reference /

         !-- Text color, typeface, size, and style for large inverse text.
 Defaults to primary inverse text color. --

         attr name=textAppearanceLargeInverse format=reference /

         !-- Text color, typeface, size, and style for medium inverse
 text. Defaults to primary inverse text color. --

         attr name=textAppearanceMediumInverse format=reference /

         !-- Text color, typeface, size, and style for small inverse text.
 Defaults to secondary inverse text color. --

         attr name=textAppearanceSmallInverse format=reference /

 So the textSize attribute is rarely set as part of the base platform, except
 inside of a TextAppearance style:

 http://developer.android.com/reference/android/R.styleable.html#TextA...

 So generally I wouldn't expect that code to work, unless textSize has been
 explicitly supplied by you in a theme.  Instead, you need to retrieve the
 resource of the TextAppearance size you want, and then can retrieve the
 textSize from that.

 That said, what *should* happen is you just get the default value you passed
 in, because the theme doesn't hold its own value.  You should never get a
 crash.  The obtainStyledAttributes() method is supposed to build an array of
 values that corresponds to the array you passed in to it.  So a crash like
 this is completely independent of whatever is defined in the theme, and just
 an outright bug in whatever platform code it is running on.

 Also your code has another issue where it is using array.getResourceId() --
 once you do get down to the TextAppearance, generally the values there are
 literals, not references to other resources.  So this also will always fail
 (it doesn't have a resource id), even if textSize does have a value, again
 resulting in you getting your default value.  You should just call
 getDimensionPixelSize() with the array offset at which you want to retrieve
 your value -- 0 in your case.

 Oh.

 That is probably the crash. :)  If for some reason there *is* some value for
 textSize, if getResourceId() returns non-0, then you will pass a value  0
 to getDimensionPixelSize(), which is outside the array you originally passed
 in.





 On Sun, Jan 16, 2011 at 9:24 AM, Brill Pappin br...@pappin.ca wrote:
  I'm getting this exception:

  java.lang.ArrayIndexOutOfBoundsException
  at
  android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:455)

  from this code:

                  TypedArray array = 
  context.getTheme().obtainStyledAttributes(style,
  new int[] { android.R.attr.textSize });

  int textSize = array.getDimensionPixelSize(array.getResourceId(0, 0),
  defValue);

  I'm expecting a standard value from the system since thats what I'm asking
  for.

  It actually works on all devices I can get my hands on and of course the
  error reporting doesn't tell me anything useful except a stack trace.

  Does anyone have a solution that might work instead of this one?

  Does anyone know what device this might be?

  I do know that it has to be a 2.2 device or better because I've made the
  minimum 2.2 (froyo)

  At the moment the only idea I can come up with is to simply send a static
  value, but I'm obviously going to have to guess what the device is.

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

 --
 Dianne Hackborn
 

[android-developers] Re: Tracking someone else using Latitude (Android Tutorial Wanted)

2011-01-16 Thread Chris Grant
Hmmm... not even sure what a runner app is.  Do I buy this?  How is
it integrated in to my app so that i can get a friends location?  It
is ashame that Latitude for all its hype, is this hard to use and so
unreliable.  Anyone else have ideas on the easiest and most reliable
way to get a friends location?

Thanks,

Chris

On Jan 16, 4:49 pm, Marcin Orlowski webnet.andr...@gmail.com wrote:
 On 16 January 2011 21:12, Chris Grant cwg...@gmail.com wrote:

  Does anyone out there have a snippet of code that shows how to do this
  in an Android app?  Or can you point me to a real example?

 Not the answer you expect, but IMHO dedicated runner apps would
 serve the purpose better and there're couple of such on Market.
 Latitude is not reliable (if you ask me) and you won't get as frequent
 reports as you may need.

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

2011-01-16 Thread Felix long
在 2011年1月15日星期六,Kostya Vasilyev kmans...@gmail.com 写道:
 Braco,

 You are using a Java Timer, which invokes your TimerTask on a background 
 thread.
 In Android, only the original (UI) thread is allowed to touch the UI. 
 Touching the UI from a background thread, like your code does, produces 
 unpredictable results (possibly a crash).

 This should help you refactor you code:
 http://developer.android.com/resources/articles/timed-ui-updates.html

 -- Kostya
 2011/1/13 braco_ braco...@googlemail.com

 Hello,

 I have 4 Images
 final ImageView redImage = (ImageView) findViewById
 (R.id.circle_red);
 final ImageView blueImage = (ImageView) findViewById
 (R.id.circle_blue);
 final ImageView greenImage = (ImageView) findViewById
 (R.id.circle_green);
 final ImageView yellowImage = (ImageView) findViewById
 (R.id.circle_yellow);

 I try to blinking this images with a timer
 final Timer timer = new Timer();

 startButton.setOnClickListener(new View.OnClickListener() {
 @Override
 public void onClick(View v) {
 // TODO Auto-generated method stub


 timer.schedule(new 
 TaskTimer(yellowImage,punkteStand), 0, 2000);
 }
 });

 TaskTimer.java
 public TaskTimer(ImageView object, TextView pkt){
 image =  object;
 punkteStand = pkt;
 }


 @Override
 public void run() {
 // TODO Auto-generated method stub
 String istString = (new Integer(time)).toString();
 CharSequence abc = istString;
 punkteStand.setText(abc);
 time++;
 if(image.getVisibility() == View.INVISIBLE){
 image.setVisibility(View.VISIBLE);
 }
 else {
 image.setVisibility(View.INVISIBLE);

 }

 But if i start nothing happens how can i do that better that a image
 will blinking?

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

-- 
Best Regards

Felix Long

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


[android-developers] Re: Solution: Android INSTALL_FAILED_INSUFFICIENT_STORAGE error

2011-01-16 Thread Andrew Smith
I'm sure there will be other apps like yours for which this is
unsuitable. But it is helpful for someone developing an app such as a
game, news reader, email client, video player, etc.

Perhaps you can suggest a solution suitable for apps such as yours?



On Jan 17, 1:17 am, Zsolt Vasvari zvasv...@gmail.com wrote:
 That not a solution or even a band aid:  I absolutely wouldn't want my
 app to be installed on the SD card by default due to its use of
 widgets and it being a BOOT_COMPLETED receiver.

 On Jan 17, 8:55 am, Andrew Smith meeja...@gmail.com wrote:

  The INSTALL_FAILED_INSUFFICIENT_STORAGE error is the bane of every
  Android developer's life. It happens regardless of app size, or how
  much storage is available. Rebooting the target device fixes the
  problem briefly, but it soon comes back. There are hundreds (if not
  thousands) of message board posts from people asking why the problem
  occurs, but the folks at Google are frustratingly silent on the issue.

  There is a simple workaround. If your test device is running Android
  2.2 or later then add the android:installLocation attribute to your
  application's manifest file, with the value preferExternal. This
  will force the app to be installed on the device's external storage,
  such as a phone's SD card.

  For example:

    manifest xmlns:android=http://schemas.android.com/apk/res/android;
      package=com.andrewsmith.android.darkness
      android:installLocation=preferExternal

  This is more of a band-aid than a fix, and it may not be ideal if you
  want your finished app to install on the device's internal memory. But
  it will at least make the development process a lot less frustrating.

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


[android-developers] Re: Solution: Android INSTALL_FAILED_INSUFFICIENT_STORAGE error

2011-01-16 Thread Zsolt Vasvari
 Perhaps you can suggest a solution suitable for apps such as yours?

Wish I could...

I only spoke in the context of my app, I understand it's a reasonable
workaround for some apps.

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

2011-01-16 Thread Dianne Hackborn
On Sun, Jan 16, 2011 at 5:19 PM, John Gaby jg...@gabysoft.com wrote:

 The following is the routine that I wrote to test the function.  The
 call to manager.getPackageInfo works, but the call to
 GetPackageContents returns null.


What is GetPackageContext in your code?  Is that just a typo and should be
getPackageContext?


 I actually tend to agree, but I really hate to force the user to
 install the app to internal memory (there is a fair amount of
 content).  The feedback I have gotten so far from the users that I
 have asked is that they would rather see a separate app than loose the
 ability to install on the SD card.  Is there ANY other way to deal
 with this?


Well for transferring data between apps, I will say the same thing I already
have: I would very much recommend using a receiver, service, or content
provider.  Don't use shared user IDs.  Your widget could just for example
send a broadcast to your app when it needs to populate data.  As a bonus,
your main app could be the one in charge of the data and send a broadcast to
the widget app when it has changed to give it the new data.  I think you'll
find this a much cleaner solution than trying to directly access data files.

At any rate, offering your users a small add-on app that they can optionally
download to provide a widget is probably not too bad I guess.  Heck you
could turn it into an advantage and make it paid so it is an additional
feature they can purchase for your app. ;)

But I do think you should architect it so that the interaction between these
pieces is through app components, not data.  It will result in a much
cleaner and more maintainable design.

-- 
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: Preventing the search button from closing an AlertDialog?

2011-01-16 Thread Dianne Hackborn
You could try attaching a key listener that consumes the search key.

I agree it is dumb for it to be dismissing itself when the key is pressed.
 I think this is left-over from when the search key used to always to a
global search, so it would be a switch into the search UI and dialogs would
dismiss to clean things up a bit.  It doesn't make sense how things are now.

On Sun, Jan 16, 2011 at 5:15 PM, Zsolt Vasvari zvasv...@gmail.com wrote:

 Just to bump this (as this is important for me), this close on the
 Search press behavior is happening even if the dialog is set to non-
 cancelable.  I think that's a flat out bug and may create a bug report
 for it.

 On Jan 16, 10:49 am, Zsolt Vasvari zvasv...@gmail.com wrote:
  I have to add that this effect EVERY dialog in the system.  So, for
  example, if you have an LVL or any type of important dialog where you
  must be notified of its closing, you better make sure that the user
  cannot just dismiss it using the Search button.
 
  On Jan 16, 10:44 am, Zsolt Vasvari zvasv...@gmail.com wrote:
 
 
 
   Hello,
 
   Is there a way to do what the title says?  I have a password security
   dialog built using AlertDialog.Builder.  The problem is that pressing
   the search button simply dismisses the dialog.  I need to notify the
   underlying activity that the dialog was dismiised so that I can quit
   the app.
 
   I've tried to set an onDismissListener which notifies the parent
   activiy.  This works OK, but the parent comes into view for a few
   second and then the app closes -- this is a security risk.  I have to
   mention that I have the background activity blurred out for security
   reasons and when the user presses the normal Cancel button on the
   dialog, the background activity is never fully visible again -- it
   just stays blurred, then it finishes.  On the other hand, when I hit
   the Search button, the background activity comes into full unblurred
   view and then it finishes maybe 2 seconds later.
 
   So ideal thing would be is to somehow catch and eat the search key
   press, but I cannot find a way to do this.
 
   Anyhow has any suggestions/ideas?- 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




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

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

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

[android-developers] Re: Preventing the search button from closing an AlertDialog?

2011-01-16 Thread Zsolt Vasvari
Thanks, Dianne!



 You could try attaching a key listener that consumes the search key.

Could you point me in the right direction?  How can I attach a key
listener to a dialog returned from AlertDialog.Builder?

As, obviously,I have access to the parent Activity, can I do something
there?  Wouldn't be ideal, because I went throught a large effort to
decouple my dialogs from the parent activities, but if that's the only
solution...



 I agree it is dumb for it to be dismissing itself when the key is pressed.
  I think this is left-over from when the search key used to always to a
 global search, so it would be a switch into the search UI and dialogs would
 dismiss to clean things up a bit.  It doesn't make sense how things are now.


I will create a bug report for non-cancelable dialogs, which should
not be dismissable like that.

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


[android-developers] Re: Sharing files between apps

2011-01-16 Thread John Gaby
 What is GetPackageContext in your code?  Is that just a typo and should be
 getPackageContext?

Well, now don't I feel sheepish!  It was indeed a typo, and the ever
so helpful editor created a GetPackageContext for me and returned
null.  Sorry about wasting your time.

As for your other suggestion about using a broadcast to get the data,
that does seem like a good idea.  In fact, the widget itself uses a
broadcast intent when the user click on it to get the next set of data
to display.  I assume that I could send that broadcast to my main app
just as easily as it does to the Widget app.

Thanks for the help and suggestions.


On Jan 16, 5:57 pm, Dianne Hackborn hack...@android.com wrote:
 On Sun, Jan 16, 2011 at 5:19 PM, John Gaby jg...@gabysoft.com wrote:
  The following is the routine that I wrote to test the function.  The
  call to manager.getPackageInfo works, but the call to
  GetPackageContents returns null.

 What is GetPackageContext in your code?  Is that just a typo and should be
 getPackageContext?

  I actually tend to agree, but I really hate to force the user to
  install the app to internal memory (there is a fair amount of
  content).  The feedback I have gotten so far from the users that I
  have asked is that they would rather see a separate app than loose the
  ability to install on the SD card.  Is there ANY other way to deal
  with this?

 Well for transferring data between apps, I will say the same thing I already
 have: I would very much recommend using a receiver, service, or content
 provider.  Don't use shared user IDs.  Your widget could just for example
 send a broadcast to your app when it needs to populate data.  As a bonus,
 your main app could be the one in charge of the data and send a broadcast to
 the widget app when it has changed to give it the new data.  I think you'll
 find this a much cleaner solution than trying to directly access data files.

 At any rate, offering your users a small add-on app that they can optionally
 download to provide a widget is probably not too bad I guess.  Heck you
 could turn it into an advantage and make it paid so it is an additional
 feature they can purchase for your app. ;)

 But I do think you should architect it so that the interaction between these
 pieces is through app components, not data.  It will result in a much
 cleaner and more maintainable design.

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

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

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


[android-developers] How to have your app overlayed on top of any other app?

2011-01-16 Thread pcm2a
That subject may sound crazy and before today I thought it was
impossible.  There is a free app called Super Manager on the market.
This app gives you a little button to press that is overlayed
everywhere.  No matter if you are on your home screen, gmail or the
browser that icon is overlayed.

Pressing the icon brings up the app interface which is a little box.
This box is also overlayed on top of your already running application
like dolphin.

While the icon overlay or app overlay is on the screen you can still
interact with the app you were running!

How can I accomplish something like this in my code?  I can think of
many great uses.

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


[android-developers] Re: How to have your app overlayed on top of any other app?

2011-01-16 Thread Hari Edo

Another program called SoftKeys does this by way of a running
Service.  It offers access to the usually-mandated hardware keys
like MENU, BACK, HOME, SEARCH, even for those few oddball
devices like NOOKcolor that do not include those keys.

An IME keyboard is also a form of this kind of UI overlay that
people see all the time.  I am just guessing, but any soft keyboard
is likely another example of a service that spawns interface bits.

However, I can see this sort of thing being more nuisance than
godsend... one person's great uses is another person's clutter.

On Jan 16, 9:34 pm, pcm2a reeeye...@gmail.com wrote:
 That subject may sound crazy and before today I thought it was
 impossible.  There is a free app called Super Manager on the market.
 This app gives you a little button to press that is overlayed
 everywhere.  No matter if you are on your home screen, gmail or the
 browser that icon is overlayed.

 Pressing the icon brings up the app interface which is a little box.
 This box is also overlayed on top of your already running application
 like dolphin.

 While the icon overlay or app overlay is on the screen you can still
 interact with the app you were running!

 How can I accomplish something like this in my code?  I can think of
 many great uses.

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


[android-developers] Re: change permission to /data/data/package name/databases

2011-01-16 Thread tstanly
beacuse I want to change a database file in /data/data/package/
databases
I need permission for apps to copy .db file from a folder to
/data/data/Native app package/databases,

so I need to change permission,
is somebody have suggestion?

thanks

On 1月14日, 上午2時12分, TreKing treking...@gmail.com wrote:
 On Thu, Jan 13, 2011 at 2:53 AM, stanly tsai.sta...@gmail.com wrote:
  I want to change permission for /data/data/package/databases folder, is
  it possible to do this action in my application?

 Why do you want to do this?

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


[android-developers] poor state of webkit transforms in Android

2011-01-16 Thread devi prasad
Hi, I'm finding out that Android has either disabled or broken
Webkit's -webkit-transform features. I couldn't locate an authentic
documentation from Google about android.webkit and its (broken)
status. Can someone who knows it all throw light and save immense time
that I'm spending testing these things? For example, when I try
rotateZ it behaves like rotateY, while rotateY just doesn't work for
me on Android 2.2 + Nexus One. I have tested rotateY and rotateZ on
Chrome browser and things appear fine there.

So, any official statement on Android's Webkit (in)capabilities?

thanks
dp

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


[android-developers] Re: AnimationSet - Scaling and moving at the same time

2011-01-16 Thread Hari Edo

It seems like whenever a scale is done as a part of an animset,
the starting or ending scale is computed incorrectly, as the
reciprocal
of the ending scale.  I think they're calculating the anti-transform
for
each element, and doing it badly, messing up compound animations.

Thanks for posting good YouTube examples of the phenomenon.
Now post those to the bug tracker!

On Jan 16, 2:54 pm, Oded O. olb...@gmail.com wrote:
 I'm building a new layout engine (and hopefully open-source it once I'm
 done)
 I need to scale and move a tile from one position on the screen to
 another.

 When I only move, the coordinates seems to be OK (the top-left corner of the
 tile is positioned exactly where it should 
 be)http://www.youtube.com/watch?v=MazxKnh83us

 When I only scale, the result size of the tile seems to be OK, and the
 tile's new size is exactly what it should 
 be.http://www.youtube.com/watch?v=bG3j0GdqbTI

 But when I combine these two animation to a single AnimationSet, something
 goes wrong, the top-left corner of the tile is off-setted to an unknown
 destination (couldn't figure out the logic behind the new 
 position)http://www.youtube.com/watch?v=JKn3jaATtww

 Has anyone came across this sort of issue?

 It's important that the two animation would happen at the same time (I don't
 want to move, and than scale, or vice-versa).

 Thanks!

 Oded

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


[android-developers] Re: Mystery device missing style attributes?

2011-01-16 Thread Brill Pappin
Nice!
Lots of good tidbits on style in that response :)

I'll try rewriting it as suggested and see if that helps.
Unfortunately I'm unable to reproduce locally, so ill have to through
it out in the wild again.

- Brill Pappin

On Jan 16, 3:39 pm, Dianne Hackborn hack...@android.com wrote:
 textSize is not defined in the platform's base theme.

 These are the text size-related attributes in the theme:

            !-- Default appearance of text: color, typeface, size, and
 style. --

         attr name=textAppearance format=reference /

         !-- Default appearance of text against an inverted background:

              color, typeface, size, and style. --

         attr name=textAppearanceInverse format=reference /

         !-- Text color, typeface, size, and style for large text.
 Defaults to primary text color. --

         attr name=textAppearanceLarge format=reference /

         !-- Text color, typeface, size, and style for medium text.
 Defaults to primary text color. --

         attr name=textAppearanceMedium format=reference /

         !-- Text color, typeface, size, and style for small text.
 Defaults to secondary text color. --

         attr name=textAppearanceSmall format=reference /

         !-- Text color, typeface, size, and style for large inverse text.
 Defaults to primary inverse text color. --

         attr name=textAppearanceLargeInverse format=reference /

         !-- Text color, typeface, size, and style for medium inverse
 text. Defaults to primary inverse text color. --

         attr name=textAppearanceMediumInverse format=reference /

         !-- Text color, typeface, size, and style for small inverse text.
 Defaults to secondary inverse text color. --

         attr name=textAppearanceSmallInverse format=reference /

 So the textSize attribute is rarely set as part of the base platform, except
 inside of a TextAppearance style:

 http://developer.android.com/reference/android/R.styleable.html#TextA...

 So generally I wouldn't expect that code to work, unless textSize has been
 explicitly supplied by you in a theme.  Instead, you need to retrieve the
 resource of the TextAppearance size you want, and then can retrieve the
 textSize from that.

 That said, what *should* happen is you just get the default value you passed
 in, because the theme doesn't hold its own value.  You should never get a
 crash.  The obtainStyledAttributes() method is supposed to build an array of
 values that corresponds to the array you passed in to it.  So a crash like
 this is completely independent of whatever is defined in the theme, and just
 an outright bug in whatever platform code it is running on.

 Also your code has another issue where it is using array.getResourceId() --
 once you do get down to the TextAppearance, generally the values there are
 literals, not references to other resources.  So this also will always fail
 (it doesn't have a resource id), even if textSize does have a value, again
 resulting in you getting your default value.  You should just call
 getDimensionPixelSize() with the array offset at which you want to retrieve
 your value -- 0 in your case.

 Oh.

 That is probably the crash. :)  If for some reason there *is* some value for
 textSize, if getResourceId() returns non-0, then you will pass a value  0
 to getDimensionPixelSize(), which is outside the array you originally passed
 in.





 On Sun, Jan 16, 2011 at 9:24 AM, Brill Pappin br...@pappin.ca wrote:
  I'm getting this exception:

  java.lang.ArrayIndexOutOfBoundsException
  at
  android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:455)

  from this code:

                  TypedArray array = 
  context.getTheme().obtainStyledAttributes(style,
  new int[] { android.R.attr.textSize });

  int textSize = array.getDimensionPixelSize(array.getResourceId(0, 0),
  defValue);

  I'm expecting a standard value from the system since thats what I'm asking
  for.

  It actually works on all devices I can get my hands on and of course the
  error reporting doesn't tell me anything useful except a stack trace.

  Does anyone have a solution that might work instead of this one?

  Does anyone know what device this might be?

  I do know that it has to be a 2.2 device or better because I've made the
  minimum 2.2 (froyo)

  At the moment the only idea I can come up with is to simply send a static
  value, but I'm obviously going to have to guess what the device is.

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

[android-developers] Re: Mystery device missing style attributes?

2011-01-16 Thread Brill Pappin

Oh yah, I have trouble with styles all the time :)
An expert I am not...

- Brill


On Jan 16, 8:35 pm, Zsolt Vasvari zvasv...@gmail.com wrote:
 This is a bit off-topic, but perhaphs not so much:

 The single most confusing aspect of the Android platform, in my
 opinion, this whole business with Themes/Styles/Stylable/Attributes.
 Does anybody have a link to a good write-up on how this really works?
 I know it's in the docs, but I find it a bit hard to follow.

 On Jan 17, 4:39 am, Dianne Hackborn hack...@android.com wrote:



  textSize is not defined in the platform's base theme.

  These are the text size-related attributes in the theme:

             !-- Default appearance of text: color, typeface, size, and
  style. --

          attr name=textAppearance format=reference /

          !-- Default appearance of text against an inverted background:

               color, typeface, size, and style. --

          attr name=textAppearanceInverse format=reference /

          !-- Text color, typeface, size, and style for large text.
  Defaults to primary text color. --

          attr name=textAppearanceLarge format=reference /

          !-- Text color, typeface, size, and style for medium text.
  Defaults to primary text color. --

          attr name=textAppearanceMedium format=reference /

          !-- Text color, typeface, size, and style for small text.
  Defaults to secondary text color. --

          attr name=textAppearanceSmall format=reference /

          !-- Text color, typeface, size, and style for large inverse text.
  Defaults to primary inverse text color. --

          attr name=textAppearanceLargeInverse format=reference /

          !-- Text color, typeface, size, and style for medium inverse
  text. Defaults to primary inverse text color. --

          attr name=textAppearanceMediumInverse format=reference /

          !-- Text color, typeface, size, and style for small inverse text.
  Defaults to secondary inverse text color. --

          attr name=textAppearanceSmallInverse format=reference /

  So the textSize attribute is rarely set as part of the base platform, except
  inside of a TextAppearance style:

 http://developer.android.com/reference/android/R.styleable.html#TextA...

  So generally I wouldn't expect that code to work, unless textSize has been
  explicitly supplied by you in a theme.  Instead, you need to retrieve the
  resource of the TextAppearance size you want, and then can retrieve the
  textSize from that.

  That said, what *should* happen is you just get the default value you passed
  in, because the theme doesn't hold its own value.  You should never get a
  crash.  The obtainStyledAttributes() method is supposed to build an array of
  values that corresponds to the array you passed in to it.  So a crash like
  this is completely independent of whatever is defined in the theme, and just
  an outright bug in whatever platform code it is running on.

  Also your code has another issue where it is using array.getResourceId() --
  once you do get down to the TextAppearance, generally the values there are
  literals, not references to other resources.  So this also will always fail
  (it doesn't have a resource id), even if textSize does have a value, again
  resulting in you getting your default value.  You should just call
  getDimensionPixelSize() with the array offset at which you want to retrieve
  your value -- 0 in your case.

  Oh.

  That is probably the crash. :)  If for some reason there *is* some value for
  textSize, if getResourceId() returns non-0, then you will pass a value  0
  to getDimensionPixelSize(), which is outside the array you originally passed
  in.

  On Sun, Jan 16, 2011 at 9:24 AM, Brill Pappin br...@pappin.ca wrote:
   I'm getting this exception:

   java.lang.ArrayIndexOutOfBoundsException
   at
   android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:455)

   from this code:

                   TypedArray array = 
   context.getTheme().obtainStyledAttributes(style,
   new int[] { android.R.attr.textSize });

   int textSize = array.getDimensionPixelSize(array.getResourceId(0, 0),
   defValue);

   I'm expecting a standard value from the system since thats what I'm asking
   for.

   It actually works on all devices I can get my hands on and of course the
   error reporting doesn't tell me anything useful except a stack trace.

   Does anyone have a solution that might work instead of this one?

   Does anyone know what device this might be?

   I do know that it has to be a 2.2 device or better because I've made the
   minimum 2.2 (froyo)

   At the moment the only idea I can come up with is to simply send a static
   value, but I'm obviously going to have to guess what the device is.

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

Re: [android-developers] Re: change permission to /data/data/package name/databases

2011-01-16 Thread Dianne Hackborn
If it isn't your app, you can't.

On Sun, Jan 16, 2011 at 6:51 PM, tstanly tsai.sta...@gmail.com wrote:

 beacuse I want to change a database file in /data/data/package/
 databases
 I need permission for apps to copy .db file from a folder to
 /data/data/Native app package/databases,

 so I need to change permission,
 is somebody have suggestion?

 thanks

 On 1月14日, 上午2時12分, TreKing treking...@gmail.com wrote:
  On Thu, Jan 13, 2011 at 2:53 AM, stanly tsai.sta...@gmail.com wrote:
   I want to change permission for /data/data/package/databases folder,
 is
   it possible to do this action in my application?
 
  Why do you want to do this?
 
 
 ---
 --
  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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




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

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

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

[android-developers] Re: Tracking someone else using Latitude (Android Tutorial Wanted)

2011-01-16 Thread Zsolt Vasvari
Try the free open-source Google app called My Tracks.  I've used it
before and it's good.

On Jan 17, 9:37 am, Chris Grant cwg...@gmail.com wrote:
 Hmmm... not even sure what a runner app is.  Do I buy this?  How is
 it integrated in to my app so that i can get a friends location?  It
 is ashame that Latitude for all its hype, is this hard to use and so
 unreliable.  Anyone else have ideas on the easiest and most reliable
 way to get a friends location?

 Thanks,

 Chris

 On Jan 16, 4:49 pm, Marcin Orlowski webnet.andr...@gmail.com wrote:



  On 16 January 2011 21:12, Chris Grant cwg...@gmail.com wrote:

   Does anyone out there have a snippet of code that shows how to do this
   in an Android app?  Or can you point me to a real example?

  Not the answer you expect, but IMHO dedicated runner apps would
  serve the purpose better and there're couple of such on Market.
  Latitude is not reliable (if you ask me) and you won't get as frequent
  reports as you may need.- Hide quoted text -

 - Show quoted text -

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


[android-developers] [Contacts]How to copy contacts in phone to another account ?

2011-01-16 Thread Shawn_Chiu
Hi, all
   I'm developing an android contacts sync application. It would
create a new account after successfully login. But there are multiple
accounts in an android phone, no contacts in this new account. If a
user wants to sync with server, he/she should copy contacts into the
funambol account in Contacts application, which make it very
inconvenient for users.
So I want to load contacts immediately after a funambol account is
created, or otherwise just sync with the originally phone account.
   Could anybody tell me how to achieve this?
Thanks.
BR
Shawn Chiu

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


[android-developers] Re: How to have your app overlayed on top of any other app?

2011-01-16 Thread pcm2a
Hopefully someone can hit us up with some open source examples.  This
would be amazing as an optional feature in application.  Just cause
some users would not want to use the option isn't a reason to never
have it!

On Jan 16, 8:48 pm, Hari Edo hari@gmail.com wrote:
 Another program called SoftKeys does this by way of a running
 Service.  It offers access to the usually-mandated hardware keys
 like MENU, BACK, HOME, SEARCH, even for those few oddball
 devices like NOOKcolor that do not include those keys.

 An IME keyboard is also a form of this kind of UI overlay that
 people see all the time.  I am just guessing, but any soft keyboard
 is likely another example of a service that spawns interface bits.

 However, I can see this sort of thing being more nuisance than
 godsend... one person's great uses is another person's clutter.

 On Jan 16, 9:34 pm, pcm2a reeeye...@gmail.com wrote:



  That subject may sound crazy and before today I thought it was
  impossible.  There is a free app called Super Manager on the market.
  This app gives you a little button to press that is overlayed
  everywhere.  No matter if you are on your home screen, gmail or the
  browser that icon is overlayed.

  Pressing the icon brings up the app interface which is a little box.
  This box is also overlayed on top of your already running application
  like dolphin.

  While the icon overlay or app overlay is on the screen you can still
  interact with the app you were running!

  How can I accomplish something like this in my code?  I can think of
  many great uses.- 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] DRM for Android

2011-01-16 Thread 苗忠良
Hi:
you can download source code, you will find android.drm.mobile1 in
framework, I need know that android.drm.mobile1 not exported in app level.

2010/12/14 Henry henry@zed.com

 Hi,

 We want to use DRM (very minimal, like forward lock) to protect media
 file, we are using Android 1.5, I cannot find any documentation or
 sample
 or header file for that, I see there are discussions about
 android.drm.mobile1,
 but cannot find any more details about it.


 If you have the knowledge about it, can you give me some help on
 that? like where to find the packagges/classes and how to use them?


 Thanks in advance.


 Henry



 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-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=en




-- 
/***/
苗忠良(Miao Zhong-liang)
MSN:mzl...@163.com msn%3amzl...@163.com
BLOG:http://miaozl.spaces.live.com
/***/

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

Re: [android-developers] Re: Mystery device missing style attributes?

2011-01-16 Thread Dianne Hackborn
Yeah the documentation is really sub-par on this area.  I want to write up
some more, but I've been wanting to do that for 2 years now. :/

On Sun, Jan 16, 2011 at 5:35 PM, Zsolt Vasvari zvasv...@gmail.com wrote:

 This is a bit off-topic, but perhaphs not so much:

 The single most confusing aspect of the Android platform, in my
 opinion, this whole business with Themes/Styles/Stylable/Attributes.
 Does anybody have a link to a good write-up on how this really works?
 I know it's in the docs, but I find it a bit hard to follow.



 On Jan 17, 4:39 am, Dianne Hackborn hack...@android.com wrote:
  textSize is not defined in the platform's base theme.
 
  These are the text size-related attributes in the theme:
 
 !-- Default appearance of text: color, typeface, size, and
  style. --
 
  attr name=textAppearance format=reference /
 
  !-- Default appearance of text against an inverted background:
 
   color, typeface, size, and style. --
 
  attr name=textAppearanceInverse format=reference /
 
  !-- Text color, typeface, size, and style for large text.
  Defaults to primary text color. --
 
  attr name=textAppearanceLarge format=reference /
 
  !-- Text color, typeface, size, and style for medium text.
  Defaults to primary text color. --
 
  attr name=textAppearanceMedium format=reference /
 
  !-- Text color, typeface, size, and style for small text.
  Defaults to secondary text color. --
 
  attr name=textAppearanceSmall format=reference /
 
  !-- Text color, typeface, size, and style for large inverse
 text.
  Defaults to primary inverse text color. --
 
  attr name=textAppearanceLargeInverse format=reference /
 
  !-- Text color, typeface, size, and style for medium inverse
  text. Defaults to primary inverse text color. --
 
  attr name=textAppearanceMediumInverse format=reference /
 
  !-- Text color, typeface, size, and style for small inverse
 text.
  Defaults to secondary inverse text color. --
 
  attr name=textAppearanceSmallInverse format=reference /
 
  So the textSize attribute is rarely set as part of the base platform,
 except
  inside of a TextAppearance style:
 
  http://developer.android.com/reference/android/R.styleable.html#TextA...
 
  So generally I wouldn't expect that code to work, unless textSize has
 been
  explicitly supplied by you in a theme.  Instead, you need to retrieve the
  resource of the TextAppearance size you want, and then can retrieve the
  textSize from that.
 
  That said, what *should* happen is you just get the default value you
 passed
  in, because the theme doesn't hold its own value.  You should never get a
  crash.  The obtainStyledAttributes() method is supposed to build an array
 of
  values that corresponds to the array you passed in to it.  So a crash
 like
  this is completely independent of whatever is defined in the theme, and
 just
  an outright bug in whatever platform code it is running on.
 
  Also your code has another issue where it is using array.getResourceId()
 --
  once you do get down to the TextAppearance, generally the values there
 are
  literals, not references to other resources.  So this also will always
 fail
  (it doesn't have a resource id), even if textSize does have a value,
 again
  resulting in you getting your default value.  You should just call
  getDimensionPixelSize() with the array offset at which you want to
 retrieve
  your value -- 0 in your case.
 
  Oh.
 
  That is probably the crash. :)  If for some reason there *is* some value
 for
  textSize, if getResourceId() returns non-0, then you will pass a value 
 0
  to getDimensionPixelSize(), which is outside the array you originally
 passed
  in.
 
 
 
 
 
  On Sun, Jan 16, 2011 at 9:24 AM, Brill Pappin br...@pappin.ca wrote:
   I'm getting this exception:
 
   java.lang.ArrayIndexOutOfBoundsException
   at
  
 android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:455)
 
   from this code:
 
   TypedArray array =
 context.getTheme().obtainStyledAttributes(style,
   new int[] { android.R.attr.textSize });
 
   int textSize = array.getDimensionPixelSize(array.getResourceId(0, 0),
   defValue);
 
   I'm expecting a standard value from the system since thats what I'm
 asking
   for.
 
   It actually works on all devices I can get my hands on and of course
 the
   error reporting doesn't tell me anything useful except a stack trace.
 
   Does anyone have a solution that might work instead of this one?
 
   Does anyone know what device this might be?
 
   I do know that it has to be a 2.2 device or better because I've made
 the
   minimum 2.2 (froyo)
 
   At the moment the only idea I can come up with is to simply send a
 static
   value, but I'm obviously going to have to guess what the device is.
 
--
   You received this message because you are subscribed to the Google
   Groups Android 

[android-developers] Re: Accessing Disk memroy from Application

2011-01-16 Thread Bob Kerns
On top of that, even applications with permission don't have control
to write into the same *physical* location, because of wear leveling.

Basically, every time you write to an flash memory card location, the
card actually places this data into a *different* physical location.
This is because writing the same location repeatedly will wear it
out.  So to try to make the entire thing wear out at the same time,
rather than one highly-used location wear out very early, the actual
data storage locations are moved around on the chips.

So: If you really care about erasing the data, what you want to do is
put it through your shredder, and then incinerate it.

For protection from more casual interlopers, just opening the file for
read/write, positioning to the front, and replacing all the data may
be adequate. If not, there really is very little middle ground. You
can write until you fill up the filesystem, repeatedly, and hope for
the best, or opt for physical destruction.

On Jan 14, 9:18 am, Dianne Hackborn hack...@android.com wrote:
 Fwiw, the limitation is not an issue of running in Dalvik vs. native code,
 but the permissions / uid an application is running as.  Third party apps
 can not run with permissions to be able to do this kind of stuff.

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


[android-developers] How to clear activity stack

2011-01-16 Thread Subba
My application has two activities A, B.

Initially application launches with A activity(root activity), and
then it launches the B activity and finishes A activity.  Now B
activity on the foreground.
User pressed Home Button on B activity it launches HOME Screen, user
launches the application it launches A activity(intentional) and on
the background B activity still there.
When user presses back (finish() method call) on A activity it goes to
B activity.
Is there any way to clear the activity stack trace when application
launches again i want to clear the B activity from activity stack if
it exists.

Any suggestions please...?

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


[android-developers] Re: Mystery device missing style attributes?

2011-01-16 Thread Streets Of Boston
Amen to that! :)
A How-To in this area would be very very welcome.

On Jan 16, 8:35 pm, Zsolt Vasvari zvasv...@gmail.com wrote:
 This is a bit off-topic, but perhaphs not so much:

 The single most confusing aspect of the Android platform, in my
 opinion, this whole business with Themes/Styles/Stylable/Attributes.
 Does anybody have a link to a good write-up on how this really works?
 I know it's in the docs, but I find it a bit hard to follow.

 On Jan 17, 4:39 am, Dianne Hackborn hack...@android.com wrote:



  textSize is not defined in the platform's base theme.

  These are the text size-related attributes in the theme:

             !-- Default appearance of text: color, typeface, size, and
  style. --

          attr name=textAppearance format=reference /

          !-- Default appearance of text against an inverted background:

               color, typeface, size, and style. --

          attr name=textAppearanceInverse format=reference /

          !-- Text color, typeface, size, and style for large text.
  Defaults to primary text color. --

          attr name=textAppearanceLarge format=reference /

          !-- Text color, typeface, size, and style for medium text.
  Defaults to primary text color. --

          attr name=textAppearanceMedium format=reference /

          !-- Text color, typeface, size, and style for small text.
  Defaults to secondary text color. --

          attr name=textAppearanceSmall format=reference /

          !-- Text color, typeface, size, and style for large inverse text.
  Defaults to primary inverse text color. --

          attr name=textAppearanceLargeInverse format=reference /

          !-- Text color, typeface, size, and style for medium inverse
  text. Defaults to primary inverse text color. --

          attr name=textAppearanceMediumInverse format=reference /

          !-- Text color, typeface, size, and style for small inverse text.
  Defaults to secondary inverse text color. --

          attr name=textAppearanceSmallInverse format=reference /

  So the textSize attribute is rarely set as part of the base platform, except
  inside of a TextAppearance style:

 http://developer.android.com/reference/android/R.styleable.html#TextA...

  So generally I wouldn't expect that code to work, unless textSize has been
  explicitly supplied by you in a theme.  Instead, you need to retrieve the
  resource of the TextAppearance size you want, and then can retrieve the
  textSize from that.

  That said, what *should* happen is you just get the default value you passed
  in, because the theme doesn't hold its own value.  You should never get a
  crash.  The obtainStyledAttributes() method is supposed to build an array of
  values that corresponds to the array you passed in to it.  So a crash like
  this is completely independent of whatever is defined in the theme, and just
  an outright bug in whatever platform code it is running on.

  Also your code has another issue where it is using array.getResourceId() --
  once you do get down to the TextAppearance, generally the values there are
  literals, not references to other resources.  So this also will always fail
  (it doesn't have a resource id), even if textSize does have a value, again
  resulting in you getting your default value.  You should just call
  getDimensionPixelSize() with the array offset at which you want to retrieve
  your value -- 0 in your case.

  Oh.

  That is probably the crash. :)  If for some reason there *is* some value for
  textSize, if getResourceId() returns non-0, then you will pass a value  0
  to getDimensionPixelSize(), which is outside the array you originally passed
  in.

  On Sun, Jan 16, 2011 at 9:24 AM, Brill Pappin br...@pappin.ca wrote:
   I'm getting this exception:

   java.lang.ArrayIndexOutOfBoundsException
   at
   android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:455)

   from this code:

                   TypedArray array = 
   context.getTheme().obtainStyledAttributes(style,
   new int[] { android.R.attr.textSize });

   int textSize = array.getDimensionPixelSize(array.getResourceId(0, 0),
   defValue);

   I'm expecting a standard value from the system since thats what I'm asking
   for.

   It actually works on all devices I can get my hands on and of course the
   error reporting doesn't tell me anything useful except a stack trace.

   Does anyone have a solution that might work instead of this one?

   Does anyone know what device this might be?

   I do know that it has to be a 2.2 device or better because I've made the
   minimum 2.2 (froyo)

   At the moment the only idea I can come up with is to simply send a static
   value, but I'm obviously going to have to guess what the device is.

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

[android-developers] Re: Compatibility across versions

2011-01-16 Thread kypriakos
I agree - in fact I added the last two versions in the Android SDK
installation and I am
working on testing the baseline on them. Thanks.

On Jan 15, 2:35 pm, TreKing treking...@gmail.com wrote:
 On Sat, Jan 15, 2011 at 11:50 AM, kypriakos demet...@ece.neu.edu wrote:
  Exactly - and we are not .. thanks.

 You should of course always to do sanity checks on each new version of the
 platform...

 -
 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


[android-developers] Progress Bar without a dialog box

2011-01-16 Thread cool.manish
Hi,

In my application, I am fetching data from server. During fetching
response and parsing it, I want to display a progress bar(Like
spinner) but without a dialog box.

If I am using ProgressDialog then it is also displaying Dialog box. I
had also tried Progress Bar but I have to include it in the XML. My
problem is this that I need to display progress bar in almost every
screen of my application and only at the time when I am fetching data
from the server. So I think, I shouldn't include it in XML of every
screen.

Please help me.

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

2011-01-16 Thread TreKing
On Sun, Jan 16, 2011 at 10:49 PM, cool.manish mannishga...@gmail.comwrote:

  I had also tried Progress Bar but I have to include it in the XML.


No you don't. Did you even try creating it programmatically?

-
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

Re: [android-developers] How to clear activity stack

2011-01-16 Thread TreKing
On Sun, Jan 16, 2011 at 10:06 PM, Subba raochoud...@gmail.com wrote:

 Is there any way to clear the activity stack trace when
 application launches again i want to clear the B activity from activity
 stack if it exists.

 Any suggestions please...?


Play with the activity launch flags defined in the Intent class.

-
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

[android-developers] Does Android provide API to enable my IME

2011-01-16 Thread xeagle
Hi,

I'd like my IME is enabled when settings of my IME is launched so that
user do not need go to Lanuage  Keyboard settings. Does Android
provide this kind of 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


[android-developers] SDK Samples - API Level 6 and below: Where to find them?

2011-01-16 Thread Zarah
Hi guys,

I need to take a look at some of the sample apps for SDK level 6 and
below, but they are not available from the SDK manager. I only see
samples for API levels 7, 8 and 9.  I don't see a link to the older
samples from the developer site either.

I am looking for older samples since I want to look at the original
Searchable Dictionary code.  From the developer site:

Note: For the original version of Searchable Dictionary, which reads
words from a file instead of a database and uses a custom BaseAdapter,
see the SDK samples included with the platforms for API Level 4-6.

Does anyone know where I can find the original sample code?

Thanks as always!


Best regards,
Zarah.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] SDK Samples - API Level 6 and below: Where to find them?

2011-01-16 Thread Xavier Ducrohet
older samples are inside the platform component. We started separating
them in their own component in api 7.

On Sun, Jan 16, 2011 at 9:11 PM, Zarah zarahj...@gmail.com wrote:
 Hi guys,

 I need to take a look at some of the sample apps for SDK level 6 and
 below, but they are not available from the SDK manager. I only see
 samples for API levels 7, 8 and 9.  I don't see a link to the older
 samples from the developer site either.

 I am looking for older samples since I want to look at the original
 Searchable Dictionary code.  From the developer site:

 Note: For the original version of Searchable Dictionary, which reads
 words from a file instead of a database and uses a custom BaseAdapter,
 see the SDK samples included with the platforms for API Level 4-6.

 Does anyone know where I can find the original sample code?

 Thanks as always!


 Best regards,
 Zarah.

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




-- 
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

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


Re: [android-developers] Re: Tracking someone else using Latitude (Android Tutorial Wanted)

2011-01-16 Thread Kevin Duffey
I was going to suggest My Tracks as well. But I think what the OP wants is
the ability for his wife's phone to update his phone on her progress. I
would guess it's possible, but you'd have two components to the app. The app
that runs on her phone that updates some service of her progress.. maybe
using GPS location every 5 seconds or something (not sure the precision of
GPS info.. anyone know how often it updates?). The second piece would either
be a web service or a SMS listener app on the 2nd phone that would get
updates. If it was solely to be to track one phone from another, probably
have the phone to be tracked send updates out via SMS to the 2nd phone,
which..I think in 2.1. maybe 2.2, added the ability to have SMS listeners or
something like that..

Latitude I think has 15 minute updates. There is the option to turn on
real-time updates for a set amount of time, but this has never worked for
me. I've done this with my wife's phone, and I still seem to only get
updates every 10 or 15 minutes. I think for road trips, and finding a phone
or seeing where your wife is.. it's fine. But using it for real-time updates
is not. You're going to be better off writing an app that continually grabs
GPS info and sends that data somewhere.

Incidentally.. this is an excellent way to keep tabs on someone. ;)


On Sun, Jan 16, 2011 at 7:04 PM, Zsolt Vasvari zvasv...@gmail.com wrote:

 Try the free open-source Google app called My Tracks.  I've used it
 before and it's good.

 On Jan 17, 9:37 am, Chris Grant cwg...@gmail.com wrote:
  Hmmm... not even sure what a runner app is.  Do I buy this?  How is
  it integrated in to my app so that i can get a friends location?  It
  is ashame that Latitude for all its hype, is this hard to use and so
  unreliable.  Anyone else have ideas on the easiest and most reliable
  way to get a friends location?
 
  Thanks,
 
  Chris
 
  On Jan 16, 4:49 pm, Marcin Orlowski webnet.andr...@gmail.com wrote:
 
 
 
   On 16 January 2011 21:12, Chris Grant cwg...@gmail.com wrote:
 
Does anyone out there have a snippet of code that shows how to do
 this
in an Android app?  Or can you point me to a real example?
 
   Not the answer you expect, but IMHO dedicated runner apps would
   serve the purpose better and there're couple of such on Market.
   Latitude is not reliable (if you ask me) and you won't get as frequent
   reports as you may need.- 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


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

[android-developers] Re: REQUEST

2011-01-16 Thread metal mikey
On Jan 15, 12:12 pm, TreKing treking...@gmail.com wrote:
 On Fri, Jan 7, 2011 at 2:21 AM, Harshit Agrawal 
 soft.ready@gmail.comwrote:

  Please send me the complete code

 HELLO SIR/MADAM

 Please do your own damn work.

 WITH REGARDS:
 TreKing Developer

LOL. Alternatively you could post on freelancer.com to have some poor
soul do hundreds of dollars worth of work for you for the audacious
price of $30!

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


[android-developers] Re: SDK Samples - API Level 6 and below: Where to find them?

2011-01-16 Thread Zarah
Thanks for the quick reply Xavier! :)



On Jan 17, 1:40 pm, Xavier Ducrohet x...@android.com wrote:
 older samples are inside the platform component. We started separating
 them in their own component in api 7.









 On Sun, Jan 16, 2011 at 9:11 PM, Zarah zarahj...@gmail.com wrote:
  Hi guys,

  I need to take a look at some of the sample apps for SDK level 6 and
  below, but they are not available from the SDK manager. I only see
  samples for API levels 7, 8 and 9.  I don't see a link to the older
  samples from the developer site either.

  I am looking for older samples since I want to look at the original
  Searchable Dictionary code.  From the developer site:

  Note: For the original version of Searchable Dictionary, which reads
  words from a file instead of a database and uses a custom BaseAdapter,
  see the SDK samples included with the platforms for API Level 4-6.

  Does anyone know where I can find the original sample code?

  Thanks as always!

  Best regards,
  Zarah.

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

 --
 Xavier Ducrohet
 Android SDK Tech Lead
 Google Inc.http://developer.android.com|http://tools.android.com

 Please do not send me questions directly. Thanks!

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


[android-developers] Re: Anyone know how to calculate speed WITHOUT GPS?

2011-01-16 Thread metal mikey
Will this still work as the car approaches and quite potentially
breaches the speed of sound???

On Jan 15, 4:59 am, DanH danhi...@ieee.org wrote:
 It only takes one phone:  You have the phone generate a tone and
 detect the shifted tone off of whatever object reflects it, like
 radar.  ;)

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

2011-01-16 Thread Kumar Bibek
In that case, it's an obvious NO. Then, you probably have to rely on the
camera's flash, and it's Doppler shift.

Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com



On Mon, Jan 17, 2011 at 11:35 AM, metal mikey coref...@gmail.com wrote:

 Will this still work as the car approaches and quite potentially
 breaches the speed of sound???

 On Jan 15, 4:59 am, DanH danhi...@ieee.org wrote:
  It only takes one phone:  You have the phone generate a tone and
  detect the shifted tone off of whatever object reflects it, like
  radar.  ;)

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-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=en

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

Re: [android-developers] Re: Anyone know how to calculate speed WITHOUT GPS?

2011-01-16 Thread Kumar Bibek
Ah, I forgot, the phones don't yet have a light sensor. Too bad..


Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com



On Mon, Jan 17, 2011 at 11:44 AM, Kumar Bibek coomar@gmail.com wrote:

 In that case, it's an obvious NO. Then, you probably have to rely on the
 camera's flash, and it's Doppler shift.

 Kumar Bibek
 http://techdroid.kbeanie.com
 http://www.kbeanie.com




 On Mon, Jan 17, 2011 at 11:35 AM, metal mikey coref...@gmail.com wrote:

 Will this still work as the car approaches and quite potentially
 breaches the speed of sound???

 On Jan 15, 4:59 am, DanH danhi...@ieee.org wrote:
  It only takes one phone:  You have the phone generate a tone and
  detect the shifted tone off of whatever object reflects it, like
  radar.  ;)

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-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=en




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

[android-developers] Re: How to clear activity stack

2011-01-16 Thread Doug
On Jan 16, 8:06 pm, Subba raochoud...@gmail.com wrote:
 My application has two activities A, B.

 Initially application launches with A activity(root activity), and
 then it launches the B activity and finishes A activity.  Now B
 activity on the foreground.
 User pressed Home Button on B activity it launches HOME Screen, user
 launches the application it launches A activity(intentional) and on
 the background B activity still there.
 When user presses back (finish() method call) on A activity it goes to
 B activity.
 Is there any way to clear the activity stack trace when application
 launches again i want to clear the B activity from activity stack if
 it exists.

 Any suggestions please...?

http://developer.android.com/guide/topics/fundamentals.html#clearstack

Memorize this document or revisit it regularly.

Doug

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


[android-developers] Re: Anyone know how to calculate speed WITHOUT GPS?

2011-01-16 Thread ko5tik


On Jan 12, 7:16 am, keyboardr keyboa...@gmail.com wrote:
 You could also try integrating the readings from the accelerometers,
 but I suspect this would give you even worse accuracy and you'd have
 to have some way to calibrate the zero point.

INS also requires gyroscopes.  But quality of those sensors lies far
below ones utilised
in  ICBMs in 60s

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


[android-developers] Re: XML layout vs. programmatic

2011-01-16 Thread MerlinBG
I think this the XML layout is introduced mostly in order to facilitate GUI 
generators, like
http://droiddraw.org/

If they generate Java, which is editable for the developers, switching 
between code and modeling becomes rather error-prone.
The good thing is that you are not bound to it, you can go ahead and use 
Java-coded layouts only, If you prefer :)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Version code being displayed instead of Version Name in Samsung Galaxy S - GT I9000 device?

2011-01-16 Thread javame_android
Hi,

I do not know what is the reason of this but I just installed one
Android app in Samsung Galaxy S - GT I9000 device and its displaying
Version code in App info screen. Whereas the Nexus One is displaying
the proper Version Name and not Version code.

Has anyone faced a similar issue and is there any solution to this?


Regards
Sunil

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


[android-developers] How to have a Service, un-killed by any task killer

2011-01-16 Thread Jawwad Farooq
Hi,

I want to have a service that will not be killed by any task killer.
Can you please give some code snippet for that




Regards,


Jawwad Farooq

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

2011-01-16 Thread JPS
Hello all,

I want to make an application with tabbed panes, with different views
in each pane. I would like to know if there is a standard component/
way for doing this.

An example of what I'm trying to do is the engadget android app.
Screen shot :
http://www.eurodroid.com/pics/engadget_updates_android_app_1.png

Any help to analyse how they are doing this will be greatly
appreciated.

Thx!

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


[android-developers] GPS turned on automatically on some devices?

2011-01-16 Thread Stephan Wiesner
Hi,
my HTC users keep complaining that i don't turn off the GPS when they exit
my Google Maps app. The emulator shows the GPS symbol when I start my app,
but none of my test devices do (Samsung Galaxy S, SE Xperia Mini Pro).
I don't turn on the gps in the first place. And understood that I am not
allowed to do it, even if i wanted to.

Here is my code:
onCreate:
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
bestProvider = locationManager.getBestProvider(criteria, false);

and
protected void onPause() {
super.onPause();
locationManager.removeUpdates(this);

and
@Override
protected void onResume() {
super.onResume();
locationManager.requestLocationUpdates(bestProvider, 1, 10, this);

Anybody knows if HTC turns on GPS by default?

Greetings from foggy Zurich,
Stephan Wiesner

-- 
Interessiert an Android?
http://android-schweiz.blogspot.com/
Whant to learn German?
http://german-podcast.blogspot.com

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

[android-developers] about KeyStore

2011-01-16 Thread tangke
hi all, I want to use the keystore to fix issue of the install package.

but I read the source code, that I can not found the source code of
KeyStore.PrivateKeyEntry ??

but I read the api/xml file and can get the information of
KeyStore.PrivateKeyEntry.


thanks in advance.

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


[android-developers] Re: disable hard Search button while contextmenu is on.

2011-01-16 Thread TreKing
On Mon, Jan 17, 2011 at 12:43 AM, Amritesh amriteshmad...@gmail.com wrote:

 Thanks for replying

 Because that is the requirement of the UI spec of my project  i
 have done similar thing on dialog box and progress dialog ...
 but not able to find a way for context menu ... is there any way of
 doing that ..

 Thanks
 Amritesh


Please reply to the whole group.

I don't think you can control the Context Menu beyond populating and showing
it. Consider changing your requirements or implement your own context menu.

-
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

Re: [android-developers] How to have a Service, un-killed by any task killer

2011-01-16 Thread TreKing
On Mon, Jan 17, 2011 at 1:04 AM, Jawwad Farooq jawwad.far...@gmail.comwrote:

 I want to have a service that will not be killed by any task killer.


Don't we all.


  Can you please give some code snippet for that


No.

-
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

Re: [android-developers] [beginner] Analysis of the engadget app

2011-01-16 Thread TreKing
On Mon, Jan 17, 2011 at 1:17 AM, JPS jpsa...@gmail.com wrote:

 I want to make an application with tabbed panes, with different views
 in each pane. I would like to know if there is a standard component/ way
 for doing this.


Standard way of doing tabs would be TabActivity and TabView. Though I doubt
that's what's being used in the picture, by the looks of it.


 Any help to analyse how they are doing this will be greatly appreciated.


Looks simply like a LinearLayout with a single row of buttons. Clicking on a
given button changes the main view. This should be incredibly easy to layout
and code up.

-
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

Re: [android-developers] about KeyStore

2011-01-16 Thread TreKing
I'm sorry but your post makes no sense.

-
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

[android-developers] Re: [beginner] Analysis of the engadget app

2011-01-16 Thread Zsolt Vasvari
Another guy who wants to code an iPhone copy app on Android :(

On Jan 17, 3:46 pm, TreKing treking...@gmail.com wrote:
 On Mon, Jan 17, 2011 at 1:17 AM, JPS jpsa...@gmail.com wrote:
  I want to make an application with tabbed panes, with different views
  in each pane. I would like to know if there is a standard component/ way
  for doing this.

 Standard way of doing tabs would be TabActivity and TabView. Though I doubt
 that's what's being used in the picture, by the looks of it.

  Any help to analyse how they are doing this will be greatly appreciated.

 Looks simply like a LinearLayout with a single row of buttons. Clicking on a
 given button changes the main view. This should be incredibly easy to layout
 and code up.

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