Re: [android-developers] Save ListView items for next time

2009-12-11 Thread sathya subbiah
Try using a data base for storing the data and update the list from the
database table.

On Fri, Dec 11, 2009 at 1:39 AM, Abhi abhishek.r.sha...@gmail.com wrote:

 Hi,

 My problem sounds pretty easy to solve... not getting any right
 direction.

 My app starts with a blank listview with a Menu option to Add contacts
 to the ListView. Now, I want that my ListView gets saved every time I
 quit my App so that the next time I start my App, I see all the
 contacts from last time.

 I understand that Android lets you store and retrieve data. Just don't
 know how to move forward from here.

 Any help in the right direction would be appreciated.

 Thanks,

 Abhishek

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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] DynamicLayout and StringBuilder

2009-12-11 Thread Michael Scott
Hi,

I am writing a custom View that uses a DynamicLayout to write text on
the screen. The DynamicLayout is constructed with a StringBuilder that
I use to change the text. This works fine, but my problem is that when
I add linebreaks to the string, sb.append(\n), they show up as
squares on the screen and no linebreaking is done... Does anyone have
an idea what I may miss here?

/Michael

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


[android-developers] Re: restricting edittext control's max chars

2009-12-11 Thread Nithin

try setFilters()..

Thanks

On Dec 11, 10:28 am, Jags jag...@gmail.com wrote:
 nobody has tried this before ?

 On Nov 26, 9:39 pm, Jags jag...@gmail.com wrote:

  I need to restrict edittext's max chars to 255, how can i do that in
  layout or functions ?

  regardsJagat

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

2009-12-11 Thread Nithin
check this,

http://smartandroidians.blogspot.com/2009/11/creating-edittext-programmatically-in.html

On Dec 11, 2:16 pm, Nithin nithin.war...@gmail.com wrote:
 try setFilters()..

 Thanks

 On Dec 11, 10:28 am, Jags jag...@gmail.com wrote:

  nobody has tried this before ?

  On Nov 26, 9:39 pm, Jags jag...@gmail.com wrote:

   I need to restrict edittext's max chars to 255, how can i do that in
   layout or functions ?

   regardsJagat

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


[android-developers] [Android Dev Phone 1] How to select/install a locale other than English ?

2009-12-11 Thread Syl
My application has resources files in English and French and works on
Android 1.5 and .


Inside the emulator, in Settings  Locale  Text  Select Locale, I
can choose English or French. This updates the language of my
application.

However, when I use the Android Dev Phone 1, only English is available
in the Select Locale screen...


Is it possible to install french locale on Android Dev Phone 1 ?
If so, how can I do this ?

Thanks for your help !

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


[android-developers] Re: noHistory=true rocks

2009-12-11 Thread Samuh
Dianne,

Firstly, many thanks for your reply!

 (1) This is a debugging feature, not something to turn on for normal
 production.
I understand this.

 (2) It doesn't finish the activity; it destroys the current instance, which
 will thus needed to be re-instantiated the next time the user navigates to
 it (thus providing a way to test the state save/restore mechanism of
 activities).
thank you for pointing out the difference; I probably was expecting
finishing the activity and destroying the instance to mean the
same thing.

 (3) There isn't a taboo about actually finishing an activity when it becomes
 invisible...  if that is the user interaction you want, go for it I guess,
 though it might be a bit weird.  (But finishing an activity after starting
 another one, effectively making it disappear after the user leaves it, is a
 very common and useful pattern.)
I believe you :)

 No users should EVER have this turned on.  And I believe this is an
 unprotected system setting so it would be possible for an application to
 turn it on...  but dear ghod do not do that, and the instance we hear about
 any app doing that we will need to do something to prevent it.  This is not
 at all, ever, ever, something you should be running a device with for normal
 usage.
thanks for the warning;

cheers!

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


[android-developers] Re: Use Camera API for normal quality pictures

2009-12-11 Thread benbenbenben
Mark, thanks for the link! I hope the problem ( one single line :S )
will be solved in 2.0

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

2009-12-11 Thread hongki park
thank you
it is a good informations

2009/12/11 Nithin nithin.war...@gmail.com

 check this,


 http://smartandroidians.blogspot.com/2009/11/creating-edittext-programmatically-in.html

 On Dec 11, 2:16 pm, Nithin nithin.war...@gmail.com wrote:
  try setFilters()..
 
  Thanks
 
  On Dec 11, 10:28 am, Jags jag...@gmail.com wrote:
 
   nobody has tried this before ?
 
   On Nov 26, 9:39 pm, Jags jag...@gmail.com wrote:
 
I need to restrict edittext's max chars to 255, how can i do that in
layout or functions ?
 
regardsJagat

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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] Please help me

2009-12-11 Thread IPEG Student
Hello,

I want to capture the phone number of any android device. am using this code

 TelephonyManager mTelephonyMgr =
 (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

  sim = mTelephonyMgr.getLine1Number();

in emulator it returns a value. But when i check in real device it returns
nothing. So please give me the perfect code by which i can
capture the phone number of a real device.

Thanks,

Suman Ganguly.

(Android Developer)

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

2009-12-11 Thread ydario
Hi,


 When you navigate to Contacts-[menu]-Accounts-AddAccount or
 Settings-Accounts  sync-Add Account does your custom account type
 appear?  If not, this is probably your next milestone.  I achieved
 this by reading the code in packages/apps/Email/, which is a far cry

thanks for pointer.

But here gets my question: if I add an authenticator, the phone will
end having at least two of them, mine and google one.
Will I be able to access also google contacts?
after looking at rawcontacts fields, it seems to me that every account
is tied to one authenticator, so I will not have access to standard
contacts.

What is your experience regard this?

ciao,

Yuri

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

2009-12-11 Thread Kaj Bjurman
Hi,

I have code that is reading data from a website, the website that I'm
reading data from is at times a bit slows, so I want to use
setConnectTimeout on the URLconnection that I'm using.

The problem is that it looks like the value is ignored, or that it
doesn't work. I have set the setConnectTimeout to 30 seconds (i.e.
3 as value since the javadoc says that the argument is in ms).

I then call connect, and I have through my logs seen that the code can
get blocked in the connect call for several hours (in Android 1.6,
don't know about the other versions).

Has anyone else seen this problem? What to do about it? I don't see
how I would create a workaround since I don't have anything that I can
invoke close on (I would create a separate thread that invoked close
on the stream/socket after a certain time if the problem was related
to slow reading)

Thanks
Kaj


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

2009-12-11 Thread Jack Ganesh
Some one help me !  !  !




On Dec 10, 4:52 pm, Jack Ganesh ganesh...@gmail.com wrote:
 No one knows ?
 Any suggestions are appriciated.

 Cheers,
 Ganesh..,

 On Dec 10, 3:09 pm, Jack Ganesh ganesh...@gmail.com wrote:



  Hi All,
    I added and displayed set of images in mygallery. I made like at a
  time use can view three images.

  Now I want to do different Animation for these images. I used
  following snippet but its refreshing entireGallery.
  @
                 gallery.setGravity(10);
                 gallery.setAnimationDuration(1000);
                 gallery.setSelection(position, true);
                 gallery.setFadingEdgeLength(100);
                 gallery.startAnimation(mGallaryAnim);
                 gallery.setCallbackDuringFling(false);
  @@@
  Try to help me. I need to complete this soon.- 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: I can't launch layoutopt(using Window7)

2009-12-11 Thread Chris
Did you perform this step:
Windows users: to start layoutopt, open the file called layoutopt.bat
in the tools directory of the SDK and on the last line, replace
%jarpath% with -jar %jarpath%.

On Dec 11, 1:56 am, lch1721 lch1...@gmail.com wrote:
 I saw the blog, and try to launch 
 layoutopt.http://android-developers.blogspot.com/2009/11/optimize-your-layouts

 But, it occur error message below

 D:\android-sdk-windows\toolslayoutopt.bat d:\eclipse\worksp
 ace\project\res\layout
 Exception in thread main java.lang.NoClassDefFoundError: lib
 \layoutopt/jar
 Caused by: java.lang.ClassNotFoundException: lib\layoutopt.jar
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
 Could not find the main class: lib\layoutopt.jar.  Program will exit.

 So, I change path and launch directly layoutopt.jar.
 but, it dosen't work

 What I change environment to launch layoutopt?

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

2009-12-11 Thread Atif Gulzar
Is it possible to use standard views inside your custom defined views. e.g.
use ImageView in my class that is extended form View ?

Or is it possible to use one custom view inside another custom view?
Actually I have animations defined in xml view which I want to apply on some
of the images. But predefined animations can only be applied to views.


The scenario is,  I want to animate (rotating, glowing, etc ) some of the
chips  on a board. User can also drag these chips through touch events. And
I do not want to refresh my complete board just to rotate few chips on it.
All my animations are defined in xml files. Looking for some pointers.
Thanks



--
Best Regards,
Atif Gulzar

I  Unicode, ɹɐzlnƃ ɟıʇɐ

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

2009-12-11 Thread Maxood
Does Android  support flash? If yes then i need an example code to
play a flash file. Wonder if we can play a flash file in WebView?

Waiting for reply

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

2009-12-11 Thread swapnil kamble
I am also looking for using custom keystore, do you know how generate and
store cert and priv key in keystore programmatically ?

On Thu, Dec 10, 2009 at 4:12 PM, droidsan droid...@googlemail.com wrote:

 Hello,

 Trying to set up a secure connection via SSL I get a SSL handshake
 failure when the server requests the client certificate. The code
 excerpt shown below (basically Apache's ClientCustomSSL.java example
 extended to use custom keystore for client cert and to support BKS
 keystores) works on my desktop PC but throws a handshake failure in
 Android simulator. Is this a bug, do I miss to add something Android
 specific or is it just a permission problem?

 Setup on PC: OS: openSuse 11.1, Java: SUN 1.6.0_17, openssl: 0.9.8h
 Android SDK platform: 1.5_r3 revision 3
 
 DefaultHttpClient httpclient = new DefaultHttpClient();

 // [ ... ] lines for key- and truststore initialization omitted

 SSLSocketFactory socketFactory = new SSLSocketFactory(keyStore,
 keyStorePassword ,trustStore);

 Scheme sch = new Scheme(https, socketFactory, 4433);
 httpclient.getConnectionManager().getSchemeRegistry().register(sch);

 HttpGet httpget = new HttpGet(https://192.168.0.63:4433;);

 System.out.println(executing request + httpget.getRequestLine());

 // SSL handshake failure when executing next line
 HttpResponse response = httpclient.execute(httpget);

 // [...] Remaining code omitted
 _
 Logcat:
 W/System.err( 1313): java.io.IOException: SSL handshake failure:
 Failure in SSL library, usually a protocol error
 W/System.err( 1313): error:14094410:SSL routines:SSL3_READ_BYTES:sslv3
 alert handshake failure (external/openssl/ssl/s3_pkt.c:1053
 0x2911c0:0x0003)
 _
 Server (openssl s_server [...] -Verify 1
 21435:error:140890C7:SSL routines:SSL3_GET_CLIENT_CERTIFICATE:peer did
 not return a certificate:s3_srvr.c:2514:
 _

 Thanks for you help

 Alex



 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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




-- 
...Swapnil

|| Hare Krishna Hare Krishna Krishna Krishna Hare Hare ||
|| Hare RamaHare Rama   Rama   RamaHare Hare ||

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

2009-12-11 Thread Taf
Hi,

I'm trying to apply an Alpha gradient to a bitmap that I've created
from a PNG. I want the image to be opaque at the top and fade to
transparent at the bottom. I know this can be done be using getPixels
and setPixels for Bitmap and iterating through each row of pixels in
the Bitmap and setting the alpha values accordingly, but i was hoping
there was a slightly neater way of doing this. I have been looking at
the LinearGradient Class and using a Porter Duff transfer mode, but i
don't seem to be having much luck with this. It seems that my source
image is lost when i apply the Shader to the drawable.

Anyone have any tips on how i might apply an alpha gradient to a
bitmap?

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

2009-12-11 Thread Lee
The most elegant solution for the receiver-service dilemma I've seen
is to use this code in the (standard) service:

public static void lockAndStartService( Context context, Intent
intent ) {
synchronized ( startServiceLock ) {
 MyWakeLockManager.acquirePartial( context, TAG );
 context.startService( intent );
}
}

Call it from onReceive(). Use MyWakeLockManager to store/synchronize/
debug the WakeLock manipulations coming from different points in your
code.

Works well for me, anyway.

The idea came from the SMSPopup code, thanks to the author.

Lee

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

2009-12-11 Thread bestpriv...@googlemail.com
I have problems to start debugging on my new Acer Liquid.
Windows XP SP3 always tells me that it cannot find any drivers for the
Acer HSUSB Device.
I already installed the latest usb drivers (Revision 2, November 2009)
using the SDK Manager.
Do I have to wait for a new revision?
Does somebody else have this problem?

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

2009-12-11 Thread Ecthelion
Hi Matt,

you could try explicitly freeing the resources your bitmaps use by
invoking Bitmap.recycle(). The description of this method reads

Free up the memory associated with this bitmap's pixels, and mark the
bitmap as dead, meaning it will throw an exception if getPixels() or
setPixels() is called, and will draw nothing. This operation cannot be
reversed, so it should only be called if you are sure there are no
further uses for the bitmap. This is an advanced call, and normally
need not be called, since the normal GC process will free up this
memory when there are no more references to this bitmap.

I found it quite useful when I ran into a similar issue.

On 25 Nov., 18:37, Matt Kanninen mathias...@gmail.com wrote:

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: awakenScrollBars() not showing scrollBar in custom View

2009-12-11 Thread Nithin
Hi Romain Guy,

I want auto-fading scroll bar. How to do that ?. Or at the least, I
want to show scroll bar in my custom view. How to do using compute*()
methods. My custom view is scrolling, but I want to show the scroll
bar. I also find a link from you,

http://markmail.org/thread/n7wv2rvgre3talba

but not getting the proper way. Just give some idea to start. Any help
is appreciated

Thanks


On Dec 2, 10:39 pm, Romain Guy romain...@android.com wrote:
 awakenScrollbars() is used only when you have auto-fading scrollbars.
 To show scrollbars in a custom view you also need to implement the
 various compute*() methods, for instance computeVerticalScrollRange().
 The javadocs explains what these methods are for.



 On Wed, Dec 2, 2009 at 4:04 AM, Nithin nithin.war...@gmail.com wrote:
  Hi,

  I have a custom view. I am scrolling the view vertically using scrollTo
  (int, int). But the scrollbar is not showing when scrolling. I tried
  awakenScrollBars(). But its not drawing the scrollbar. I also put
  setVerticalScrollBarEnabled(true). Whether I am missing something
  here ?

  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

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

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

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


[android-developers] Re: AnimationDrawable and Out of Memory Errors

2009-12-11 Thread Mark Hansen
So I did get the crashes to stop, and I have a idea of why it works...
anyways.. I updated the onWindowFocusChange set the backGroundDrawable
to null when the app loses focus.  I also do this on the onDestroy()
and onPause() methods as well.

My guess is that the app goes into pause mode and when restarted since
I was reattaching the same animation to the ImageView it was causing a
leak.

Note this ImageView and Animation were not static variables they were
loaded only on the onWindowFocusChange event.  I made the assumption
since I was not letting my ImageView and Animation be created as
static variables I wouldn't leak the Context, but apparently the
recreation of the animation attachment to the ImageView was for some
reason, this I'm not 100% sure on, but it seems to be the case.


On Dec 10, 7:53 pm, Romain Guy romain...@android.com wrote:
 DDMS has a feature to dump the Java heap. You can then analyze is
 using tools like hat, MAT, JProfiler, etc.



 On Thu, Dec 10, 2009 at 4:17 PM, Matt Kanninen mathias...@gmail.com wrote:
  Got any advice on tools to use to debug the most likely situation
  you've described?  I'm at the point where I've ruled out static
  variables.

  I'm working on code that started with Android 1.0, and has had a
  series of developers since.  Good code analysis tools could help
  immensely.  It beats re writing every class.

  On Dec 10, 3:47 pm, Romain Guy romain...@android.com wrote:
  If there's an OutOfMemoryError, it's most likely that the app is using
  too much memory and/or leaking. Filing a bug won't help.

  On Thu, Dec 10, 2009 at 3:43 PM, Matt Kanninen mathias...@gmail.com 
  wrote:
   Best of luck.  I recommend you create a very small test application to
   reproduce the bug, and submit it to b.android.com.

   On Dec 10, 12:52 pm, Mark Hansen stonedon...@gmail.com wrote:
   So I want to start an animation when my application starts that always
   visible in the application.  So reading about the AnimationDrawable it
   was stated to use onWindowFocusChanged instead of onCreate() to ensure
   that animation would start properly in the UI thread.

           @Override
           public void onWindowFocusChanged(boolean hasFocus) {
                   super.onWindowFocusChanged(hasFocus);

                   AnimationDrawable cam;
                   ImageView iv = 
   (ImageView)findViewById(R.id.ImageViewFuzzAnimation);
                   iv.setBackgroundResource(R.anim.fuzz_animation);
                   cam = (AnimationDrawable)iv.getBackground();
                   cam.start();

           }

   This works fine, but if I leave my application and come back I get a
   out of memory error, below is the log..

   Can anyone help me out on what I may be doing wrong here?

   12-10 15:52:14.365: ERROR/dalvikvm-heap(3102): 805600-byte external
   allocation too large for this process.
   12-10 15:52:14.373: ERROR/(3102): VM won't let us allocate 805600
   bytes
   12-10 15:52:14.373: DEBUG/skia(3102): --- decoder-decode returned
   false
   12-10 15:52:16.490: DEBUG/dalvikvm(1570): GC freed 797 objects / 43592
   bytes in 94ms
   12-10 15:52:20.147: DEBUG/AndroidRuntime(3102): Shutting down VM

   12-10 15:52:20.147: ERROR/AndroidRuntime(3102): Uncaught handler:
   thread main exiting due to uncaught exception
   12-10 15:52:20.232: ERROR/AndroidRuntime(3102):
   java.lang.OutOfMemoryError: bitmap size exceeds VM budget
   12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
   android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
   12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
   android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:447)
   12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
   android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:
   323)
   12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
   android.graphics.drawable.Drawable.createFromResourceStream
   (Drawable.java:697)
   12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
   android.content.res.Resources.loadDrawable(Resources.java:1705)
   12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
   android.content.res.Resources.getDrawable(Resources.java:580)
   12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
   android.graphics.drawable.AnimationDrawable.inflate
   (AnimationDrawable.java:265)
   12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
   android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:
   788)
   12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
   android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
   12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
   android.content.res.Resources.loadDrawable(Resources.java:1690)
   12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
   android.content.res.Resources.getDrawable(Resources.java:580)
   12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
   android.view.View.setBackgroundResource(View.java:7187)
   12-10 

[android-developers] Applying effects to camera viewfinder

2009-12-11 Thread Will
I want to make a motion-jpeg.

This is not a video format that is supported by the built-in codecs.

One approach I've looked at is to use the preview callback, asking for
a JPEG buffer.  Unfortunately, the HTC phones I've tried this on all
call back at several second intervals and give me an NV12 buffer
regardless of the pixel format you specify.  (Anyone know the
behaviour on a droid?)  I can code my way around the NV12 hassle but I
can't exactly do much when the callbacks are so seldom; I want around
10 fps.

The approach I was considering was making an opencore codec for
mjpeg.  Which leads me to two questions before I start:

1) can third-parties make and install opencore codecs, or is this
strictly locked down?  Is it to just drop an .so in the right folder,
or?

2) do the HTC phones use the default encoders?  (i.e. will using the
same way the default opencore reference codecs get their pixel buffers
work on the phone?)

thx
Will

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Accessing Droid Moto Corporate Calendar database for my widget

2009-12-11 Thread Mike
Hi Dianne,
I realize this definitely, but for now am willing to take the risk and
adjust later, much like we have to do when each new Android release
comes out.

Thanks!
Mike

On Dec 10, 6:06 pm, Dianne Hackborn hack...@android.com wrote:
 Anyone who does try to do this will most likely break in the future.  There
 is no published API for this, and I think we can imagine that a future
 version of the platform may want to integrate exchange calendar with the
 standard calendar, just like 2.0 introduces for contacts.



 On Thu, Dec 10, 2009 at 8:37 AM, Mike mikehoepfin...@comcast.net wrote:
  Hi,
  I'm looking for a way to access the Corporate Calendar information/
  database on the Droid. I know it can be done since I have seen a few
  folks promote supporting being able to read this information, but have
  found zero info on it.

  Does anyone have any pointers on how to read this?

  Thanks!
  Mike

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  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: Debugging on Acer Liquid

2009-12-11 Thread bestpriv...@googlemail.com
Okay, I got it working this way:

1. get the latest usb updates

2. modify your android_winusb.inf file by adding these three lines to
[Google.NTx86] and [Google.NTamd64]:
; Acer Liquid
%SingleAdbInterface%= USB_Install, USB\VID_0502PID_3202
%CompositeAdbInterface% = USB_Install, USB\VID_0502PID_3202MI_01

3. if windows aks you for a driver, select manual, choose ADB
Interface and point to the android_winusb.inf file

4. start Eclipse and you should be able to debug on your Acer
Liquid :-)

Unfortunately logcat seems to report Invalid Argument within Eclipse
only.
However, these commands should do it for a while:
adb logcat -c
adb -d logcat

Maybe somebody else can help out to make logcat work within Eclipse?
Still I hope that Google and device manufacturers will provide better
support in the future.
I heared a lot of developers having trouble with on-device-debugging
(e.g. Samsung Galaxy).
We have better stuff to ... :-)


On 11 Dez., 13:55, bestpriv...@googlemail.com
bestpriv...@googlemail.com wrote:
 I have problems to start debugging on my new Acer Liquid.
 Windows XP SP3 always tells me that it cannot find any drivers for the
 Acer HSUSB Device.
 I already installed the latest usb drivers (Revision 2, November 2009)
 using the SDK Manager.
 Do I have to wait for a new revision?
 Does somebody else have this problem?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] GK: How to recognize Left touch dragging and Right touch dragging(Scrolling) in Android?

2009-12-11 Thread Jack Ganesh
Hi All,
  I displayed set of images inside the Gallery. By default it has
scrolling.

But I don’t want this way of scrolling. So I implemented
“OnTouchListener” it has only OnTouch() method.

Now I want to implement the same left and right scrolling(Left and
right dragging) in my own.

How to do this? If you have any idea plz share it.

Tnx 4rEver!!

Cheers,
Ganesh

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

2009-12-11 Thread MrChaz
The code I'm using has a static method in the service I'm about to
start that creates a wake lock that I then reference from within the
started service.
I took it from a discussion about WakeLocks in here and it seems to
work.

private static PowerManager.WakeLock _wakeLock = null;

synchronized public static PowerManager.WakeLock getLock(Context
context) {
if (_wakeLock == null) {
//Log.i(DownloadService, Creating wakeLock);
PowerManager mgr=(PowerManager)context.getSystemService
(Context.POWER_SERVICE);


_wakeLock=mgr.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,

my worker wake lock);
_wakeLock.setReferenceCounted(false);
}

return(_wakeLock);
}

On Dec 11, 12:03 am, BK knitt...@blandsite.org wrote:
 I think I may have found an issue within the

 My understanding is that to properly hold a device awake after an
 alarm is triggered you have to aquire a WakeLock in the onReceive()
 event, call a Service, then perform the work in the Service, releasing
 the lock within the Service when complete.

 http://groups.google.com/group/android-developers/browse_thread/threa...

 http://www.mail-archive.com/android-developers@googlegroups.com/msg66...

 This pattern can also be found in the CommonWare Advanced Android
 Development book.

 I tried this, but I found that the AlarmManager, when calling the
 BroadcastReceiver, runs on a separate PID than the IntentService when
 started from the BroadcastReceiver's onReceive() event.  This makes
 the static variable on the lock manager.

 I tried this, and my logs indicate that the PID is definately not the
 same, and my understanding is that the DalikVM instances act like a
 standard JVM, whereby objects and variables are no shared between
 JVMs.

 Furthermore, since the WakeLock is not serializable, there is really
 no way to pass the reference to the lock via an extra in the Intent.

 Has anyone else seen this pattern work or fail?  I have an example
 project (with compiled APK) if you'd like to test it yourself, where
 shall I post this?  I have tested this on the emulator on versions 1.6
 and 2.0.

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

2009-12-11 Thread Chris
Essentially I want to get the current location, the idea of the click
on the map is for the user to indicate they are happy with the current
location and accuracy.  They might well be driving at the time so
ideally the bigger the area to press the better so not as to distract
them to much by having to focus on a small button.

The only alternative I can think of is a send when accuracy is better
than x but then you have to set a reasonable resolution and what if
this is never hit for whatever reason?  Also moving forward the user
might be able to move the icon (if i replace the overlay anyway) to
make it more accurate.

Chris.

On Dec 10, 7:26 pm, TreKing treking...@gmail.com wrote:
 I don't know for sure, but i wouldn't be surprised if the maps activity and
 / or view doesn't actually handle directly clicking the view.

 What are you actually trying to do when touching the screen at any given
 point? There's probably an easy way to accomplish what you want to do with
 overlays.

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

 On Thu, Dec 10, 2009 at 8:28 AM, Chris
 themaninthesuitc...@googlemail.comwrote:



  Hi I am working on my first android app and so my first with the Maps
  API and am experiencing an odd problem.

  I have a mapview with the property clickable set to true:
  com.google.android.maps.MapView
         android:id=@+id/mapview
         android:layout_width=fill_parent
         android:layout_height=fill_parent
         android:clickable=true
         android:apiKey=MY_DEBUG_KEY
     /

  I have registered for the click event:
             mapView = (MapView) findViewById(R.id.mapview);
             mapView.setBuiltInZoomControls(true);

             mapView.setOnClickListener(new OnClickListener() {

                        �...@override
                         public void onClick(View v) {
                                 // onClick Code.
                         }
                 });

  How ever when I click the screen it seems the onClick event is not
  being run?  Have I missed something or am I better off sub classing
  the MyLocationOverlay I am using and override DispatchTap()?  How ever
  i would rather be able to just click anywhere on the map to dispatch
  the event.

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  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


[android-developers] Emulator closes when attempting to enter full screen mode

2009-12-11 Thread Per Sandström
If I am in the emulator and press alt+enter to get full screen, the
emulator closes and the following output is written in the console:

[2009-12-11 15:01:00 - Emulator]### Error: could not create or resize
SDL window: No video mode large enough for 1050x1680

Note that I have my monitor flipped to the side. The resolution isnt
1680*1050, but 1050*1680. This bug has only happened on this
resolution with flipped monitor. I have tried maybe three different
resolutions, but nothing bigger than this. The error is replicable
since it happens everytime I try to go into fullscreen mode. I would
very much prefer if the action was cancelled instead of the emulator
closing.

If there is a more appriopriate place to file a bug report, then
please inform me and I will file it there.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] GridView in a ListView: results are unusable the way it is now

2009-12-11 Thread Brion Emde
Here's a simple program that puts a bunch of GridViews inside a
ListView. My original question was about how the list item that has no
GridView entries, or one row of entries, still has two rows. But, upon
further examination of the included program, the worse problem is that
the GridView items that have 3 rows are cut off. The ListView is not
giving enough space to include the entire height of the taller
GridView.

Sometimes the GridViews with 3 rows can be scrolled, sometimes not.
The intention, in my real code, is to put out a variable length list
in a grid fashion and it mostly works, but for the scrolling that is
sometimes required.

Is it possible to get the GridViews to come out full size, even at the
expense of all the item views in the ListView being larger? How could
I do that?

** GridList.java ***

package com.example.gridlist;

import java.util.ArrayList;

import android.app.ListActivity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.GridView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class GridList extends ListActivity {

private static final String[] STRINGS = {
one,
two,
three,
four,
five,
six,
seven,
eight,
nine,
ten,
};

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String[] satmp = {};// These shouldn't be needed, but I get
a class cast exception
String[][] saatmp = {{}};   // if I use ArrayList.toArray(),
instead of ArratList.toArray(T[])

// Build an array of 10 string arrays, which range from length
zero to length 9
ArrayListString[] strings_array = new ArrayListString[]();
ArrayListString strings = new ArrayListString();
for(int i = 0; i  10; i++) {
strings_array.add(strings.toArray(satmp));
strings.add(GridList.STRINGS[i]);
}
MyArrayAdapter mAdapter = new MyArrayAdapter(this,
R.layout.grid, R.id.text1, strings_array.toArray(saatmp));
this.setListAdapter(mAdapter);
}

// This is the outer adapter, the one for the ListView
private class MyArrayAdapter extends ArrayAdapterString[] {

public MyArrayAdapter(Context context, int textViewResourceId, 
int
textRes, String[][] objects) {
super(context, textViewResourceId, textRes, objects);
}

@Override
public View getView(int position, View convertView, ViewGroup
parent) {
LinearLayout ll;
if (convertView == null) {
ll = (LinearLayout) GridList.this.getLayoutInflater
().inflate(R.layout.grid, null);
} else {
ll = (LinearLayout) convertView;
}
TextView tv = (TextView) ll.findViewById(R.id.text1);
tv.setText(Position # + position);
GridView gv = (GridView) ll.findViewById(R.id.gridview);
GridAdapter ga = new GridAdapter(GridList.this,
android.R.id.text1, this.getItem(position));
gv.setAdapter(ga);
return ll;
}
}

// This is the inner adapter, the one for the GridView
private class GridAdapter extends ArrayAdapterString  {

public GridAdapter(Context context, int textViewResourceId, 
String[]
objects) {
super(context, textViewResourceId, objects);
}

@Override
public View getView(int position, View convertView, ViewGroup
parent) {
TextView tv;
if (convertView == null) {  // if it's not recycled,
initialize some attributes
tv = new TextView(GridList.this);
} else {
tv = (TextView) convertView;
}
tv.setText(this.getItem(position));
return tv;
}
}
}

** AndroidManifest.xml **

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
  package=com.example.gridlist
  android:versionCode=1
  android:versionName=1.0
application android:icon=@drawable/icon android:label=Grid
List
activity android:label=Grid List android:name=.GridList
intent-filter
action android:name=android.intent.action.MAIN /
category
android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity
/application
uses-sdk android:minSdkVersion=2 /
/manifest


** grid.xml **

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=fill_parent
android:layout_height=fill_parent

[android-developers] Re: glCopyTexImage2D - Success anyone?

2009-12-11 Thread scott19_68
Works for me on my HTC Hero - I too could only use RGB and not RGBA.
Emulator flips the textures upside down though...

Does anyone else have more information regarding other phones?  I have
an app on the app store that uses this method and I am suspecting that
it does not work for all current phones.  I get really useful comments
like 'Does not work on Tattoo - nuff said'...

Not sure if the forum rules prevent me from mentioning my app so PM me
if you'd like to help out and test - I'd definitely appreciate it very
much and would be willing to help you out in return regarding OpenGL
development questions...

On Nov 21, 4:45 pm, Ben Gotow bengo...@gmail.com wrote:
 Hey everyone,

 I'm porting anOpenGLapp from the iPhone to Android, and I need to
 renderOpenGLcontent to a texture. Since framebuffers are not
 available inOpenGL1.0 and the DROID is the only Android phone to
 support the framebuffer extension, I'm trying to draw usingOpenGLand
 then copy the result into a texture using glCopyTexImage2D. However,
 my initial findings are not good:

 1. glCopyTexImage2D works in the Android emulator (OS v. 1.5), but
 only with GL10.GL_RGB, not GL_RGBA. If you try to copy the alpha data
 from the scene into the texture, you just get a completely white
 texture.

 2. glCopyTexImage2D doesn't seem to work _at all_ on the Android G1.
 It does not throw an UnsupportedOperationException but after calling
 it, the texture is completely white.

 Has anyone successfully used glCopyTexImage2D on an actual device? If
 so, could you please post a bit of the code you're using? I suspect it
 works only with specific settings, if at all. Right now, I'm calling
 it like this:

 gl.glCopyTexImage2D(GL10.GL_TEXTURE_2D, 0, GL11.GL_RGBA, 0,0, 256,
 256, 0);

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

2009-12-11 Thread Streets Of Boston
If you're nulling your static bitmap in onPause why is it static to begin 
with?

E.g. to have access to bitmaps outside of my activity, in classes that
don't have reference to my activities.

Or, in case there can be multiple instance of an activity, these
instances can share 'expensive' data. But this requires something a
bit more sophisticated than just nulling the static in the 'onDestroy
()'.

In my gallery app i use static caches of thumbnails that are capacity
limited. These caches manage themselves and don't rely on onPause or
onDestroy. I do catch OutOfMemoryExceptions then clean these caches
explicitly and try the operation that threw the execption again. So
far, this has been working for me :)

On Dec 10, 8:27 pm, Matt Kanninen mathias...@gmail.com wrote:
 I don't get it.  If you're nulling your static bitmap in onPause why
 is it static to begin with?

 Also what you want to do is probably very different for a game that is
 basically all taking place in one activity and trying to avoid garbage
 collecting at all, compared to your standard Android app with an
 activity per screen.

 On Dec 10, 4:53 pm, Streets Of Boston flyingdutc...@gmail.com wrote:



  Statically held (caches of) bitmaps may come in very very handy.
  However, as soon as you do hold static references to 'expensive'
  resources, be sure to have a proper clean-up strategy. E.g. make sure
  the capacity of your cache of bitmaps is limited. Be sure to set the
  static reference to null when the activity is destroyed or paused,
  etc.

  On Dec 10, 6:05 pm, Matt Kanninen mathias...@gmail.com wrote:

   I recommend the only things you make static be strings, and that for
   everything else you are considering making static, instead write it to
   file and use static methods, that expect to be passed a context, to
   access the data.

   I think my problems might be camera related, so my plan is to stop
   using our own camera related activites and just use an intent to
   launch the camera, and then read the returned result.

   On Dec 10, 1:05 pm, fadden fad...@android.com wrote:

On Dec 8, 12:28 pm, skominac stevan.komi...@gmail.com wrote:

 So not only is memory of static members not deallocated (which is
 actually not surprising), but the static references are still alive,
 pointing to the memory, and can be used to invoke the members back.
 This last part was surprising to me.

 This is actually not bad, as long as developers are aware of it.
 Is this Dalvik's feature?

This is the expected behavior.  Keep in mind that the VM doesn't shut
down between runs of your activity.  You are not necessarily starting
with a clean slate.- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -

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


Re: [android-developers] GridView in a ListView: results are unusable the way it is now

2009-12-11 Thread Mark Murphy
 Here's a simple program that puts a bunch of GridViews inside a
 ListView.

Putting scrollable items inside scrollable items usually does not work
well in Android. I would recommend you use either a GridView or a
ListView.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Where can I catch a point that is assured to be called when a Service is destroied

2009-12-11 Thread zhiyazw
Who can help?

On 12月11日, 上午11时27分, zhiyazw zhiy...@gmail.com wrote:
 Thank you, Mark.

 I read your linked topic, But AlarmManager is not suitable to me.

 My service is not started periodically, it started by broadcast,
 Actually by android.intent.action.PHONE_STATE.

 On each starting, the service should load a big database, this spend
 about serveral seconds, so I don't want to load it each time
 android.intent.action.PHONE_STATE arrive, I leave the service
 runing.

 For each android.intent.action.PHONE_STATE, a UI should be present
 to user while calling, in order to show the UI in front of calling and
 not to interrupt the interaction with phone call, the UI should not be
 a activity, I user WindowManager.LayoutParams.TYPE_SYSTEM_ALERT with
 FLAG__NOT_FOCUSABLE.

 In above condition, except to Service, there is any better class I can
 use? pls advise me.

 If I have to user Service, Where should I do cleaning up and saving
 settings?

 Thank you!

 On Dec 10, 7:33 pm, Mark Murphy mmur...@commonsware.com wrote:



   I have a Service, it is started by StartService(...), my program never
   stop it. The service can be destroied in other cases, such as:
 Stop it in Application-Running Services
 run command: Kill pid
 System kill it in case of memory low
 Phone shut down
 other unlist condition...

   I want to clean up and save settings whenever the service is
   destroied. I tried do this in onDestroy() or finalize(), Neither
   satisfies my demand, onDestroy() is only called whe Stop it in
   Application-Running Services, finalize() is never called in all
   above condition.

   Where is the rightpoint? pls help me, THANK YOU!

  There is no rightpoint for those scenarios. Your code will not be
  called. Hence, do not wait to be destroyed to clean up and save
  settings.

  And, please do not leave your service running all of the time:

 http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-a...

  --
  Mark Murphy (a Commons Guy)http://commonsware.com
  Android App Developer Books:http://commonsware.com/books.html

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

2009-12-11 Thread Mr Pinguin
Is it possible to record only

VOICE_DOWNLINKVoice call downlink (Rx) audio source
?

It doesn't work for me. it records only 2 ways.

On 4 Dez., 08:00, hongki park parkhongki.spr...@gmail.com wrote:
 ^^ what are you talking about ???

 2009/12/4 Hetal Patel heta...@gmail.com

  Will anybody reply ever

  Android us Useless as far as Bugs is Concerened Nobody ever Bother to
  rely of Patch

  This is another Exmaple of Google Which Never Comes out of BETA

  I hate Android

  On Nov 19, 1:32 pm, Hetal Patel heta...@gmail.com wrote:
   Here is what I see.

   In AudioRecord.h and in the MediaRecorder.AudioSource, the enum values
   differ.

   In native code (AudioRecord.h), the values are ..
   44     enum input_source {
   45         DEFAULT_INPUT   =-1,
   46         MIC_INPUT       = 0,
   47         VOICE_UPLINK_INPUT = 1,
   48         VOICE_DOWNLINK_INPUT = 2,
   49         VOICE_CALL_INPUT = 3,
   50         NUM_INPUT_SOURCES
   51     };
 http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...

   In Java MediaRecorder AudioSource, the values are ..
   120     public final class AudioSource {
   121       /* Do not change these values without updating their
   counterparts
   122        * in include/media/mediarecorder.h!
   123        */
   124         private AudioSource() {}
   125         public static final int DEFAULT = 0;
   126         /** Microphone audio source */
   127         public static final int MIC = 1;
   128
   129         /** Voice call uplink (Tx) audio source */
   130         public static final int VOICE_UPLINK = 2;
   131
   132         /** Voice call downlink (Rx) audio source */
   133         public static final int VOICE_DOWNLINK = 3;
   134
   135         /** Voice call uplink + downlink audio source */
   136         public static final int VOICE_CALL = 4;
   137     }

  http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...

   Now, if you look at AudioFlinger, any input source, whose value of
   stream type is =
   NUM_INPUT_SOURCES (i.e., 4), we will get an invalid stream type.
   Because of the
   mismatch of the enums, the Java API sets the value of VOICE_CALL
   stream type as 4.
   So, the check fails and we get the failure.

  http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...

   Fix:
   Set the values of the stream types to be the same in the Java and c++
   code.

   Hope this helps.

   On Nov 19, 1:31 pm, Hetal Patel heta...@gmail.com wrote:

Understood, I thought that this was straightforward.

When attempting to record a phone conversation on Android v1.6 (by
using the
MediaRecorder.AudioSource.VOICE_CALL audio source parameter), at
runtime an
exception is thrown unexpectedly. The test is performed on the HTC ADP
with firmware 1.6.

Here is the snippet of code, which causes the crash:

recorder = new MediaRecorder();
int audioSource = MediaRecorder.AudioSource.VOICE_CALL;
recorder.setAudioSource(audioSource);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
final String filePath = Environment.getExternalStorageDirectory() + /
record.3gpp;
final File file = new File(filePath);
file.getParentFile().mkdirs();
recorder.setOutputFile(filePath);
recorder.prepare();
recorder.start(); // Recording is now started

At runtime, when the recorder.start() method is executed, an
exception is thrown ,
and in the DDMS log, I get:

09-30 15:35:09.812: ERROR/AudioFlinger(51): invalid stream type
09-30 15:35:09.812: ERROR/AudioRecord(51): AudioFlinger could not
create record
track, status: -22
09-30 15:35:09.812: ERROR/MediaRecorder(11204): start failed:
-2147483648

I hope that the problem reporting is now clear enough. Thank you for
your time.

On Nov 19, 1:31 pm, Hetal Patel heta...@gmail.com wrote:

 I'm deseperately trying to use the VOICE_CALL parameter, in order
  to
 record both
 the in and out audio streams during a phone call. When using
 VOICE_UPLINK or
 VOICE_DOWNLINK or MIC, it works fine, however.

 At runtime, in the DDMS log, I get:

 09-30 15:35:09.812: ERROR/AudioFlinger(51): invalid stream type
 09-30 15:35:09.812: ERROR/AudioRecord(51): AudioFlinger could not
 create record
 track, status: -22
 09-30 15:35:09.812: ERROR/MediaRecorder(11204): start failed:
 -2147483648

 I'm running my test againt the ADP with the 1.6 firmware. Could
 someone indicate
 whether this problem is linked to the ADP drivers, or if it is
 something which
 resorts to Android v1.6, please?

 Thank you for your support.

 On Nov 19, 1:30 pm, Hetal Patel heta...@gmail.com wrote:

  In Package

  android.media

  Classes MediaRecorder.MediaSource now after API Level 4 ( Android
  1.6 ) Includes

  4 VOICE_CALL        Voice 

[android-developers] Re: Controlling my service from main activity

2009-12-11 Thread Neilz
Well, I've done some considerable debugging and testing on this. My
code is based on the examples given with the SDK docs, so it's nothing
different or profound. 
http://developer.android.com/intl/fr/guide/developing/tools/aidl.html

I can confirm that if you pause the activity that called the service,
when the activity is resumed it does not pick up the same connection
object. This means that when you subsequently stop the service, the
old connection is still hanging around (although you can't access it)
meaning the service's onDestroy() doesn't get called. The only way to
make sure the service is destroyed is to destroy the activity too -
which really isn't what I want to do in this case.

Mark, or anyone else, if you have any suggestions I would appreciate
it. Here's the code where the connection is created:

private ServiceConnection m_connection = new ServiceConnection(){

@Override
public void onServiceConnected(ComponentName name, IBinder 
service)
{
m_service = ILocationService.Stub.asInterface(service);
}

@Override
public void onServiceDisconnected(ComponentName name) {
m_service = null;
}
};

 So it seems like the onDestroy() method should be called, unless there
 is more than one connections existing. Is it possible that when my
 activity is resumed, a new connection object is created, making a
 second one hanging onto the service?

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

2009-12-11 Thread murali raju
Hi,

  May be I am missing some where, I am not able to implement it. As you
said I used the simple_spinner_dropdown_item file in my program and changed
the width. Only the radio icons(default which are placed on the extreme
right) move towards text(ie.. left side), but the background still remains
the same.I even changed the themes, and spinner images but still the spinner
drop down occupies the entire width of the screen. I am not able to guess
what I am missing. can you help.

Thanks in advance

---
M Murali Krishna


On Fri, Dec 11, 2009 at 12:02 AM, Kumar Bibek coomar@gmail.com wrote:

 Hi,

 For the spinner you must be using an adapter. I guess, while using an
 adapter you would also be specifying a layout. It would probably be
 something like this.

 android.R.simple_spinner_item

 Extract this file from the SDK location into your project.
 ..\android-sdk-windows-1.5_r2\platforms\android-1.5\data\res\layout
 \simple_spinner_dropdown_item

 Change the width of the layout, and use this layout in your code, i.e
 while specifying the layout for your adapter.

 Thanks and Regards,
 Kumar Bibek

 http://tech-droid.blogspot.com


 On Dec 10, 9:26 pm, murali raju manutd...@gmail.com wrote:
  Hi,
 
  Thanks for your reply, but I didn't get what you were saying. Can you
  tell in a bit detail
 
  Thanks
 
  On Thu, Dec 10, 2009 at 8:42 PM, Kumar Bibek coomar@gmail.com
 wrote:
   Copy the underlying layout xml, and change the width.
 
   Now use this changed layout for populating your spinner.
 
   Thanks,
   Kumar Bibek
 
  http://tech-droid.blogspot.com
 
   On Dec 10, 7:23 pm, mmkr manutd...@gmail.com wrote:
Hi,
 
 I am using spinners in my application, but when I click the drop
down icon the options coverthe entire width of the screen. But I want
the options to cover only some part of the screen(ie.. width). By
using LayoutParams I am able to change only the spinner icon width
 but
not the options width. I even searched for it,but of no use. Any one
help me, I need it very badly.
 
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.comandroid-developers%2bunsubscr...@googlegroups.com
 android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@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

Re: [android-developers] Re: Controlling my service from main activity

2009-12-11 Thread Mark Murphy
 I can confirm that if you pause the activity that called the service,
 when the activity is resumed it does not pick up the same connection
 object.

You are the one creating the connection object (private
ServiceConnection m_connection), not Android. If you want to hang onto it,
hang onto it.

If your initializers are getting invoked again, then you were not paused
and resumed, but rather destroyed and recreated. In that case, you should
have unbound from the service in onDestroy().

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: GridView in a ListView: results are unusable the way it is now

2009-12-11 Thread Brion Emde
Thank you. I was looking for something that would mimic the behavior
of floating elements in HTML, where several items can be added and
they could end up looking like a grid.

Like this: http://gobeering.com/beers.html

If you look at that page on a mobile device, the tags under a beer
will move to a second row, when needed.


On Dec 11, 8:15 am, Mark Murphy mmur...@commonsware.com wrote:
  Here's a simple program that puts a bunch of GridViews inside a
  ListView.

 Putting scrollable items inside scrollable items usually does not work
 well in Android. I would recommend you use either a GridView or a
 ListView.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.html

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Pick Contacts and dynamically adding into ListView.... Help!

2009-12-11 Thread Abhi
Hi

I am copying my code below to do the above. The problem I have right
now is after I have picked a Contact from the list, I am not able to
add the name to the listview. I get a Force Close at that step. See
point no. A below to understand what I am talking about.

Also, the ListView is built using 'strings' ArrayList which is empty
the very first time. The Menu option 'Add' is then used to pick a
Contact and add the contact Name to the ArrayList which is then


import android.app.ListActivity;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ContextMenu.ContextMenuInfo;
import android.widget.ArrayAdapter;
import android.widget.HeaderViewListAdapter;
import android.widget.ListView;
import android.widget.Toast;
import android.view.View.OnLongClickListener;
import android.provider.Contacts.People;

import android.widget.AdapterView.AdapterContextMenuInfo;

public class ListViewTest extends ListActivity {

private Uri iSelectedImageURI = null;
private ListView listView;
private ListString strings;

//  private static final int EDIT_ID = 1;
//  private static final int DELETE_ID = 2;
private static final int PICK_CONTACT = 3;


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

setContentView(R.layout.list_view);
listView = (ListView) findViewById(R.id.listView);

strings = new ArrayListString();

   listView.setAdapter(new ArrayAdapterString(this,
android.R.layout.simple_list_item_multiple_choice, strings));

listView.setItemsCanFocus(false);
listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

// For Long Press on ListView items
registerForContextMenu(listView);

}


@Override
public boolean onCreateOptionsMenu(Menu menu) {

MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.add_send, menu);

return super.onCreateOptionsMenu(menu);
}

@Override
  public boolean onOptionsItemSelected(MenuItem item) {

   switch (item.getItemId()) {

   case R.id.add:

Intent contact = new Intent(Intent.ACTION_PICK,
People.CONTENT_URI);
startActivityForResult(contact, PICK_CONTACT);

return true;
  }
  return true;
}

@SuppressWarnings(unchecked)
@Override
public void onActivityResult(int reqCode, int resultCode, Intent
data){
 super.onActivityResult(reqCode, resultCode, data);

  switch (reqCode) {
case (PICK_CONTACT):
 if (resultCode == RESULT_OK) {
  Uri contactData = data.getData();
  Cursor c = managedQuery(contactData, null, null, null,
null);

  if(c.moveToFirst()) {//
-
POINT A


String name = c.getString
(c.getColumnIndexOrThrow(People.NAME));
strings.add(name);

//  Toast.makeText(this, name, Toast.LENGTH_SHORT).show();  //
--This works fine, I can read the Contact Name at this point.

  ((ArrayAdapterString)
((HeaderViewListAdapter) listView.getAdapter()).getWrappedAdapter
()).notifyDataSetChanged();// I think this is where
the Problem comes. I am sure I am doing some stupid mistake.

}
}

break;
   }

}

}


list_view.xml:

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent
ListView
android:id=@+id/listView
android:layout_width=fill_parent
android:layout_height=wrap_content/
/LinearLayout



Any help would be greatly appreciated. Thanks.

Abhishek

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: GridView in a ListView: results are unusable the way it is now

2009-12-11 Thread Mark Murphy
 Thank you. I was looking for something that would mimic the behavior
 of floating elements in HTML, where several items can be added and
 they could end up looking like a grid.

 Like this: http://gobeering.com/beers.html

 If you look at that page on a mobile device, the tags under a beer
 will move to a second row, when needed.

Android doesn't offer much in the way of wrapping in its built-in layout
classes, other than text in a TextView (which can include links, via
Linkify or other means of creating a suitable Spannable).

You also could use HTML via a WebView, and nix the GridView and ListView
altogether.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Can someone with a Motorola Droid call AccountManager.getAccounts() please?

2009-12-11 Thread polyclefsoftware
Well, if anyone is still following this thread at all...

I'm able to replicate the behavior RoryD describes, but it is still
less than ideal from the user's perspective. Here's what happens:

1) The user opens the app for the first time, clicks a button to log
in.
2) Account Manager tries to get the auth token, returns null and
produces a system notification.
3) At this point, the user would have to return to the home screen,
open Notifications, select the system notification that was just
produced and allow the app access to their user credentials.
4) The user could then relaunch the app, click a button to log in, and
the Account Manager would then be able to successfully retrieve the
auth token and use it to log in.

I really don't want users to have to exit my app to accept a
permission notification before reentering the app. Granted, they would
only have to do this once, but it's still extremely clunky.

A couple of questions:

1) If we're already declaring the GET_ACCOUNTS and USE_CREDENTIALS
permissions in the manifest, and the user is aware of this when they
install the app, why the extra steps of notifying the user and forcing
them to allow the app to use their credentials? Isn't this overkill?

2) Is there a way to take the user directly to the notification screen
when the system sends the notification, rather than have the user
manually navigate away from the app to the notification screen?

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


Re: [android-developers] URLconnection.setConnectTimeout doesn't work?

2009-12-11 Thread Jeffrey Blattman
you can try doing the same thing w/ the httpclient classes. i know that 
doesn't answer your question but it's something else to try.

On 12/11/09 3:53 AM, Kaj Bjurman wrote:
 Hi,

 I have code that is reading data from a website, the website that I'm
 reading data from is at times a bit slows, so I want to use
 setConnectTimeout on the URLconnection that I'm using.

 The problem is that it looks like the value is ignored, or that it
 doesn't work. I have set the setConnectTimeout to 30 seconds (i.e.
 3 as value since the javadoc says that the argument is in ms).

 I then call connect, and I have through my logs seen that the code can
 get blocked in the connect call for several hours (in Android 1.6,
 don't know about the other versions).

 Has anyone else seen this problem? What to do about it? I don't see
 how I would create a workaround since I don't have anything that I can
 invoke close on (I would create a separate thread that invoked close
 on the stream/socket after a certain time if the problem was related
 to slow reading)

 Thanks
 Kaj




-- 

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

[android-developers] leaked window?

2009-12-11 Thread stanlick
Can someone who speaks better droid than me please help to translate
this beauty?

12-11 09:19:51.879: ERROR/WindowManager(232): Activity
com.androidologist.friendfinder.MainActivity has leaked window
com.android.internal.policy.impl.phonewindow$decorv...@43db25f0 that
was originally added here


Peace,
Scott

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

2009-12-11 Thread TreKing
In that case, what I would probably do is derive a class from
MyLocationOverlay, as you already mentioned, and override the onTap function
(not dispatchTap). I believe this is called whenever the map view is pressed
anywhere, but then only returns true if the given overlay was actually
tapped (to prevent dispatching the event to the other overlays).

So simply:
public boolean onTap(GeoPoint gp, MapView mv)
{
 // Do what you need with current accuracy and location

 return super.onTap(gp, mv);
}

Hope that helps.

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


On Fri, Dec 11, 2009 at 8:19 AM, Chris
themaninthesuitc...@googlemail.comwrote:

 Essentially I want to get the current location, the idea of the click
 on the map is for the user to indicate they are happy with the current
 location and accuracy.  They might well be driving at the time so
 ideally the bigger the area to press the better so not as to distract
 them to much by having to focus on a small button.

 The only alternative I can think of is a send when accuracy is better
 than x but then you have to set a reasonable resolution and what if
 this is never hit for whatever reason?  Also moving forward the user
 might be able to move the icon (if i replace the overlay anyway) to
 make it more accurate.

 Chris.

 On Dec 10, 7:26 pm, TreKing treking...@gmail.com wrote:
  I don't know for sure, but i wouldn't be surprised if the maps activity
 and
  / or view doesn't actually handle directly clicking the view.
 
  What are you actually trying to do when touching the screen at any given
  point? There's probably an easy way to accomplish what you want to do
 with
  overlays.
 
 
 ---
 --
  TreKing - Chicago transit tracking app for Android-powered deviceshttp://
 sites.google.com/site/rezmobileapps/treking
 
  On Thu, Dec 10, 2009 at 8:28 AM, Chris
  themaninthesuitc...@googlemail.comwrote:
 
 
 
   Hi I am working on my first android app and so my first with the Maps
   API and am experiencing an odd problem.
 
   I have a mapview with the property clickable set to true:
   com.google.android.maps.MapView
  android:id=@+id/mapview
  android:layout_width=fill_parent
  android:layout_height=fill_parent
  android:clickable=true
  android:apiKey=MY_DEBUG_KEY
  /
 
   I have registered for the click event:
  mapView = (MapView) findViewById(R.id.mapview);
  mapView.setBuiltInZoomControls(true);
 
  mapView.setOnClickListener(new OnClickListener() {
 
  @Override
  public void onClick(View v) {
  // onClick Code.
  }
  });
 
   How ever when I click the screen it seems the onClick event is not
   being run?  Have I missed something or am I better off sub classing
   the MyLocationOverlay I am using and override DispatchTap()?  How ever
   i would rather be able to just click anywhere on the map to dispatch
   the event.
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   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] GPS beacon vs. locked

2009-12-11 Thread stanlick
I am trying to determine whether satellites are being acquired or if a
lock has been acquired.  I can see this with a pulsing vs. fixed dish
icon on the notification bar, but so far I have not quite achieved a
solution in code.

Apparently this does nor necessarily mean LOCK_ACQUIRED?

@Override
public void onGpsStatusChanged(int event) {
if (GpsStatus.GPS_EVENT_STARTED == event) {
//1
setGpsAvailable(true);
}

}

Peace,
Scott

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] GridView in a ListView: results are unusable the way it is now

2009-12-11 Thread Romain Guy
ListView and GridView are not meant to be embedded within one another
(the same is true with ScrollView.) And when I say they are not meant
to, it's not supported to do so.

On Fri, Dec 11, 2009 at 6:53 AM, Brion Emde brione2...@gmail.com wrote:
 Here's a simple program that puts a bunch of GridViews inside a
 ListView. My original question was about how the list item that has no
 GridView entries, or one row of entries, still has two rows. But, upon
 further examination of the included program, the worse problem is that
 the GridView items that have 3 rows are cut off. The ListView is not
 giving enough space to include the entire height of the taller
 GridView.

 Sometimes the GridViews with 3 rows can be scrolled, sometimes not.
 The intention, in my real code, is to put out a variable length list
 in a grid fashion and it mostly works, but for the scrolling that is
 sometimes required.

 Is it possible to get the GridViews to come out full size, even at the
 expense of all the item views in the ListView being larger? How could
 I do that?

 ** GridList.java ***

 package com.example.gridlist;

 import java.util.ArrayList;

 import android.app.ListActivity;
 import android.content.Context;
 import android.os.Bundle;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ArrayAdapter;
 import android.widget.GridView;
 import android.widget.LinearLayout;
 import android.widget.TextView;

 public class GridList extends ListActivity {

    private static final String[] STRINGS = {
            one,
            two,
            three,
            four,
            five,
            six,
            seven,
            eight,
            nine,
            ten,
    };

   �...@override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        String[] satmp = {};            // These shouldn't be needed, but I get
 a class cast exception
        String[][] saatmp = {{}};       // if I use ArrayList.toArray(),
 instead of ArratList.toArray(T[])

        // Build an array of 10 string arrays, which range from length
 zero to length 9
        ArrayListString[] strings_array = new ArrayListString[]();
        ArrayListString strings = new ArrayListString();
        for(int i = 0; i  10; i++) {
                strings_array.add(strings.toArray(satmp));
                strings.add(GridList.STRINGS[i]);
        }
        MyArrayAdapter mAdapter = new MyArrayAdapter(this,
 R.layout.grid, R.id.text1, strings_array.toArray(saatmp));
        this.setListAdapter(mAdapter);
    }

    // This is the outer adapter, the one for the ListView
        private class MyArrayAdapter extends ArrayAdapterString[] {

                public MyArrayAdapter(Context context, int textViewResourceId, 
 int
 textRes, String[][] objects) {
                        super(context, textViewResourceId, textRes, objects);
                }

               �...@override
                public View getView(int position, View convertView, ViewGroup
 parent) {
            LinearLayout ll;
            if (convertView == null) {
                ll = (LinearLayout) GridList.this.getLayoutInflater
 ().inflate(R.layout.grid, null);
            } else {
                ll = (LinearLayout) convertView;
            }
            TextView tv = (TextView) ll.findViewById(R.id.text1);
            tv.setText(Position # + position);
            GridView gv = (GridView) ll.findViewById(R.id.gridview);
            GridAdapter ga = new GridAdapter(GridList.this,
 android.R.id.text1, this.getItem(position));
            gv.setAdapter(ga);
            return ll;
        }
        }

        // This is the inner adapter, the one for the GridView
    private class GridAdapter extends ArrayAdapterString  {

                public GridAdapter(Context context, int textViewResourceId, 
 String[]
 objects) {
                        super(context, textViewResourceId, objects);
                }

               �...@override
                public View getView(int position, View convertView, ViewGroup
 parent) {
            TextView tv;
            if (convertView == null) {  // if it's not recycled,
 initialize some attributes
                tv = new TextView(GridList.this);
            } else {
                tv = (TextView) convertView;
            }
            tv.setText(this.getItem(position));
            return tv;
        }
    }
 }

 ** AndroidManifest.xml **

 ?xml version=1.0 encoding=utf-8?
 manifest xmlns:android=http://schemas.android.com/apk/res/android;
      package=com.example.gridlist
      android:versionCode=1
      android:versionName=1.0
    application android:icon=@drawable/icon android:label=Grid
 List
        activity android:label=Grid List android:name=.GridList
            intent-filter
                action android:name=android.intent.action.MAIN /
                category
 android:name=android.intent.category.LAUNCHER /
            /intent-filter
        

Re: [android-developers] leaked window?

2009-12-11 Thread TreKing
What happening in your app when you see this error?
Are you showing a dialog with dialog.show() instead of
Activity.showDialog()?
I know this will happen if you do this but don't dismiss the dialog before
the activity is destroyed.

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

On Fri, Dec 11, 2009 at 10:49 AM, stanlick stanl...@gmail.com wrote:

 Can someone who speaks better droid than me please help to translate
 this beauty?

 12-11 09:19:51.879: ERROR/WindowManager(232): Activity
 com.androidologist.friendfinder.MainActivity has leaked window
 com.android.internal.policy.impl.phonewindow$decorv...@43db25f0 that
 was originally added here


 Peace,
 Scott

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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: leaked window?

2009-12-11 Thread Kaj Bjurman
I think I've seen something similar to that on the Droid. I got it
when I invoked updateConfiguration with a new locale without
specifying android:configChanges=locale in the activity section in
the AndroidManifest.

(The same code worked in 1.5 and 1.6 without any errors)



On 11 Dec, 17:49, stanlick stanl...@gmail.com wrote:
 Can someone who speaks better droid than me please help to translate
 this beauty?

 12-11 09:19:51.879: ERROR/WindowManager(232): Activity
 com.androidologist.friendfinder.MainActivity has leaked window
 com.android.internal.policy.impl.phonewindow$decorv...@43db25f0 that
 was originally added here

 Peace,
 Scott

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


Re: [android-developers] Re: Android in China - What is going on?

2009-12-11 Thread Hong
I don't know the technical details but they can add CDMA devices to their
network by assigning some numbers, same procedure for China Telecom, on
which some Palm Pres are currently running ;)

On Thu, Dec 10, 2009 at 8:36 PM, Mark Carter mjc1...@googlemail.com wrote:

 Thanks for the explanation Hong.

 Do you mean a sim-less CDMA Hero can work on the China Unicom network by
 roaming?

 2009/12/11 Hong lordh...@gmail.com

 China Unicom has NO android devices yet, but some CDMA android phones,
 e.g. Hero, can work on their CDMA network.  Unfortunately, those users might
 be running a pirate version of your app...


 On Tue, Dec 1, 2009 at 10:27 AM, westmeadboy westmead...@yahoo.co.ukwrote:

 For my app, I noticed China Unicom is number 10 in the list of
 carriers (based on analytics feedback) - i.e. quite a few of my users
 are on China Unicom.

 Do those devices (i.e. without sim card) have access to the Market
 app?


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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.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: Accessing Droid Moto Corporate Calendar database for my widget

2009-12-11 Thread Dianne Hackborn
On Fri, Dec 11, 2009 at 5:44 AM, Mike mikehoepfin...@comcast.net wrote:

 I realize this definitely, but for now am willing to take the risk and
 adjust later, much like we have to do when each new Android release
 comes out.


Let's be clear: you don't generally need to do this for each new Android
release, as long as you use the public APIs.  If you use private APIs, you
are pretty much ensuring you will break in the future, and this is VERY
different than the situation if you are using the standard APIs.

-- 
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: leaked window?

2009-12-11 Thread stanlick
Well how did I miss that one? :)  Thanks for the tip and I'll look
into my manifest.

It sure seems like there is a lot of guess-and-be-golly with Android
today.  I'm not complaining guys -- just stating my observation.

P.S. This has become common vernacular have you tried this?

Peace,
Scott


On Dec 11, 11:32 am, Kaj Bjurman kaj.bjur...@gmail.com wrote:
 I think I've seen something similar to that on the Droid. I got it
 when I invoked updateConfiguration with a new locale without
 specifying android:configChanges=locale in the activity section in
 the AndroidManifest.

 (The same code worked in 1.5 and 1.6 without any errors)

 On 11 Dec, 17:49, stanlick stanl...@gmail.com wrote:

  Can someone who speaks better droid than me please help to translate
  this beauty?

  12-11 09:19:51.879: ERROR/WindowManager(232): Activity
  com.androidologist.friendfinder.MainActivity has leaked window
  com.android.internal.policy.impl.phonewindow$decorv...@43db25f0 that
  was originally added here

  Peace,
  Scott



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


Re: [android-developers] view inside a customView

2009-12-11 Thread Dianne Hackborn
You need to extend ViewGroup so you can be container of other Views.

On Fri, Dec 11, 2009 at 4:22 AM, Atif Gulzar atif.gul...@gmail.com wrote:


 Is it possible to use standard views inside your custom defined views. e.g.
 use ImageView in my class that is extended form View ?

 Or is it possible to use one custom view inside another custom view?
 Actually I have animations defined in xml view which I want to apply on some
 of the images. But predefined animations can only be applied to views.


 The scenario is,  I want to animate (rotating, glowing, etc ) some of the
 chips  on a board. User can also drag these chips through touch events. And
 I do not want to refresh my complete board just to rotate few chips on it.
 All my animations are defined in xml files. Looking for some pointers.
 Thanks



 --
 Best Regards,
 Atif Gulzar

 I  Unicode, ɹɐzlnƃ ɟıʇɐ

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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: Controlling my service from main activity

2009-12-11 Thread Neilz
Well, we're going right back to the basic fundamentals here! I thought
I had got to grips with this long ago, but clearly not. Here's what's
happening:

If I press the 'home' key, onPause and onStop are called.
If I press the 'back' key, in addition onDestroy is called (that's the
behaviour that has confused me).
If I restart the activity by 'long pressing' the home key, onStart and
onResume are called.
If I restart the activity from the app menu, it is entirely restarted
with onCreate, leaving the other instance of the same activity in the
background. (Again, this is the behaviour that has confused me).

So... is there a way to ensure that only one instance of the activity
can be run, so that when (and however) I start it, if it's already
running that is the one that continues?

On Dec 11, 3:57 pm, Mark Murphy mmur...@commonsware.com wrote:

 If your initializers are getting invoked again, then you were not paused
 and resumed, but rather destroyed and recreated. In that case, you should
 have unbound from the service in onDestroy().

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

2009-12-11 Thread Kaj Bjurman
dip and dp is the same according to the documentation.

dp
Density-independent Pixels - an abstract unit that is based on the
physical density of the screen. These units are relative to a 160 dpi
screen, so one dp is one pixel on a 160 dpi screen. The ratio of dp-to-
pixel will change with the screen density, but not necessarily in
direct proportion. Note: The compiler accepts both dip and dp,
though dp is more consistent with sp.



On 10 Dec, 14:00, 吴祥辉 wuxiang...@gmail.com wrote:
    android:minWidth=294dp
    android:minHeight=72dp

 Did U check this ? dp = dip.

 2009/12/10 Paul Turchenko paul.turche...@gmail.com





  +1

  On Dec 8, 1:18 pm, Kaj Bjurman kaj.bjur...@gmail.com wrote:
   Doesn't anyone got input on this issue? Isn't it possible to solve the
   problem?

   On 6 Dec, 19:50, Kaj Bjurman kaj.bjur...@gmail.com wrote:

I tried to create a folder named xml-small and placed the widget
provider xml-files there.

It looks like I need to use something like 50x50 dip for one cell on
the DSTL1, so 100x50 dip is 2x1, and 200x50 dip is 4x1 but that does
only work on the DSTL1. The HTC Tattoo which also is considered xml-
small displays a 3x1 widget if I use 200x50 dip :(

240x50 dip works as 4x1 on HTC Tattoo

On 6 Dec, 19:09, Kaj Bjurman kaj.bjur...@gmail.com wrote:

 Hi,

 I got some problems when specifying the size of my AppWidget / Home
 screen widget. The widget is currently available in the sizes 1x1,
  2x1
 and 4x1 if we count in cells.

 Everything works in E.g. HTC Tattoo (240 x 320), HTC Magic (320x480)
 and Motorola Droid (480 x 854), but I do have problems on the DSTL1
 (240x400).

 I have specified the sizes according to the description here:
 http://android-developers.blogspot.com/2009/04/introducing-home-scree...

 Below is what I got in my xml-files.

 The problem on the DSTL1 is that it says that the 4x1 widget is too
 large to be placed on the home screen. The 2x1 widget looks like it
  is
 3x2, and the 1x1 widget looks like 2x2.

 What should I do? What's wrong?

 !-- small, 1x1 --

 appwidget-provider xmlns:android=
 http://schemas.android.com/apk/res/
 android
     android:minWidth=72dip
     android:minHeight=72dip
     android:updatePeriodMillis=0
     android:initialLayout=@layout/widget_configure/

 !-- medium, 2x1 --

 appwidget-provider xmlns:android=
 http://schemas.android.com/apk/res/
 android
     android:minWidth=146dip
     android:minHeight=72dip
     android:updatePeriodMillis=0
     android:initialLayout=@layout/widget_configure/

 !-- large, 4x1 --

 appwidget-provider xmlns:android=
 http://schemas.android.com/apk/res/
 android
     android:minWidth=294dp
     android:minHeight=72dp
     android:updatePeriodMillis=0
     android:initialLayout=@layout/widget_configure/

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  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

 --
 thanks a lot

 =
 ||  Wu xiang hui                          ||
 ||  Msn: wuxiang...@google.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: Accessing Droid Moto Corporate Calendar database for my widget

2009-12-11 Thread Mike
Sure Dianne, you are right. Using private API's is risky

With that said, it is the only way to get to the calendar data that I
am aware of. Can you give me some pointers to access the Corporate
Calendar (Exchange) data, or point me to public API's that may help
for either?

Thanks!
Mike

On Dec 11, 12:43 pm, Dianne Hackborn hack...@android.com wrote:
 On Fri, Dec 11, 2009 at 5:44 AM, Mike mikehoepfin...@comcast.net wrote:
  I realize this definitely, but for now am willing to take the risk and
  adjust later, much like we have to do when each new Android release
  comes out.

 Let's be clear: you don't generally need to do this for each new Android
 release, as long as you use the public APIs.  If you use private APIs, you
 are pretty much ensuring you will break in the future, and this is VERY
 different than the situation if you are using the standard APIs.

 --
 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: Controlling my service from main activity

2009-12-11 Thread Mark Murphy
 If I press the 'home' key, onPause and onStop are called.

Correct.

 If I press the 'back' key, in addition onDestroy is called (that's the
 behaviour that has confused me).

Correct. BACK, by default, will destroy your activity.

 If I restart the activity by 'long pressing' the home key, onStart and
 onResume are called.

I haven't tested that, but I'll take your word for it.

 If I restart the activity from the app menu, it is entirely restarted
 with onCreate, leaving the other instance of the same activity in the
 background. (Again, this is the behaviour that has confused me).

This can be adjusted via some manifest settings.

 So... is there a way to ensure that only one instance of the activity
 can be run, so that when (and however) I start it, if it's already
 running that is the one that continues?

android:launchMode=singleTop may do it, but may not be your problem.

In most cases, you should not care about that other activity in the
background. It will be destroyed eventually, when the Grim Memory Reaper
comes around.

My problem is that I have no idea what you're trying to achieve, which
limits my answers to very tactical ones, directly addressing your
*questions* and not your core *problem*.

For example, from your original post on this thread:

What I want is for a user action (button press etc) to start the
service, which it does. Then I want the user, some time later, to
press another button to stop the service. Which it does.

None of that requires bindService() at all. Use startService() when the
user starts the service. Use stopService() when the user stops the
service. I have yet to figure out why you're messing with bindService() at
all -- not that there aren't reasons to use bindService(), but the pattern
you describe doesn't need it.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


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

2009-12-11 Thread Andrei
If I access my web site using https from my app will it break any
export laws?

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

2009-12-11 Thread Matt Kanninen
On Dec 11, 9:45 am, stanlick stanl...@gmail.com wrote:
 It sure seems like there is a lot of guess-and-be-golly with Android
 today.  I'm not complaining guys -- just stating my observation.

Today?  It always has, and always will be.  Although the problem could
be helped if Google starts hiring people specifically to improve the
Java docs.

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

2009-12-11 Thread kaloer
Hi,

I have a problem with my application. Sometimes, it closes after about
seven hours run because of an exception. I can really not figure out
why this exception is thrown, and I cannot have the device connected
to my computer for debugging in seven hours. However, I've used the
Thread.setDefaultUncaughtExceptionHandler() method to catch the
exception. When the exception is catched, the application writes a log
file to the SD-card with info about this.
The strange thing about this is, that the application calls this
method every single minute, but an exception is only thrown after
about seven hours. Do anyone have an idea about this, or are there any
tool I can use to discover what is wrong?

I have written this log file (method name - class name - line
number)  :

Error receiving broadcast Intent
{ action=android.intent.action.TIME_TICK flags=0x4004 (has
extras) } in org.kaloersoftware.kaloerclock.nightcloc...@435b39c0



run-android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args -
675
handleCallback-android.os.Handler - 587
dispatchMessage-android.os.Handler - 92
loop-android.os.Looper - 123
main-android.app.ActivityThread - 3948
invokeNative-java.lang.reflect.Method - -2
invoke-java.lang.reflect.Method - 521
run-com.android.internal.os.ZygoteInit$MethodAndArgsCaller - 782
main-com.android.internal.os.ZygoteInit - 540
main-dalvik.system.NativeStart - -2



Cause

---

checkSMS-org.kaloersoftware.kaloerclock.NightClock - 395
updateSmsIcon-org.kaloersoftware.kaloerclock.NightClock - 635
access$6-org.kaloersoftware.kaloerclock.NightClock - 633
onReceive-org.kaloersoftware.kaloerclock.NightClock$6 - 314
run-android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args -
664
handleCallback-android.os.Handler - 587
dispatchMessage-android.os.Handler - 92
loop-android.os.Looper - 123
main-android.app.ActivityThread - 3948
invokeNative-java.lang.reflect.Method - -2
invoke-java.lang.reflect.Method - 521
run-com.android.internal.os.ZygoteInit$MethodAndArgsCaller - 782
main-com.android.internal.os.ZygoteInit - 540
main-dalvik.system.NativeStart - -2


Thank you very much!

//Kaloer

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

2009-12-11 Thread Matt Kanninen
You catch out of memory?  I wasn't willing to do that yet, but it
would solve all my problems...

On Dec 11, 7:09 am, Streets Of Boston flyingdutc...@gmail.com wrote:
 If you're nulling your static bitmap in onPause why is it static to begin 
 with?

 E.g. to have access to bitmaps outside of my activity, in classes that
 don't have reference to my activities.

 Or, in case there can be multiple instance of an activity, these
 instances can share 'expensive' data. But this requires something a
 bit more sophisticated than just nulling the static in the 'onDestroy
 ()'.

 In my gallery app i use static caches of thumbnails that are capacity
 limited. These caches manage themselves and don't rely on onPause or
 onDestroy. I do catch OutOfMemoryExceptions then clean these caches
 explicitly and try the operation that threw the execption again. So
 far, this has been working for me :)

 On Dec 10, 8:27 pm, Matt Kanninen mathias...@gmail.com wrote:

  I don't get it.  If you're nulling your static bitmap in onPause why
  is it static to begin with?

  Also what you want to do is probably very different for a game that is
  basically all taking place in one activity and trying to avoid garbage
  collecting at all, compared to your standard Android app with an
  activity per screen.

  On Dec 10, 4:53 pm, Streets Of Boston flyingdutc...@gmail.com wrote:

   Statically held (caches of) bitmaps may come in very very handy.
   However, as soon as you do hold static references to 'expensive'
   resources, be sure to have a proper clean-up strategy. E.g. make sure
   the capacity of your cache of bitmaps is limited. Be sure to set the
   static reference to null when the activity is destroyed or paused,
   etc.

   On Dec 10, 6:05 pm, Matt Kanninen mathias...@gmail.com wrote:

I recommend the only things you make static be strings, and that for
everything else you are considering making static, instead write it to
file and use static methods, that expect to be passed a context, to
access the data.

I think my problems might be camera related, so my plan is to stop
using our own camera related activites and just use an intent to
launch the camera, and then read the returned result.

On Dec 10, 1:05 pm, fadden fad...@android.com wrote:

 On Dec 8, 12:28 pm, skominac stevan.komi...@gmail.com wrote:

  So not only is memory of static members not deallocated (which is
  actually not surprising), but the static references are still alive,
  pointing to the memory, and can be used to invoke the members back.
  This last part was surprising to me.

  This is actually not bad, as long as developers are aware of it.
  Is this Dalvik's feature?

 This is the expected behavior.  Keep in mind that the VM doesn't shut
 down between runs of your activity.  You are not necessarily starting
 with a clean slate.- Hide quoted text -

- Show quoted text -- Hide quoted text -

  - Show quoted text -



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


Re: [android-developers] Re: leaked window?

2009-12-11 Thread Greg Donald
On Fri, Dec 11, 2009 at 12:21 PM, Matt Kanninen mathias...@gmail.com wrote:
 Today?  It always has, and always will be.  Although the problem could
 be helped if Google starts hiring people specifically to improve the
 Java docs.

Yeah, seems a unsolvable situation.  Google only hires smart people
and smart people typically don't like to do documentation.


-- 
Greg Donald
http://destiney.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: Controlling my service from main activity

2009-12-11 Thread Neilz
Yes :-) we are going round in circles a bit!

The overiding problem for me is that the behaviours I described above
are causing different scenarios with my service. When I press 'back',
and then return to the activity, a new connection to the service is
created. Which results later in the service not being destoyed when I
tell it to, because there is the old connection still hanging around.
(Then, depending on user actions, I can get a leak error).

Why am I using bindService()? Well I thought I had to, I'm using an
aidl file with methods implemented to get stuff from the service...

On Dec 11, 6:14 pm, Mark Murphy mmur...@commonsware.com wrote:


 None of that requires bindService() at all. Use startService() when the
 user starts the service. Use stopService() when the user stops the
 service. I have yet to figure out why you're messing with bindService() at
 all -- not that there aren't reasons to use bindService(), but the pattern
 you describe doesn't need it.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.html

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Pick Contacts and dynamically adding into ListView.... Help!

2009-12-11 Thread Abhi
I guess I found the solution.

Abhishek

On Dec 11, 11:15 am, Abhi abhishek.r.sha...@gmail.com wrote:
 Hi

 I am copying my code below to do the above. The problem I have right
 now is after I have picked a Contact from the list, I am not able to
 add the name to the listview. I get a Force Close at that step. See
 point no. A below to understand what I am talking about.

 Also, the ListView is built using 'strings' ArrayList which is empty
 the very first time. The Menu option 'Add' is then used to pick a
 Contact and add the contact Name to the ArrayList which is then

 import android.app.ListActivity;
 import android.content.Intent;
 import android.database.Cursor;
 import android.net.Uri;
 import android.os.Bundle;
 import android.provider.MediaStore;
 import android.view.ContextMenu;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ContextMenu.ContextMenuInfo;
 import android.widget.ArrayAdapter;
 import android.widget.HeaderViewListAdapter;
 import android.widget.ListView;
 import android.widget.Toast;
 import android.view.View.OnLongClickListener;
 import android.provider.Contacts.People;

 import android.widget.AdapterView.AdapterContextMenuInfo;

 public class ListViewTest extends ListActivity {

         private Uri iSelectedImageURI = null;
         private ListView listView;
         private ListString strings;

 //      private static final int EDIT_ID = 1;
 //      private static final int DELETE_ID = 2;
         private static final int PICK_CONTACT = 3;

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

         setContentView(R.layout.list_view);
         listView = (ListView) findViewById(R.id.listView);

         strings = new ArrayListString();

        listView.setAdapter(new ArrayAdapterString(this,
 android.R.layout.simple_list_item_multiple_choice, strings));

         listView.setItemsCanFocus(false);
         listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

         // For Long Press on ListView items
         registerForContextMenu(listView);

     }

 @Override
     public boolean onCreateOptionsMenu(Menu menu) {

         MenuInflater inflater = getMenuInflater();
         inflater.inflate(R.menu.add_send, menu);

         return super.onCreateOptionsMenu(menu);
     }

 @Override
   public boolean onOptionsItemSelected(MenuItem item) {

                switch (item.getItemId()) {

                        case R.id.add:

                         Intent contact = new Intent(Intent.ACTION_PICK,
 People.CONTENT_URI);
                         startActivityForResult(contact, PICK_CONTACT);

                         return true;
               }
                       return true;
         }

 @SuppressWarnings(unchecked)
 @Override
     public void onActivityResult(int reqCode, int resultCode, Intent
 data){
          super.onActivityResult(reqCode, resultCode, data);

           switch (reqCode) {
         case (PICK_CONTACT):
              if (resultCode == RESULT_OK) {
                   Uri contactData = data.getData();
                   Cursor c = managedQuery(contactData, null, null, null,
 null);

                           if(c.moveToFirst()) {        //
 -
 POINT A

                                 String name = c.getString
 (c.getColumnIndexOrThrow(People.NAME));
                 strings.add(name);

 //              Toast.makeText(this, name, Toast.LENGTH_SHORT).show();  //
 --This works fine, I can read the Contact Name at this point.

                               ((ArrayAdapterString)
 ((HeaderViewListAdapter) listView.getAdapter()).getWrappedAdapter
 ()).notifyDataSetChanged();                // I think this is where
 the Problem comes. I am sure I am doing some stupid mistake.

                 }
             }

             break;
            }

 }
 }

 list_view.xml:

 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
         android:orientation=vertical
         android:layout_width=fill_parent
     android:layout_height=fill_parent
         ListView
                 android:id=@+id/listView
                 android:layout_width=fill_parent
                 android:layout_height=wrap_content/
 /LinearLayout

 Any help would be greatly appreciated. Thanks.

 Abhishek

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

2009-12-11 Thread Mark Murphy
 The overiding problem for me is that the behaviours I described above
 are causing different scenarios with my service. When I press 'back',
 and then return to the activity, a new connection to the service is
 created. Which results later in the service not being destoyed when I
 tell it to, because there is the old connection still hanging around.
 (Then, depending on user actions, I can get a leak error).

 Why am I using bindService()? Well I thought I had to, I'm using an
 aidl file with methods implemented to get stuff from the service...

If this is a local service (i.e., the activity and the service are in the
same project), you do not need AIDL. Use the local binder pattern, found
in the APIDemos, or another variant here:

http://github.com/commonsguy/cw-android/tree/master/Service/WeatherPlus/

You probably want to bind in onStart() and unbind in onStop(). Remember
that the service will run *either* if you are bound to it *or* if somebody
called startService() without a corresponding stopService()/stopSelf(). If
you bind in onStart() and unbind in onStop(), then your HOME button press
will unbind from the service...which will either shut down (if the user
didn't press Play or whatever is triggering startService()) or not (if
startService() indeed was called).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


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

2009-12-11 Thread one tow
Hello,
My emulator's Home key and Search key can not work, so i need to check if
the keymapping is right.
Any body know which file definite the emulator's scancode and keycode
mapping.
I can found the the keycode in this folder development/emulator/keymaps,
but where is scancode mapping file?

Thanks

BRs
Zacard Xu

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Where are the HTC dev phone 1 image package links?

2009-12-11 Thread Bob
Cool.  It works!

On Dec 9, 12:35 pm, Ryan Beesley ryan.bees...@swypeinc.com wrote:
 lbcoder posted this on one of the other groups:

 On Dec 7, 7:41 pm, lbcoder lbco...@gmail.com wrote:



  The page is just broken. The files are still there to download.

 http://member.america.htc.com/download/RomCode/ADP/{filename}
  You can find the filename in the link that you provided in the
  download column.

  Note: The website requires that you set the Referer: header to
  http:// developer.htc.com (or some subpath of that), so you won't be
  able to pull it with your web browser.

  You can use wget like this:
  wget --referer=http://developer.htc.com; PATH

  And that will get the file you're after.

  Note: All files you pull from there are subject to this
  license:http://developer.htc.com/io_device_license.htm--so don't claim that 
  you didn't know about it.

 -Original Message-
 From: android-developers@googlegroups.com 
 [mailto:android-develop...@googlegroups.com] On Behalf Of Tom Opgenorth
 Sent: Tuesday, December 08, 2009 6:06 PM
 To: android-developers@googlegroups.com
 Subject: Re: [android-developers] Where are the HTC dev phone 1 image package 
 links?

 Woops, my bad.  Those aren't for the ADP1, but for the Magic.  Does
 anybody know where a guy can get the 1.6 images for the Dream?  The
 links on HTC's page are still dead.

 On Tue, Dec 8, 2009 at 18:04, Tom Opgenorth opgeno...@gmail.com wrote:
  It seems that you can download the 1.6 images from here:
 http://developer.htc.com/google-io-device.html#s3

  On Thu, Dec 3, 2009 at 22:25, Chris Sokol adse...@slbsoftware.com wrote:
  The instructions for setting up the ADP1 direct me to the HTC
  Developer Center to download system images.  That page, at
 http://developer.htc.com/adp.html, does not have any links to system
  images - it says it does, but it does not.

  Does anyone know where I can find 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

  --
 http://www.opgenorth.net

 --http://www.opgenorth.net

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

 - Show quoted text -

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


[android-developers] getting the browser to use localhost in airplane mode

2009-12-11 Thread jami
Hi All,

I have been using an application called ankimini that is basically a
flash card application using ase and python.  To cut a long story
short it initiates a server that listens on 127.0.0.1:8000 and you
then view the flash cards using the browser.

This all works fine until you lose connectivity or switch on airplane
mode, then the browser complains that This application requires
network access even though I am only
going to 127.0.0.1:8000.

It looks like the browser checks if you are online before going to the
next page, regardless of what it is, but waits for a minute or so to
see if a connection is established before giving the: you need to be
connected error.

I tried another browser (dolphin) and it was similar, it says
something along the lines of: the page will continue being loaded once
you are back online.

If you have any idea how you can get the browser to go to localhost
when not connected please let me know.

Thanks,

Jamie

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

2009-12-11 Thread lidemin
hi all,
now  i have ported the Android to a x86 platform.
And i want to detect the USB plug-in.But follow the information about
the android.intent.action.MEDIA_MOUNTED
in the SDK's DOC, i can't receive the event of the USB's plug-in.

i have checked my code and it can receive the other event ( ps:intent
action) .

Besides, in the CLI, i could mount the USB device to /sdcard but it
couldn't mount automatically.

have seen some source code about the mount and mountlistener and it
should be effective.

who can tell me what the problem is?  and my SDK's version is 1.5.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: I can't launch layoutopt(using Window7)

2009-12-11 Thread lch1721
 My mistake. I did not see the last sentence.

Windows users: to start layoutopt, open the file called layoutopt.bat
in the tools directory of the SDK and on the last line, replace
%jarpath% with -jar %jarpath%

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

2009-12-11 Thread shomari
After being forced to move away from AbsoluteLayout (not because it
was depreciated, but because of the new screen densities that it
wouldn't support) I choose to use RelativeLayout (although FrameLayout
works the same way).

I was successful after making the following changes to ALL xml files:

1. Change AbsoluteLayout to either RelativeLayout or FrameLayout
2. Change android:layout_x = android:layout_marginLeft
3. Change android:layout_y = android:layout_marginTop

You should also start making more use of wrap_content and
fill_parent.
As well using android:layout_alignParent???=true (works only with
RelativeLayout, hence why I chose it).

Hope this helps

S.

On Dec 10, 1:28 am, sheng wang banxia...@gmail.com wrote:
 Hi,

 Since the absolutelayout is deprecated, how to put a widget (suck as a
 button)  on arbitary  (X,Y)

 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] what kind of Java in Android

2009-12-11 Thread EricWang
When I debug a program on Android, the debug info like this:
at java.io.ObjectStreamField.resolve(ObjectStreamField.java:351)
at java.io.ObjectInputStream.readNewClassDesc(ObjectInputStream.java:
1877)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:840)
at java.io.ObjectInputStream.readNewClassDesc(ObjectInputStream.java:
1882)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:840)
at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:
2080)
at java.io.ObjectInputStream.readNonPrimitiveContent
(ObjectInputStream.java:943)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2299)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2254)
..(Eliminate for some reason)

But when I looked into java.io.ObjectInputStream and
java.io.ObjectStreamField, some functions are not there, e.g.,
readNonPrimitiveContent(), readClassDesc(), resolve().

So, I am wondering, what kind of Java Android 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] landScape mode problem

2009-12-11 Thread ranjit
hello,
my app is working on portrait mode in good view support.but
when i m going for landscape
mode my app works but the background image stretched and the layout
display all but having right side blank.


i have given a image in result page which is in below part of
result.so when i go for landscape mode the image is in below part.i
want to take the image to right side blank part.what i have to do,
please help.

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


Re: [android-developers] Re: Camera crashes when taking pictures

2009-12-11 Thread 李務誠
We have fixed it in 2.0, and we are publishing a patch for manufacturers
that use 1.6. It will be up to individual manufacturers/carriers to decide
whether to make that patch available to existing users. For developers,
using setOneShotPreviewCallback will reduce the odds of the crash.

The bug/fix is as below.
diff --git a/core/jni/android_hardware_Camera.cpp
b/core/jni/android_hardware_Camera.cpp
index 9053468..d9b6e7b 100644
--- a/core/jni/android_hardware_Camera.cpp
+++ b/core/jni/android_hardware_Camera.cpp
@@ -112,7 +112,7 @@ void JNICameraContext::notify(int32_t msgType, int32_t
ext1, int32_t ext2)
 }
 JNIEnv *env = AndroidRuntime::getJNIEnv();
 env-CallStaticVoidMethod(mCameraJClass, fields.post_event,
-mCameraJObjectWeak, msgType, ext1, ext2);
+mCameraJObjectWeak, msgType, ext1, ext2, NULL);
 }

Wu-cheng
Android Software Engineer

On Tue, Dec 8, 2009 at 9:40 PM, bobbyjane_v vina.wib...@gmail.com wrote:

 hi,

 i'm having the same problem as yours. Funnily before it was fine. Just
 today. Have you already found a solution?

 On Nov 9, 10:05 am, merabi mera...@gmail.com wrote:
  Hi.
  im having a trouble getting Android's camera to work.
  i started CameraActivity Intent from MapActivity (when i start camera
  activity, i unresgister all listeners used in map activity), and when
  i call takepicture method, it just exits camera activity and return to
  map activity dumping strange msg showing below.
 
  the camera sounds off the shutter-sound and it crashes camera
  activity.
  sometimes it succeeds, and sometimes doesn't.
 
  it happens when im using docomo's HT-03A, 1.6sdk is installed.
 
  anyone having same trouble as i do?
 
  11-09 17:54:18.997: DEBUG/CameraService(51): takePicture (pid 19242)
  11-09 17:54:19.079: INFO/QualcommCameraHardware(51): deinitPreview E
  11-09 17:54:19.079: INFO/QualcommCameraHardware(51): deinitPreview X
  11-09 17:54:19.079: DEBUG/QualcommCameraHardware(51): frame_thread X
  11-09 17:54:19.117: DEBUG/QualcommCameraHardware(51): snapshot_thread
  E
  11-09 17:54:19.127: DEBUG/CameraService(51): startPreview (pid 19242)
  11-09 17:54:19.127: DEBUG/CameraService(51): startCameraMode(0) (pid
  19242)
  11-09 17:54:19.127: DEBUG/CameraService(51): startPreviewMode (pid
  19242)
  11-09 17:54:19.127: INFO/QualcommCameraHardware(51): initPreview E:
  preview size=480x320
  11-09 17:54:19.407: DEBUG/CameraService(51): postShutter
  11-09 17:54:19.497: WARN/AudioFlinger(51): write blocked for 94 msecs
  11-09 17:54:19.507: DEBUG/dalvikvm(19242): GC freed 2064 objects /
  138896 bytes in 270ms
  11-09 17:54:19.557: DEBUG/CameraService(51): postRaw
  11-09 17:54:19.587: DEBUG/QualcommCameraHardware(51): snapshot_thread
  X
  11-09 17:54:19.637: DEBUG/QualcommCameraHardware(51): frame_thread E
  11-09 17:54:19.977: DEBUG/CameraService(51): postJpeg
  11-09 17:54:19.977: DEBUG/Camera-JNI(19242): dataCallback(8, 0x1fd3f8)
  11-09 17:54:20.007: INFO/mm-camera-jpeg(51): freeing 21 jpeg memory
  leaks
  11-09 17:54:20.137: INFO/DEBUG(32481): *** *** *** *** *** *** *** ***
  *** *** *** *** *** *** *** ***
  11-09 17:54:20.137: INFO/DEBUG(32481): Build fingerprint: 'docomo/zaku/
  sapphire/sapphire:1.6/DRD08/16431:user/ota-rel-keys,release-keys'
  11-09 17:54:20.137: INFO/DEBUG(32481): pid: 19242, tid: 19248  
  android.mapoverlay 
  11-09 17:54:20.137: INFO/DEBUG(32481): signal 11 (SIGSEGV), fault addr
  98054b41
  11-09 17:54:20.137: INFO/DEBUG(32481):  r0   r1 032c  r2
  98054b21  r3 4674bdb4
  11-09 17:54:20.137: INFO/DEBUG(32481):  r4 0003  r5 4000c238  r6
  46755000  r7 ad084aa8
  11-09 17:54:20.137: INFO/DEBUG(32481):  r8 ad083e1c  r9 a9d223d9  10
  4000c238  fp ad083e1c
  11-09 17:54:20.137: INFO/DEBUG(32481):  ip 4000c1e8  sp 44497ac0  lr
  0003  pc ad01622c  cpsr 6010
  11-09 17:54:21.157: INFO/DEBUG(32481):  #00  pc 0001622c  /
  system/lib/libdvm.so
  11-09 17:54:21.157: INFO/DEBUG(32481):  #01  pc 00016cb4  /
  system/lib/libdvm.so
  11-09 17:54:21.167: INFO/DEBUG(32481):  #02  pc 000153e4  /
  system/lib/libdvm.so
  11-09 17:54:21.167: INFO/DEBUG(32481):  #03  pc 0001583c  /
  system/lib/libdvm.so
  11-09 17:54:21.167: INFO/DEBUG(32481):  #04  pc 000159a4  /
  system/lib/libdvm.so
  11-09 17:54:21.177: INFO/DEBUG(32481):  #05  pc 0005a90c  /
  system/lib/libdvm.so
  11-09 17:54:21.177: INFO/DEBUG(32481):  #06  pc 0005aa2c  /
  system/lib/libdvm.so
  11-09 17:54:21.177: INFO/DEBUG(32481):  #07  pc 0003f672  /
  system/lib/libdvm.so
  11-09 17:54:21.197: INFO/DEBUG(32481):  #08  pc 00051226  /
  system/lib/libandroid_runtime.so
  11-09 17:54:21.197: INFO/DEBUG(32481):  #09  pc 000514f2  /
  system/lib/libandroid_runtime.so
  11-09 17:54:21.207: INFO/DEBUG(32481):  #10  pc 00018cf2  /
  system/lib/libui.so
  11-09 17:54:21.207: INFO/DEBUG(32481):  #11  pc 0001e934  /
  system/lib/libui.so
  11-09 17:54:21.217: 

[android-developers] Eclipse Crashes

2009-12-11 Thread g...@devicedriven
Whenever i try to open the layout.xml file in eclipse..eclipse crashes
and exits without any messages..

However if i try to open the xml file without using the layout editor
of ADT plugin everything is fineit will open as an editable
file..the problem started only after i updated the latest version of
ADT...before that everything was working fione.

Does anyone else have the same problem?What should i do to rectify it??

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

2009-12-11 Thread zz zt1082
I need to configure the Setting through IActivityManager. But after adding
 import android.app.ActivityManagerNative; and import
android.app.IActivityManager in eclipse,  errors still exist that

ActivityManagerNative cannot be resolved
BackupManager cannot be resolved
IActivityManager cannot be resolved to a type
The import android.app.ActivityManagerNative cannot be resolved
The import android.app.IActivityManager cannot be resolved


when I check android.jar , don't find android.app.ActivityManageNative.class
and android.app.IActivityManager.

how to use them?

/** code **/

import android.app.ActivityManagerNative
import android.app.IActivityManager

Locale l = new Locale(zh, CN);
IActivityManager am = ActivityManagerNative.getDefault();
Configuration config = am.getConfiguration();

config.locale = l;

config.userSetLocale = true;

am.updateConfiguration(config);

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Application use of Haptics (When to enable/disable - minimizing confusion annoyance)

2009-12-11 Thread Steve Scherer
Is there a general guideline for application developers about when to
disable haptic responses?  I know there are ways to enable/disable
long-press haptics, but if an application was created to use haptic
feedback for other events are there guidelines that application
developers should follow?

For example, if the user was to go into Settings-Sound  display -
Haptic and set that to OFF, should all applications refer to this
setting as a rule of thumb?  From and end user point of view, I would
like to have global control of haptic feedback especially if I find it
to be annoying.  I have seen several postings in the android forums
looking for a global override to haptic responses.  Ultimately, I
think it is a question of should each application provide a menu to
enable/disable haptic support, or should this be more of a global
Setting for the device.  I personally feel applications should refer
to the global setting, but would like to get feedback from other
developers about this.

Reference postings I was referring to:
http://www.droidforums.net/forum/droid-general-discussions/6812-haptic-feedback-dial-pad.html
http://androidforums.com/samsung-moment/13633-how-do-you-disable-vibrating-feature-soft-keyboard.html

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

2009-12-11 Thread Valentino XM
Hello,
new to all of this. using Android 2.1 in Eclipse, all i want to do for
now is to get the video working in an Emulator via  videoview ..
little help would be vmuch apperciated.

cheers..



package info.shouraig.com;

import android.app.Activity;
import android.content.res.AssetFileDescriptor;
import android.media.MediaPlayer.OnCompletionListener;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;

public class XSO4 extends Activity {
VideoView XSO4;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

AssetFileDescriptor afd = getResources().openRawResourceFd
(R.raw.XSCycling.mp4);

// Create a new media player and set the listeners
XSO4 = new VideoView(null);
VideoView. setDataSource(afd.getFileDescriptor(),
afd.getStartOffset(), afd.getLength());

VideoView video = (VideoView) this.findViewById(R.id.videoXSO4);



Uri uri = Uri.parse(android.resource://info.shouraig.com/ +
R.raw.XSCycling.mp4);
video.setVideoURI(uri);
video.setMediaController(new MediaController(this));
video.requestFocus();
video.setOnCompletionListener((OnCompletionListener) this);
video.start();


}
}

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

2009-12-11 Thread Mikael
Hi,

I'm having problems getting adb recognize my acer liquid.
I tried modifying ~/.android/adb_usb.ini by adding the line 0x0502
and restarted the adb server but still nothing.
Anyone being more lucky?

Thanks,
Mikael

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

2009-12-11 Thread 李務誠
On Fri, Dec 11, 2009 at 9:33 PM, Will var...@yahoo.co.uk wrote:

 I want to make a motion-jpeg.

 This is not a video format that is supported by the built-in codecs.

 One approach I've looked at is to use the preview callback, asking for
 a JPEG buffer.  Unfortunately, the HTC phones I've tried this on all
 call back at several second intervals and give me an NV12 buffer

It should be NV21 (http://www.fourcc.org/yuv.php#NV21), not NV12.

 regardless of the pixel format you specify.  (Anyone know the
 behaviour on a droid?)  I can code my way around the NV12 hassle but I

Droid supports NV21 (PixelFormat.YCbCr_420_SP) and YUY2
(PixelFormat.YCbCr_422_I). In 2.0 and after, apps can call
getSupportedPreviewFormats to know the supported preview formats on devices.
But only NV21 is guaranteed to be supported on all devices on all releases.
In 1.6 and before, there is no way to know the supported preview formats and
apps should just use NV21.

 can't exactly do much when the callbacks are so seldom; I want around
 10 fps.

 The approach I was considering was making an opencore codec for
 mjpeg.  Which leads me to two questions before I start:

 1) can third-parties make and install opencore codecs, or is this
 strictly locked down?  Is it to just drop an .so in the right folder,
 or?

 2) do the HTC phones use the default encoders?  (i.e. will using the
 same way the default opencore reference codecs get their pixel buffers
 work on the phone?)

 thx
 Will

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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] How to use existing contact create app of device

2009-12-11 Thread vikram deshpande
I want to invoke my application once user creates / updates contact
from his device.
i.e once user hit Done button. is it possible ? If possible please
provide sample code or link.

Please help and 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] Fail to build Android platform source code, need help

2009-12-11 Thread mundou
Hi, all!

I'm building android platform source code on Fedora 11, with
jdk1.5.0_21. I used git to get the entire project from /platform/
manifest.git. When I build the source, it fails with the following
message:


Install: out/host/linux-x86/framework/dx.jar
Copy: dx (out/host/linux-x86/obj/EXECUTABLES/dx_intermediates/dx)
Install: out/host/linux-x86/bin/dx
target Dex: core
Exception in thread main java.lang.NoClassDefFoundError:
com.android.dx.command.Main
   at gnu.java.lang.MainThread.run(libgcj.so.10)
Caused by: java.lang.ClassNotFoundException:
com.android.dx.command.Main not found in
gnu.gcj.runtime.SystemClassLoader{urls=[],
parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.10)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.10)
   at java.lang.ClassLoader.loadClass(libgcj.so.10)
   at java.lang.ClassLoader.loadClass(libgcj.so.10)
   at gnu.java.lang.MainThread.run(libgcj.so.10)
make: *** [out/target/common/obj/JAVA_LIBRARIES/core_intermediates/
classes.dex] error 1


It seems that someone has met this kind of error before but
unfortunately no solution is provided. Can somebody kindly give me
some advice to this?


Thanks very much, mundou


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

2009-12-11 Thread shomari
I must say that I have really enjoyed reading this thread to see how
both sides view this issue so passionately.  As I've grown in my study
and understanding of the Android platform, many of these issues HAVE
frustrated the hell out of me, but I've come to just accept them.

 And as far as the lock screen goes -- nobody has said that there would never
 be support for third party lock screens.

Why can't this issue simply be resolved by disabling the lock screen
with disableKeyguard() and the android.permission.DISABLE_KEYGUARD
permission.  I've done this in a security app and it seems to work
just fine.  I can create my own Lock Screen with ANY content that I
want.

 Taking over the home key will not be done with a permission, period.

Why this is, I have no idea and I'd have to agree with Greg:

 The current lock app doesn't recognize input from the home button, so
 using that as a reason to not allow any other lock apps is hypocrisy.

Seems to me that this should be up to the users.  Why would Google
even want to override what its users think is best for them, when
they've developed a solid permissions system that seems to work just
fine everywhere else?  There have been countless attempts to build
better security apps, ALL of which can be (as Dianne put it)
BROKEN.  How is this an Android feature?  Just imagine if MS was the
only one allowed to create anti-virus or security apps for Windows
(crazy!)

Anyway, there is after all the option to set a Home Screen replacement
as a Use by default for this action, which I think would solve the
Home Button problem (for Security, Toddler Lock apps and such).

Google has done what no one else in the industry has done, which is to
provide us with the ability to create and use an Open distro, with
little trouble (see CyanogenMod and JesusFreak).  So, in the end,
that's probably the answer.  At least 1 alternative distro should be
popularly supported for users that need just a bit more...

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] Re: Controlling my service from main activity

2009-12-11 Thread Neilz
That's not *quite* what I'm after... I want the service to continue
running (whatever happens to the calling activity) and then later
(i.e. 2 hours) when the user calls the activity again (could be
recreated or restarted) the service can be bound to, information
collected from it, and then destroyed.

Yes, that sums it up. Does the model you suggest still fit?!

On Dec 11, 6:43 pm, Mark Murphy mmur...@commonsware.com wrote:

 You probably want to bind in onStart() and unbind in onStop(). Remember
 that the service will run *either* if you are bound to it *or* if somebody
 called startService() without a corresponding stopService()/stopSelf(). If
 you bind in onStart() and unbind in onStop(), then your HOME button press
 will unbind from the service...which will either shut down (if the user
 didn't press Play or whatever is triggering startService()) or not (if
 startService() indeed was called).


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


Re: [android-developers] Re: Controlling my service from main activity

2009-12-11 Thread Mark Murphy
 That's not *quite* what I'm after... I want the service to continue
 running (whatever happens to the calling activity) and then later
 (i.e. 2 hours) when the user calls the activity again (could be
 recreated or restarted) the service can be bound to, information
 collected from it, and then destroyed.

 Yes, that sums it up. Does the model you suggest still fit?!

Presumably. Of course, I really wish you wouldn't write an app like that:

http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-are-not/

All you are going to do is get task killers attacking your app because you
drain the battery.

But, assuming your proposed implementation is unavoidable:

-- call startService() whenever whatever triggers the start collecting
data now stuff

-- call bindService() in onStart()

-- call unbindService() in onStop()

-- call stopService() whenever whatever triggers the stop collecting data
now stuff

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


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

2009-12-11 Thread superjet
Bump? Nothing at all? Certainly someone has done this! Please share,
or offer me a place to get more guidance! I would prefer not to
override all of view and make my own buttons.

sj

On Dec 8, 9:52 am, superjet superje...@gmail.com wrote:
 Hi, I've made a little testcomponentthat overrides ImageView, called
 myImageView, and prints some text and an arrayList of Doubles over
 whatever image is specified in the related xml.

 However, right now, the text and Doubles that are drawn over the image
 are defined within the myImageView class. Is there a way to pass the
 data from the main onCreate function to the myImageView class before
 the layout is drawn?

 I'm new to OO programming, but based on my understanding of 
 this:http://developer.android.com/guide/topics/ui/custom-components.html
 it's possible because ImageView is just like any other class. This
 leaves me with two initial guesses:
 1.  I could generate my test data in the main onCreate, and store it
 in the array's xml file, and then read that xml file with
 myImageView,

 OR 2.  I could extend view instead of ImageView, but because of my new-
 ness, then I would lose the ability to use it in an xml layout sense -
 and that's what I really want.

 Thanks for any tips, or references! I can post code if needed, but
 this is more of an approach question.
 sj

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

2009-12-11 Thread Mo
Hi Dimitry,
Can you shed some light on this?

BR

On Dec 10, 9:00 pm, Mo ladn...@gmail.com wrote:
 Hi,
 I was trying to register for any changes to the Contact.People DB as
 follows:
        registerContentObserver(Contacts.People.CONTENT_URI, true, co);
 And in my ContentObserver class I had the following:
              public void onChange(boolean change) {
                 Log.v(  Contact List updated );
                 }

 This use to work in Cupcake and I use to get the call to onChange
 only when a new contact was added, a contact was deleted or an
 existing contact was modified. But in Eclair I keep on receiving
 'onChange even after a call has been made to an existing contact (I
 guess because of the last_time_contacted  field in the DB).

 I tried registering for other DB (like Data and Raw_Contacts) also
 but experienced same issue.

 My question was that for Eclair is there a DB that I can register for
 which will only be triggered if a new contact was added or old contact
 was deleted or the contact name was modified?
 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: Moving from Cupcakle to Eclair: ContentObserver is broken

2009-12-11 Thread Mo
Hi Dimitry,
Can you shed some light on this?

BR

On Dec 10, 9:00 pm, Mo ladn...@gmail.com wrote:
 Hi,
 I was trying to register for any changes to the Contact.People DB as
 follows:
        registerContentObserver(Contacts.People.CONTENT_URI, true, co);
 And in my ContentObserver class I had the following:
              public void onChange(boolean change) {
                 Log.v(  Contact List updated );
                 }

 This use to work in Cupcake and I use to get the call to onChange
 only when a new contact was added, a contact was deleted or an
 existing contact was modified. But in Eclair I keep on receiving
 'onChange even after a call has been made to an existing contact (I
 guess because of the last_time_contacted  field in the DB).

 I tried registering for other DB (like Data and Raw_Contacts) also
 but experienced same issue.

 My question was that for Eclair is there a DB that I can register for
 which will only be triggered if a new contact was added or old contact
 was deleted or the contact name was modified?
 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: Controlling my service from main activity

2009-12-11 Thread Neilz
 Presumably. Of course, I really wish you wouldn't write an app like that:

 http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-a...

 All you are going to do is get task killers attacking your app because you
 drain the battery.

Well in this instance I will be telling the user not to do so, and the
nature of the service will make it quite clear that this would be the
case, they would know not to do it.

 But, assuming your proposed implementation is unavoidable:

 -- call startService() whenever whatever triggers the start collecting
 data now stuff

 -- call bindService() in onStart()

 -- call unbindService() in onStop()

 -- call stopService() whenever whatever triggers the stop collecting data
 now stuff

Ok, will try that - though I seem to remember if I called unBind()
then I couldn't rebind later...

Many thanks.

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


[android-developers] Re: Acer Liquid on Ubuntu

2009-12-11 Thread Andrei
look at the bottom of
http://developer.android.com/guide/developing/device.html

On Dec 11, 11:12 am, Mikael mikael.rous...@gmail.com wrote:
 Hi,

 I'm having problems getting adb recognize my acer liquid.
 I tried modifying ~/.android/adb_usb.ini by adding the line 0x0502
 and restarted the adb server but still nothing.
 Anyone being more lucky?

 Thanks,
 Mikael

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

2009-12-11 Thread Mark Murphy
 Well in this instance I will be telling the user not to do so, and the
 nature of the service will make it quite clear that this would be the
 case, they would know not to do it.

Okee-dokee. Just remember: users rarely RTFM.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


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

2009-12-11 Thread Matt Kanninen
Can I ask what Android does with un caught OutOfMemoryErrors that it
wouldn't do if I caught them?  It's really tempting for me to do this:

try {
setContentView(R.layout.result);
} catch (OutOfMemoryError E) {
   outOfMemoryCount++;
 e.printStackTrace();
  finish();
}

If I don't catch the OutOfMemory my activity crashes, but then the
user just clicks the button again and it loads great the second time.
So something happens resulting in the right memory being cleared.

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

2009-12-11 Thread Mark Murphy
 I'm using Android 1.5_r2. In the following code I was trying to auto
 dial:

 Intent intent = new Intent( Intent.ACTION_CALL,
 Uri.parse(tel:+ **76*1234567890*#));
 activity.startActivity( intent );

 the dial screen come up but the number it actually dialed is
 **76*1234567890*. Is Android removing the trialing #? Or I need to
 use some special escape character to preserve # in the dialing uri?

# is a reserved character in URLs, so that might be your problem. You
could see if %23 works instead of #.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


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

2009-12-11 Thread Matt Kanninen
Not as described.  It is possible to break US export laws from code,
but its hard to do without seeing a big warning first.  IIRC you have
to code your own cryptography and make it too strong.  It's silly, and
I hope the law I'm thinking of isn't actually enforced anymore.

On Dec 11, 10:16 am, Andrei gml...@gmail.com wrote:
 If I access my web site using https from my app will it break any
 export laws?

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

2009-12-11 Thread Matt Kanninen
Statics are just the first thing to check.

On Dec 11, 5:32 am, Mark Hansen stonedon...@gmail.com wrote:
 So I did get the crashes to stop, and I have a idea of why it works...
 anyways.. I updated the onWindowFocusChange set the backGroundDrawable
 to null when the app loses focus.  I also do this on the onDestroy()
 and onPause() methods as well.

 My guess is that the app goes into pause mode and when restarted since
 I was reattaching the same animation to the ImageView it was causing a
 leak.

 Note this ImageView and Animation were not static variables they were
 loaded only on the onWindowFocusChange event.  I made the assumption
 since I was not letting my ImageView and Animation be created as
 static variables I wouldn't leak the Context, but apparently the
 recreation of the animation attachment to the ImageView was for some
 reason, this I'm not 100% sure on, but it seems to be the case.

 On Dec 10, 7:53 pm, Romain Guy romain...@android.com wrote:

  DDMS has a feature to dump the Java heap. You can then analyze is
  using tools like hat, MAT, JProfiler, etc.

  On Thu, Dec 10, 2009 at 4:17 PM, Matt Kanninen mathias...@gmail.com wrote:
   Got any advice on tools to use to debug the most likely situation
   you've described?  I'm at the point where I've ruled out static
   variables.

   I'm working on code that started with Android 1.0, and has had a
   series of developers since.  Good code analysis tools could help
   immensely.  It beats re writing every class.

   On Dec 10, 3:47 pm, Romain Guy romain...@android.com wrote:
   If there's an OutOfMemoryError, it's most likely that the app is using
   too much memory and/or leaking. Filing a bug won't help.

   On Thu, Dec 10, 2009 at 3:43 PM, Matt Kanninen mathias...@gmail.com 
   wrote:
Best of luck.  I recommend you create a very small test application to
reproduce the bug, and submit it to b.android.com.

On Dec 10, 12:52 pm, Mark Hansen stonedon...@gmail.com wrote:
So I want to start an animation when my application starts that always
visible in the application.  So reading about the AnimationDrawable it
was stated to use onWindowFocusChanged instead of onCreate() to ensure
that animation would start properly in the UI thread.

        @Override
        public void onWindowFocusChanged(boolean hasFocus) {
                super.onWindowFocusChanged(hasFocus);

                AnimationDrawable cam;
                ImageView iv = 
(ImageView)findViewById(R.id.ImageViewFuzzAnimation);
                iv.setBackgroundResource(R.anim.fuzz_animation);
                cam = (AnimationDrawable)iv.getBackground();
                cam.start();

        }

This works fine, but if I leave my application and come back I get a
out of memory error, below is the log..

Can anyone help me out on what I may be doing wrong here?

12-10 15:52:14.365: ERROR/dalvikvm-heap(3102): 805600-byte external
allocation too large for this process.
12-10 15:52:14.373: ERROR/(3102): VM won't let us allocate 805600
bytes
12-10 15:52:14.373: DEBUG/skia(3102): --- decoder-decode returned
false
12-10 15:52:16.490: DEBUG/dalvikvm(1570): GC freed 797 objects / 43592
bytes in 94ms
12-10 15:52:20.147: DEBUG/AndroidRuntime(3102): Shutting down VM

12-10 15:52:20.147: ERROR/AndroidRuntime(3102): Uncaught handler:
thread main exiting due to uncaught exception
12-10 15:52:20.232: ERROR/AndroidRuntime(3102):
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:447)
12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:
323)
12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
android.graphics.drawable.Drawable.createFromResourceStream
(Drawable.java:697)
12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
android.content.res.Resources.loadDrawable(Resources.java:1705)
12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
android.content.res.Resources.getDrawable(Resources.java:580)
12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
android.graphics.drawable.AnimationDrawable.inflate
(AnimationDrawable.java:265)
12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:
788)
12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
android.content.res.Resources.loadDrawable(Resources.java:1690)
12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at

[android-developers] DatePicker - resizes as you pick different dates?

2009-12-11 Thread Mark Wyszomierski
Hi,

I'm using the DatePicker class, sample here:

http://developer.android.com/guide/tutorials/views/hello-datepicker.html

when you start selecting different dates from the picker, the dialog
will resize itself as the label up top [with the selected date]
updates itself - this is really distracting - is there any way to get
the dialog to *not* resize itself when picking dates!

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: notifyDataSetInvalidated does *not* reset scroll position

2009-12-11 Thread WoodManEXP
I have run into the same thing in 1.6 in that sometimes
notifyDataSetInvalidated sends the list back to the top and sometimes
it does not. Here is a block of code that seems to work (at least it
has not not worked yet in testing).

lViewAdapter.notifyDataSetInvalidated(); // New data, this does not
depenably set the list back to the top
lView.setSelectionFromTop(0,0); // This seems to help the list get
back to the top

Of course lViewAdapter is the adapter attached to lView.


On Dec 6, 2:50 pm, ggcespia g...@boopsie.com wrote:
 Hello - does anyone have a work around for this 'new' behavior.  The
 idea would be to reset the scroll position like
 notifyDataSetInvalidated() used to do...

 On Nov 23, 6:02 pm, ggcespia g...@boopsie.com wrote:

  In the 1.5 OS, the notifyDataSetInvalidated() not only invalidated the
  data source, but also reset the scroll position to the 'top' of the
 listview- so if you then called notifyDataSetChanged(), theListView
  redrew with the new data *and* positioned thelistviewat the top.
  On the DROID in OS 2.0, this behaves differently, the
  notifyDataSetInvalidated() does *not* reset the scroll position.  I
  need it to reset the scroll position...like it used to.   Any ideas
  how to reset the scroll position?



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

2009-12-11 Thread Andriy Tsykholyas
John and Mark,

thanks for your answers :)

On Dec 10, 7:50 pm, Mark Murphy mmur...@commonsware.com wrote:
  My idea is to put this data as a file in the .apk. Then, on initial
  application launch to read this data and populate Android SQLite
  database with it. Then just work with this database. But after the
  database is populated the data file is no longer needed. And I'd like
  to remove it to free some memory.

 The APK file cannot be modified at runtime, so you will not be able to
 delete your data file if it is packaged in the APK. If you download the
 data file after install, you can delete the downloaded data file after
 conversion to SQLite (or just download it in SQLite format in the first
 place).

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.html

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

2009-12-11 Thread sherry
Thanks. It works!

Sherry

On Dec 11, 11:20 am, Mark Murphy mmur...@commonsware.com wrote:
  I'm using Android 1.5_r2. In the following code I was trying to auto
  dial:

                  Intent intent = new Intent( Intent.ACTION_CALL,
  Uri.parse(tel:+ **76*1234567890*#));
                  activity.startActivity( intent );

  the dial screen come up but the number it actually dialed is
  **76*1234567890*. Is Android removing the trialing #? Or I need to
  use some special escape character to preserve # in the dialing uri?

 # is a reserved character in URLs, so that might be your problem. You
 could see if %23 works instead of #.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.html

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


[android-developers] Re: GPS beacon vs. locked

2009-12-11 Thread jeffro
You might be better off checking the accuracy of your GPS location
instead.  Even though GPS is locked, your GPS accuracy may be too poor
for what you need for your application.

/* (non-Javadoc)
 * @see android.location.LocationListener#onLocationChanged
(android.location.Location)
 */
public void onLocationChanged(Location location) {
//check gps accuracy
if(location.getAccuracy()100) //process if accuracy is good 
100
meters

Jeff

Trackaroo.com
Trackmaster - Motorsports Lap Timer http://trackmaster.trackaroo.com
Dynomaster - Performance Dyno http://dynomaster.trackaroo.com

On Dec 11, 9:10 am, stanlick stanl...@gmail.com wrote:
 I am trying to determine whether satellites are being acquired or if a
 lock has been acquired.  I can see this with a pulsing vs. fixed dish
 icon on the notification bar, but so far I have not quite achieved a
 solution in code.

 Apparently this does nor necessarily mean LOCK_ACQUIRED?

         @Override
         public void onGpsStatusChanged(int event) {
                 if (GpsStatus.GPS_EVENT_STARTED == event) {
                         //1
                         setGpsAvailable(true);
                 }

         }

 Peace,
 Scott

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


  1   2   >