[android-developers] Re: Conversion to Dalvik format failed with error
Did you try on SDK/emulator, or on real HTC G1? As far as I have tried, I never got video to work on the emulator. On Thu, Apr 9, 2009 at 9:34 PM, Nithin Varamballi wrote: > > Thank you sir.. Can you know how live video streaming can be done... I > tried demo > sample But i give error like"Cannot play the video". > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: When will google post official cupcake SDK
When the fix is in the open source repo I'll roll some new SDKs. As for a date for a Google originated SDK, there's no solid commitment to a date as yet. Al. --- * Written an Android App? - List it at http://andappstore.com/ * == Funky Android Limited is registered in England & Wales with the company number 6741909. The registered head office is Kemp House, 152-160 City Road, London, EC1V 2NX, UK. The views expressed in this email are those of the author and not necessarily those of Funky Android Limited, it's associates, or it's subsidiaries. -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of Howie Sent: 10 April 2009 05:22 To: Android Developers Subject: [android-developers] Re: When will google post official cupcake SDK When is Google planning on distributing an SDK that does not have such a bug? On Apr 9, 12:16 pm, Romain Guy wrote: > The SDK Al is distributing contains a bug that prevents the emulator > from using the network. > > On Thu, Apr 9, 2009 at 11:59 AM, Mattaku Betsujin > > > > wrote: > > Thanks Al. I downloaded it. Works great. > > > However, I couldn't connect to the network. E.g., launching browser > > will show an error page. logcat reports "Unknown hostwww.google.com, > > throwing UnknownHostException". > > > I have a 1.0 emulator working on the same PC and it can access > > network just fine. > > > I tried passing -dns-server to emulator.exe, but that just made > > emulator.exe to crash on start-up. > > > Thanks > > > On Thu, Apr 9, 2009 at 11:23 AM, Al Sutton wrote: > > >>http://andappstore.com/AndroidPhoneApplications/sdk/ > > >> --- > > >> * Written an Android App? - List it athttp://andappstore.com/* > > >> == > >> Funky Android Limited is registered in England & Wales with the > >> company number 6741909. The registered head office is Kemp House, > >> 152-160 City Road, London, EC1V 2NX, UK. > > >> The views expressed in this email are those of the author and not > >> necessarily those of Funky Android Limited, it's associates, or > >> it's subsidiaries. > > >> > >> From: android-developers@googlegroups.com > >> [mailto:android-develop...@googlegroups.com] On Behalf Of Mattaku > >> Betsujin > >> Sent: 09 April 2009 19:22 > >> To: android-developers@googlegroups.com > >> Subject: [android-developers] When will google post official > >> cupcake SDK > > >> Even a "beta" SDK would be helpful. There are lots of app > >> developers who don't necessarily know how to build cupcake from the > >> GIT. Given that HTC Magic (based on cupcake, I heard) is rolling > >> out real soon now, wouldn't it be nice to give the app developers a > >> chance to test if their app is compatible with cupcake? > > >> Sure, Android API is supposed to be backwards compatible. However, > >> there are quite a few bugs in the G1 that I had to work around with ugly hacks. > >> Now I start to worry if those hacks would break on cupcake. > > -- > 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] showing graph in Application
Hello I want to display graph(time ver distance) in Activity , how should be this achieved in Android. is there any tut available? Thank you --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Key dispatching timed out
hi Streets Of Boston, Thanks for your reply.. I am new to android develoment.. Here is my code.. Kindly tell me what change i should do in this. Im downloading the image in a separate thread. But im calling the thread inside onCreate(). Is this the problem? Thanks. import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.net.URL; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.os.Handler; import android.widget.ImageView; public class ViewStorageImage extends Activity{ private String url; ImageView iv; Runnable viewActualImage; Handler storageActualImageHandler; Thread t; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent i = getIntent(); Bundle ext = i.getExtras(); url = ext.getString("url"); storageActualImageHandler = new Handler(); viewActualImage = new Runnable() { public void run() { viewImage(); } }; new Thread() { @Override public void run() { storageActualImageHandler.post(viewActualImage); } }.start(); } public void viewImage() { try { URL myURL = new URL(url); final BufferedInputStream bis = new BufferedInputStream(myURL .openStream(), 1024); final ByteArrayOutputStream dataStream = new ByteArrayOutputStream (); BufferedOutputStream out = new BufferedOutputStream(dataStream, 1024); copy(bis, out); out.flush(); final byte[] data = dataStream.toByteArray(); BitmapFactory.Options bfo = new BitmapFactory.Options(); bfo.inSampleSize = 2; Bitmap bm = BitmapFactory .decodeByteArray(data, 0, data.length, bfo); bis.close(); iv=new ImageView(getApplicationContext()); iv.setImageBitmap(bm); setContentView(iv); } catch (Exception e) { } } static final int BUFF_SIZE = 1024; static final byte[] buffer = new byte[BUFF_SIZE]; public static void copy(BufferedInputStream in, BufferedOutputStream out) throws IOException { try { while (true) { synchronized (buffer) { int amountRead = in.read(buffer); if (amountRead == -1) { break; } out.write(buffer, 0, amountRead); } } } catch(Exception e) { if (in != null) { in.close(); } if (out != null) { out.close(); } } finally { if (in != null) { in.close(); } if (out != null) { out.close(); } } } } On Apr 9, 8:46 pm, Streets Of Boston wrote: > How are you downloading your images? > Are you doing this in your main message-thread? (e.g. in a > onSomethingSomething(...) method?) > > If so, this causes your problem. > > Start a new thread. Have this thread download your image when > necessary. > When you thread is done, have it post back to the main message-thread > with the resulting bitmap. > > On Apr 9, 10:12 am, Ramesh wrote: > > > hi, > > I am working on an android project where the local and remote image > > files and their thumbnails are to be displayed. Now i have a problem > > with displaying the remote images. If i click the back button when the > > application is connected with the server, It waits for few seconds and > > forces my application to close. Log has a message "Key dispatching > > timed out". Once the image has downloaded completely back button is > > working, Here is my log
[android-developers] Re: Conversion to Dalvik format failed with error
Thank you sir.. Can you know how live video streaming can be done... I tried demo sample But i give error like"Cannot play the video". --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Conversion to Dalvik format failed with error
They don't use the JMF on Android, they use JMF on the dekstop to broadcast images to the emulator. On Thu, Apr 9, 2009 at 9:24 PM, Nithin Varamballi wrote: > > Thanks for reply > > But i saw in site http://www.tomgibara.com/android/camera-source > In that they use the JMF > > > > -- 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] Live Video streaming
HI to all Can anyone knows how Live Video streaming can be done Thanks in advance Nithin N V --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Conversion to Dalvik format failed with error
Thanks for reply But i saw in site http://www.tomgibara.com/android/camera-source In that they use the JMF --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: When will google post official cupcake SDK
When is Google planning on distributing an SDK that does not have such a bug? On Apr 9, 12:16 pm, Romain Guy wrote: > The SDK Al is distributing contains a bug that prevents the emulator > from using the network. > > On Thu, Apr 9, 2009 at 11:59 AM, Mattaku Betsujin > > > > wrote: > > Thanks Al. I downloaded it. Works great. > > > However, I couldn't connect to the network. E.g., launching browser will > > show an error page. logcat reports "Unknown hostwww.google.com, throwing > > UnknownHostException". > > > I have a 1.0 emulator working on the same PC and it can access network just > > fine. > > > I tried passing -dns-server to emulator.exe, but that just made emulator.exe > > to crash on start-up. > > > Thanks > > > On Thu, Apr 9, 2009 at 11:23 AM, Al Sutton wrote: > > >>http://andappstore.com/AndroidPhoneApplications/sdk/ > > >> --- > > >> * Written an Android App? - List it athttp://andappstore.com/* > > >> == > >> Funky Android Limited is registered in England & Wales with the > >> company number 6741909. The registered head office is Kemp House, > >> 152-160 City Road, London, EC1V 2NX, UK. > > >> The views expressed in this email are those of the author and not > >> necessarily those of Funky Android Limited, it's associates, or it's > >> subsidiaries. > > >> > >> From: android-developers@googlegroups.com > >> [mailto:android-develop...@googlegroups.com] On Behalf Of Mattaku Betsujin > >> Sent: 09 April 2009 19:22 > >> To: android-developers@googlegroups.com > >> Subject: [android-developers] When will google post official cupcake SDK > > >> Even a "beta" SDK would be helpful. There are lots of app developers who > >> don't necessarily know how to build cupcake from the GIT. Given that HTC > >> Magic (based on cupcake, I heard) is rolling out real soon now, wouldn't it > >> be nice to give the app developers a chance to test if their app is > >> compatible with cupcake? > > >> Sure, Android API is supposed to be backwards compatible. However, there > >> are quite a few bugs in the G1 that I had to work around with ugly hacks. > >> Now I start to worry if those hacks would break on cupcake. > > -- > 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: Conversion to Dalvik format failed with error
You cannot use Java MediaFramework with Android. On Thu, Apr 9, 2009 at 9:09 PM, Nithin wrote: > > Hi to all > > I include JMF in my application. When i run my application > the following type of error > will occurring... > > [2009-04-09 16:20:03 - nithin] > trouble processing "javax/sound/midi/ControllerEventListener.class": > [2009-04-09 16:20:03 - nithin] > Attempt to include a core VM class in something other than a core > library. > It is likely that you have attempted to include the core library from > a desktop > virtual machine into an application, which will most assuredly not > work. If > you really intend to build a core library -- which is only appropriate > as > part of creating a full virtual machine binary, as opposed to > compiling an > application -- then use the "--core-library" option to suppress this > error > message. If you go ahead and use "--core-library" but are in fact > building > an application, then please be aware that your build will still fail > at some > point; you will simply be denied the pleasure of reading this helpful > error > message. > [2009-04-09 16:20:03 - nithin] 1 error; aborting > [2009-04-09 16:20:03 - nithin] Conversion to Dalvik format failed with > error 1 > > Can anyone tell me that how can i resolve this error > > Thank You > Nithin N V > > > > -- 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] JavaMediaFramework
HI to all. Is it possible to include JavaMediaFramework for android application --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Conversion to Dalvik format failed with error
Hi to all I include JMF in my application. When i run my application the following type of error will occurring... [2009-04-09 16:20:03 - nithin] trouble processing "javax/sound/midi/ControllerEventListener.class": [2009-04-09 16:20:03 - nithin] Attempt to include a core VM class in something other than a core library. It is likely that you have attempted to include the core library from a desktop virtual machine into an application, which will most assuredly not work. If you really intend to build a core library -- which is only appropriate as part of creating a full virtual machine binary, as opposed to compiling an application -- then use the "--core-library" option to suppress this error message. If you go ahead and use "--core-library" but are in fact building an application, then please be aware that your build will still fail at some point; you will simply be denied the pleasure of reading this helpful error message. [2009-04-09 16:20:03 - nithin] 1 error; aborting [2009-04-09 16:20:03 - nithin] Conversion to Dalvik format failed with error 1 Can anyone tell me that how can i resolve this error Thank You Nithin N V --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Send Email Automatically
Thank you for the quick answer Dianne. It confirms that I'll just have to include another implementation of SMTP into my app. Though I still think it would be nice if could set up an Intent, loaded with the proper information in an attached bundle that would specify the email account, the account authentication, and the message body. Which would be handled by an application that the user had configured as the default email handling application without user intervention. Hmmm, actually this might make an interesting little project to continue my Android education. Understand it's not possible at the moment though, through standard resources.. Best, Eileen Novack From: Dianne Hackborn Sent: Thursday, April 09, 2009 2:19 PM To: android-developers@googlegroups.com Subject: [android-developers] Re: Send Email Automatically On Wed, Apr 8, 2009 at 5:58 AM, Eileen Novack wrote: I have been following this thread with some interest. Since I also want to be able to send an email without any user intervention. Now before anyone says that should not be possible since it would be a security problem, let me point out that I can send an SMS message without user intervention, if I have the permissions set properly. So I would expect that I would also need to set permission to allow sending email as well. There is only one way SMSs can be handled. On the G1 there are two e-mail clients built in to the system, one of which can have multiple accounts. You CAN NOT send an e-mail without the user being involved, period, because you simply have no way to know how that e-mail should be sent. If you want to send an e-mail, you need to have the code for doing so in your app, and have the user specify the account information for it. I have been poking around a bit in the source code and found this in the stock Android email app: package com.android.email.mail.transport; /** * This class handles all of the protocol-level aspects of sending messages via SMTP. */ public class SmtpSender extends Sender { public static final int CONNECTION_SECURITY_NONE = 0; public static final int CONNECTION_SECURITY_TLS_OPTIONAL = 1; public static final int CONNECTION_SECURITY_TLS_REQUIRED = 2; public static final int CONNECTION_SECURITY_SSL_REQUIRED = 3; public static final int CONNECTION_SECURITY_SSL_OPTIONAL = 4; private Transport mTransport; 53 String mUsername; 54 String mPassword; .. /** Allowed formats for the Uri: * smtp://user:passw...@server:port CONNECTION_SECURITY_NONE * smtp+tls://user:passw...@server:port CONNECTION_SECURITY_TLS_OPTIONAL * smtp+tls+://user:passw...@server:port CONNECTION_SECURITY_TLS_REQUIRED * smtp+ssl+://user:passw...@server:port CONNECTION_SECURITY_SSL_REQUIRED * smtp+ssl://user:passw...@server:port CONNECTION_SECURITY_SSL_OPTIONAL * * @param uriString the Uri containing information to configure this sender */ public SmtpSender(String uriString) throws MessagingException { ... Which seems to have public methods to send email. You are looking in the e-mail app. There is nothing public here at all. It is just internal implementation of the application. It doesn't matter if it makes a class public in its internal implementation, it is still internal, and nothing you can use. As I understood the philosophy behind building Android apps, which is to reuse public Intents and methods to allow the scarce available memory to be leveraged as much as possible. Yes, there are intents for using parts of an application that they want to allow others to access. There is no standard intent for "send an e-mail without the user being involved," and I don't expect there to be such a thing any time soon if at all. Some specific e-mail application may define its own intents to use for that, but this would be specific to that app, so you would need to know about it yourself. (And if multiple apps were to support this, you would still need to have the user involved to decide which app to use, and possible which account in that app to use.) So the question is: Can we use the existing code to send email in the stock Android email app? Or is that sort of thing frowned upon? It's not possible. -- 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
[android-developers] no root access.. how to put file...
I am not able to understand one simple issue.. if there is no root access to file system even to the user who owns the phone then why on earth would the dev guide include commands like adb push sdcard when the sdcard of emulator is read only.. Is this some kind of mockery or sarcasm with the users? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: ListView not touchable in my Activity
I don't see any itemClickListener registered ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: ERROR/MediaPlayer(1066): setDataSource called in state 128
I agree that it's most likely me doing something wrong. It looks like when the audio file is about to end the state of MediaPlayer gets changed in the native code. And maybe reset() doesn't take effect during this process while setDataSource(), invoked right after, finds player not to be ready. Maybe Android music app creates MediaPlayer every time or synchronizes the invocations somehow. I wonder whether the situation I described is possible and if it is whether you can advise on the solution. I can create MediaPlayer all the time, but I'm afraid to use too many resources doing so. I'm usually reluctant to creation of unnecessary objects. I really appreciate your help and apologize for my not very deep knowledge of the player functionality. On Apr 9, 3:23 pm, Marco Nelissen wrote: > I am one, and the error you posted indicates you called setDataSource > while the MediaPlayer was in the 'playback completed' state. > It could be a race condition in the framework, but since I have never > seen this problem occur with the Android music app, I'm inclined to > think it's a problem with your code. As a workaround, you could create > a new MediaPlayer when you want to play something new. > > On Wed, Apr 8, 2009 at 1:05 PM,ATrubka wrote: > > > Guys, please... > > Is there any Android native code developers around? > > > On Apr 8, 12:38 am,ATrubka wrote: > >> MediaPlayer.reset() always gets invoked. Here's the exact lines of > >> code: > > >> _mediaPlayer.reset(); > >> _mediaPlayer.setDataSource(resource); > >> _mediaPlayer.prepare(); > >> _mediaPlayer.start(); > > >> Additionally, the error occurs only when next audio starts while > >> previous audio is about to end. > >> If next audio starts in the middle of the playback or after it has > >> completely stopped playing, then everything works fine. > > >> It looks pretty much like a synchronization issue to me. > >> This method is not synchronized at the moment. > >> Since most of the MediaPlayer code is native I'm not sure what should > >> be synchronized. > > >> On Apr 7, 9:20 pm, Marco Nelissen wrote: > > >> > Looks like you're calling MediaPlayer.setDataSource() on a MediaPlayer > >> > that was already initialized, without first calling > >> > MediaPlayer.reset() > > >> > On Tue, Apr 7, 2009 at 1:28 PM,ATrubka wrote: > > >> > > Hi, guys. > > >> > > I'm using MediaPlayer and sometimes when first audio is about to end > >> > > and I click to the next audio I get the exception below. Looks like > >> > > the MediaPlayer is in some weird state of stopping playing and cannot > >> > > accept audio at the moment. > > >> > > The exception goes to the native code which is greeks to me. > >> > > I couldn't find anything about this error on the internet either. > > >> > > Is anyone here familiar with the problem? > > >> > > Thank you in advance! > > >> > > 04-07 20:19:35.855: ERROR/MediaPlayer(1066): setDataSource called in > >> > > state 128 > >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): Unable to play > >> > > chapter audio > >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): > >> > > java.lang.IllegalStateException > >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at > >> > > android.media.MediaPlayer.setDataSource(Native Method) > >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at > >> > > com.tourizo.android.services.AudioPlayerService.playResource > >> > > (AudioPlayerService.java:291) > >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at > >> > > com.tourizo.android.services.AudioPlayerService.access$3 > >> > > (AudioPlayerService.java:287) > >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at > >> > > com.tourizo.android.services.AudioPlayerService$1.playCurrentChapter > >> > > (AudioPlayerService.java:89) > >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at > >> > > com.tourizo.android.services.AudioPlayerRemoteInterface$Stub.onTransact > >> > > (AudioPlayerRemoteInterface.java:99) > >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at > >> > > android.os.Binder.execTransact(Binder.java:276) > >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at > >> > > dalvik.system.NativeStart.run(Native Method) > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Recording Audio
Hi, the following code works for me. I was also getting the "Start failed." error at one point. Fixed it by changing my output file extension from ".3gpp" to ".audio" -Ben final String path = "/sdcard/recording" + System.currentTimeMillis() + "_" + (int)(Math.random() * 1000)+ ".audio"; final MediaRecorder mr = new MediaRecorder(); mr.setAudioSource(MediaRecorder.AudioSource.MIC); mr.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); mr.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT); mr.setOutputFile(path); mr.prepare(); mr.start(); //stop recording after 10 seconds Timer t = new Timer(); t.schedule(new TimerTask() { public void run() { //stop recording mr.stop(); mr.release(); } }, 10*1000); On Mar 5, 7:05 pm, jdl wrote: > Hi Ben, > > Since the tutorial's currently broken, do you mind posting what values > you put in instead of these broken lines: > recorder.getMimeContentType() > MediaStore.Audio.INTERNAL_CONTENT_URI; > > If you got everything working, would you be willing to post your code > (since the tutorial's not yet updated)? > > Thanks, > > AN > > On Feb 26, 4:40 pm, benmccann wrote: > > > >> each application has its own private data directory / > > >> data/app-private/app-package. I believe your working directory is set > > >> to this directory by default > > > Cool. So it sounds like I should just be able to use a relative path > > from the current location then. Unfortunately, I'm getting the > > following exception (with no clues as to why start is failing): > > > 02-26 14:34:55.132: ERROR/AndroidRuntime(164): > > java.lang.RuntimeException: startfailed. > > 02-26 14:34:55.132: ERROR/AndroidRuntime(164): > > atandroid.media.MediaRecorder.start(Native Method) > > > Here's my code: > > > final MediaRecorder recorder = new MediaRecorder(); > > recorder.setAudioSource(MediaRecorder.AudioSource.MIC); > > recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); > > recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); > > recorder.setOutputFile("test.3gpp"); > > recorder.prepare(); > > recorder.start(); > > > On Feb 26, 12:14 am, Dave Sparks wrote: > > > > You can get the path to external storage (e.g. SD card) with > > > Environment.getExternalStorageDirectory(). This is world read/ > > > writable. > > > > Alternatively, each application has its own private data directory / > > > data/app-private/app-package. I believe your working directory is set > > > to this directory by default. This is onboard flash, so it will > > > survive the user ejecting an SD card. However, there is a limited > > > amount to go around, so you don't want to store monster media files > > > there. > > > > On Feb 25, 9:22 pm, benmccann wrote: > > > > > >> setOutputFile() expects a path to where you want the file stored. > > > > > Yep, figured that much by the method name, but what's a valid path? I > > > > mean I'm figuring it's UNIX-like, but other than that I'm in the > > > > dark. Is there a preferred place for apps to store data? Are there > > > > certain directories that I have permission to write to? What > > > > directories exist on the device by default? It'd be nice for the docs > > > > on data storage to mention any of these > > > > things:http://developer.android.com/guide/topics/data/data-storage.html > > > > > >> You can take a look at the source to SoundRecorder in the open > > > > >> source tree for some working code > > > > > Thanks for the example. This would be a much better example than the > > > > one in the docs that won't compile and implies content must first be > > > > added to a database: > > > > http://developer.android.com/guide/topics/media/index.html > > > > > On Feb 24, 8:03 pm, Dave Sparks wrote: > > > > > > setOutputFile() expects a path to where you want the file stored. > > > > > > You can take a look at the source to SoundRecorder in the open source > > > > > tree for some working code: > > > > > >http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder... > > > > > > On Feb 24, 4:43 pm, benmccann wrote: > > > > > > > Hi, > > > > > > I'd like to create anaudiorecordinginAndroid. (Actually, I just > > > > > > want access to the mic withoutrecordingit, but it seems that's not > > > > > > supported so I'll have to create arecordingand tail the file). > > > > > > I'm having a very hard time getting started. Mostly I'm just hoping > > > > > > that someone from Google reads this and will update the > > > > > > documentation > > > > > > because the example won't compile - it looks like it's from some > > > > > > previous version of the SDK because there's an error in every other > > > > > > line. I made my best guess as to what the usage should be, but I > > > > > > keep > > > > > > getting a number of different exceptions. > > > > > > One question I had is whether I can just specify an arbitrary path > > > > > > to > > > > > > the MediaRecorder to startr
[android-developers] Re: android.permission.GET_ACCOUNTS
We unfortunately left most of the permission string constants in the SDK, even for ones protecting private APIs. So something being there doesn't mean there is an API for it. On Thu, Apr 9, 2009 at 7:28 PM, strazzere wrote: > > Are there any examples of how to use android.permission.GET_ACCOUNTS ? > Or is this an unimplimented api? I found this site; > http://joakim.erdfelt.com/wiki/index.php/AndroidGetAccount > > Though I haven't been able to get anything to work. I believe JBQ said > it was a private api - but I'm not sure why the permission is listed > on the dev reference? > > > -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] android.permission.GET_ACCOUNTS
Are there any examples of how to use android.permission.GET_ACCOUNTS ? Or is this an unimplimented api? I found this site; http://joakim.erdfelt.com/wiki/index.php/AndroidGetAccount Though I haven't been able to get anything to work. I believe JBQ said it was a private api - but I'm not sure why the permission is listed on the dev reference? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: CONTROL_LOCATION_UPDATES permission failure
Hello Richard, Thanks very much. This is very helpful. I am using the same SDK version but in this case I was not using the SDK. I had been experimenting with LocationListener too. I had been using onLocationChanged. Again, Thanks. Alex Donnini On Apr 9, 7:32 pm, Richard Schilling wrote: > I have the SDK version 1.1r1 on my machine, and Actually don't see > this API call in the current version. What version of the SDK are you > using? > > Anyway, I assume you want to cell tower location and such. Try > creating a listener, and then registering your listener with the > TelephonyManager. > > Start by giving your application the following permissions: > > android.permission.ACCESS_FINE_LOCATION > android.permission.ACCES_COARSE_LOCATION > > Then, create your listener: > > // implement both phone state listener and location listener. > public class PhoneSignalListener extends PhoneStateListener > implements LocationListener{ > > /** > * @param signalStrength signal strength in ACU. > */ > public void onSignalStrengthChanged(int signalStrength){ > > float signalPercent = ((float)signalStrength)/31f * 100f; > SignalStrength.setSignalStrength(signalPercent); > SignalStrength.setSignalStrengthASU(signalStrength); > > } > > public void onCellLocationChanged(CellLocation cellLoc){} > > public void onLocationChanged(Location loc) {} > > public void onProviderDisabled(String arg0) {} > > public void onProviderEnabled(String arg0) {} > > public void onStatusChanged(String arg0, int arg1, Bundle arg2) {} > > } > > And then you register it with TelephonyManager. In your application's > main activity (Activity.onCreate()): > > public class MyActivity extends Activity{ > > public void onCreate(Bundle savedInstanceState) { > TelephonyManager telManager = (TelephonyManager) > this.getSystemService(Context.TELEPHONY_SERVICE); > telManager.listen(new PhoneSignalListener(), > PhoneStateListener.LISTEN_SERVICE_STATE | > PhoneStateListener.LISTEN_SIGNAL_STRENGTH | > PhoneStateListener.LISTEN_CELL_LOCATION); > } > > } > > As the phone location changes you get the information delivered, > wrapped in a pretty package with a bow, to the Phone signal listener. > > Richard Schilling > Root Wireless > > On Apr 9, 11:15 am,alexdonnini wrote: > > > Hello, > > > Although the manifest file in my application contains > > > > android:name="android.permission.CONTROL_LOCATION_UPDATES" /> > > > the operation, > > > mTelephonyManager.enableLocationUpdates(); > > > fails with > > > 04-09 14:01:01.754: WARN/System.err(5495): > > java.lang.SecurityException: Neither user 10026 nor current process > > has android.permission.CONTROL_LOCATION_UPDATES. > > > Could anyone help me understand where I am making a mistake, and how > > to correct it? > > > Thanks. > > > Alex Donnini --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Animation on a view doesn't 'stick' in reality
Okay I've figured it out. I would personally consider this a bug but not sure if this is how it's meant to be. Basically in onAnimationEnd I had to loop over all children inside the viewgroup (and children of children) and set their visibility to GONE/ INVISIBLE and the buttons stopped getting touch events after animation ended. And then onAnimationStart I had to set their visibility back to VISIBLE. Shouldn't setting visibility/focusability/enabled state etc on the parent ViewGroup apply these down to its children as well (especially the visibility part). Since the parent view became invisible, which is fine, but the children view didn't (well internally) and thus were intercepting Touch events eventhough the view as a whole was not visible. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Animation on a view doesn't 'stick' in reality
> > myView.startAnimation(myAnimation); > myView.setVisibility(View.INVISIBLE); // or GONE > > Android will hide the View and run the animation but still draw the > View as long as the animation is running. Thanks Romain - I did this (and the completion listener) neither of these work. Basically the 'AbsoluteLayout' ViewGroup slides out of the screen but then when you tap on the are where that view once was, the old buttons apparently still get tapped (eventhough completely invisible). If I've 'translated' a view, shouldn't it stay where it is and not get the kind of focus/clicks it's getting right now? I tried setEnabled(false), setVisibility(View.GONE) -- nothing seems to work. The 'invisible' view still gets touch events and buttons are being pressed from the view that got slid away. Am I doing something wrong? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: list of request codes - their names and values?
Rob Franz wrote: > What I am doing is getting the URI of the ringtone that the user selects > in the ringtone picker. Then I save it for later use. That should be in your preferences, though. After all, you're the one asking for the ringtone via the RingtonePreference, right? Just open up your SharedPreferences (PreferenceManager.getDefaultSharedPreferences()) and read out the value. Or use Preference.OnPreferenceChangeListener to be notified when the user changed your preference of interest. I feel like I'm missing something... -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] speech bubble like in Google Maps
I'm coding an application wich uses the map. The map shows moving Objects. The direction in which objects are move should be(displayed as arrow) the object-image. so i startet with the implementation of the map view. How can i create objects on the map, which (after klicking on them) are able to show their names and also that specific arrows to jump to the next object, like in Google Maps. I tried setMarker and Canvas, but have no idea of how to use them. Thank you for helping me. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Stopping all services..
greggnic wrote: > I see your point and definitely agree. I would really like to see a > sleep timer function for the music player though and don't think I > would be able to write a whole music player application that could > compete with the others out there... Well, the built-in music player is open source: http://android.git.kernel.org/?p=platform/packages/apps/Music.git;a=tree In principle, you could make a sleep-timer patch and submit it: http://source.android.com Admittedly, there is a learning curve for making changes to the source code, more so than with many open source projects, due to the unusual build environment and the unusual patch submission process. I haven't climbed that curve myself. Another possibility would be for you to create an application that let users configure sleep timers and, when the timer elapsed, broadcast an Intent that confirming applications would pay attention to and honor. You might partner with OpenIntents.org, as this seems like their sort of application, and you might be able to help get some prominent third-party applications, such as some music players, to honor your sleep-timer Intent. This requires as much people skills as coding skills, though, to convince other developers to follow your sleep-timer lead. There are probably other ways to go about this as well -- those are just two off the top of my head. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: list of request codes - their names and values?
What I am doing is getting the URI of the ringtone that the user selects in the ringtone picker. Then I save it for later use. It works, but I'm just trying to figure out what that request code is. Thanks Rob On Thu, Apr 9, 2009 at 7:15 PM, Mark Murphy wrote: > > Rob Franz wrote: > > But this is a RingtonePreference - I'm not starting the activity from > > code. RingtonePreference is defined in preferences.xml (which defines > > how the Preferences are laid out). > > > > All I know is that the request code - not the *result code* - that is > > returned is 100. > > > > I need to know the name associated with that value 100... I can't find > > it anywhere :-) > > What are you attempting to achieve by listening on onActivityResult() > from a PreferenceActivity? > > Is it something that could be handled better via a > Preference.OnPreferenceChangeListener? > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://twitter.com/commonsguy > > _The Busy Coder's Guide to Android Development_ Version 2.0 Available! > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: problems with bitmaps
mark.ka...@gmail.com wrote: > There's been a number of threads on this issue, the BitmapFactory > tends to throw this out of memory errors when it really shouldn't, > looks like a bug or memory leak. I'm not sure if it's cataloged as an > official bug though. If you have a reproducible test case, head over to http://b.android.com and make it official. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] new NTP client tools on the Android Market
For those of you dealing with time data on the Android - or just want to see an NTP client work, check out the application I just published. It's free of course, and it's called "Navy Clock" It displays local time of the phone, the UTC time of the phone, and the time read from the US Naval Observatory in Washington DC. I'll add features as I go. Cheers, Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Stopping all services..
I see your point and definitely agree. I would really like to see a sleep timer function for the music player though and don't think I would be able to write a whole music player application that could compete with the others out there... On Apr 9, 6:12 pm, Mark Murphy wrote: > greggnic wrote: > > I just started writing an application for android and have run into a > > wall. I would like my program to wait a certain amount of time and > > then stop all currently running services. > > IMHO, that would be a rather significant security issue. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > 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: problems with bitmaps
BitmapFactory does not leak. It throws an OutOfMemoryException when there's no more memory available. That's all. On Thu, Apr 9, 2009 at 4:36 PM, wrote: > > > There's been a number of threads on this issue, the BitmapFactory > tends to throw this out of memory errors when it really shouldn't, > looks like a bug or memory leak. I'm not sure if it's cataloged as an > official bug though. Using bitmap.recycle(), and reducing the sample > size will mitigate , but not eliminate the problem. Also try reducing > the memory footprint of your images if possible. Hopefully this will > be recognized as a bug and fixed in a future release, at least I hope > so, I've had similar problems myself, and so have a number of other > developers. > > M > > On Apr 9, 1:57 pm, petunio wrote: >> Hi everybody >> >> I am having a problem with the BitmapFactory: >> >> this is my function, that reads a stream, and returns a bitmap: >> >> static Bitmap getBitmap(InputStream is) throws IOException >> { >> Bitmap bmp=null; >> >> //do some stuff... >> >> bmp=BitmapFactory.decodeStream(is); >> >> return bmp; >> } >> >> after calling it a few times, it crashes giving me the following >> error: >> >> ERROR/(1329): VM won't let us allocate 215488 bytes >> ERROR/AndroidRuntime(1329): java.lang.OutOfMemoryError: bitmap size >> exceeds VM budget >> >> I am counting the memory used so far, and it's only 395328 bytes, so I >> am sure there must be something else... >> >> any ideas? >> >> Thanks > > > -- 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: Animation on a view doesn't 'stick' in reality
> Any way to do this without setting up an animation completion handler > and then hide the view explicitly? Yes and no. No because you still need to hide the view yourself. Yes because you can just do this: myView.startAnimation(myAnimation); myView.setVisibility(View.INVISIBLE); // or GONE Android will hide the View and run the animation but still draw the View as long as the animation is running. -- 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] Animation on a view doesn't 'stick' in reality
Hi I'm using a TranslateAnimation to slide a ViewGroup in and out of screen. However after the animation slides the view out, the transparent view is still 'clickable' in the same place. I used setFillAfter to TRUE thinking that the animation would 'stick' but I can't seem to get the view out of my 'face'. Any way to do this without setting up an animation completion handler and then hide the view explicitly? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: problems with bitmaps
There's been a number of threads on this issue, the BitmapFactory tends to throw this out of memory errors when it really shouldn't, looks like a bug or memory leak. I'm not sure if it's cataloged as an official bug though. Using bitmap.recycle(), and reducing the sample size will mitigate , but not eliminate the problem. Also try reducing the memory footprint of your images if possible. Hopefully this will be recognized as a bug and fixed in a future release, at least I hope so, I've had similar problems myself, and so have a number of other developers. M On Apr 9, 1:57 pm, petunio wrote: > Hi everybody > > I am having a problem with the BitmapFactory: > > this is my function, that reads a stream, and returns a bitmap: > > static Bitmap getBitmap(InputStream is) throws IOException > { > Bitmap bmp=null; > > //do some stuff... > > bmp=BitmapFactory.decodeStream(is); > > return bmp; > } > > after calling it a few times, it crashes giving me the following > error: > > ERROR/(1329): VM won't let us allocate 215488 bytes > ERROR/AndroidRuntime(1329): java.lang.OutOfMemoryError: bitmap size > exceeds VM budget > > I am counting the memory used so far, and it's only 395328 bytes, so I > am sure there must be something else... > > any ideas? > > 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: ListView row not receiving highlight with ImageButton in row
Ok I can see setting it to non-focusable 'solves' the problem but that's not really what I was hoping to do. Well, too bad, the user can't focus but only tap now. On Apr 9, 9:21 pm, fg1921 wrote: > Hi > > This must be something very simple but I've tried almost everything > and still can't get this to work. > > Basically I've made a custom LinearLayout view with a TextView and an > ImageButton to be used as a row for a ListView. The moment I use an > ImageButton tapping on the row does not highlight the row any more. > Moreover, I can't 'focus' the rows using the trackball, nor can I set > focus on the button. > > If I remove the ImageButton and replace with an ImageView, the Row > highlight/selection works. How can I get row selection/highlight along > with ImageButton highlight at the same time? > > 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: CONTROL_LOCATION_UPDATES permission failure
I have the SDK version 1.1r1 on my machine, and Actually don't see this API call in the current version. What version of the SDK are you using? Anyway, I assume you want to cell tower location and such. Try creating a listener, and then registering your listener with the TelephonyManager. Start by giving your application the following permissions: android.permission.ACCESS_FINE_LOCATION android.permission.ACCES_COARSE_LOCATION Then, create your listener: // implement both phone state listener and location listener. public class PhoneSignalListener extends PhoneStateListener implements LocationListener{ /** * @param signalStrength signal strength in ACU. */ public void onSignalStrengthChanged(int signalStrength){ float signalPercent = ((float)signalStrength)/31f * 100f; SignalStrength.setSignalStrength(signalPercent); SignalStrength.setSignalStrengthASU(signalStrength); } public void onCellLocationChanged(CellLocation cellLoc){} public void onLocationChanged(Location loc) {} public void onProviderDisabled(String arg0) {} public void onProviderEnabled(String arg0) {} public void onStatusChanged(String arg0, int arg1, Bundle arg2) {} } And then you register it with TelephonyManager. In your application's main activity (Activity.onCreate()): public class MyActivity extends Activity{ public void onCreate(Bundle savedInstanceState) { TelephonyManager telManager = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE); telManager.listen(new PhoneSignalListener(), PhoneStateListener.LISTEN_SERVICE_STATE | PhoneStateListener.LISTEN_SIGNAL_STRENGTH | PhoneStateListener.LISTEN_CELL_LOCATION); } } As the phone location changes you get the information delivered, wrapped in a pretty package with a bow, to the Phone signal listener. Richard Schilling Root Wireless On Apr 9, 11:15 am, alexdonnini wrote: > Hello, > > Although the manifest file in my application contains > > android:name="android.permission.CONTROL_LOCATION_UPDATES" /> > > the operation, > > mTelephonyManager.enableLocationUpdates(); > > fails with > > 04-09 14:01:01.754: WARN/System.err(5495): > java.lang.SecurityException: Neither user 10026 nor current process > has android.permission.CONTROL_LOCATION_UPDATES. > > Could anyone help me understand where I am making a mistake, and how > to correct it? > > Thanks. > > Alex Donnini --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: list of request codes - their names and values?
Rob Franz wrote: > But this is a RingtonePreference - I'm not starting the activity from > code. RingtonePreference is defined in preferences.xml (which defines > how the Preferences are laid out). > > All I know is that the request code - not the *result code* - that is > returned is 100. > > I need to know the name associated with that value 100... I can't find > it anywhere :-) What are you attempting to achieve by listening on onActivityResult() from a PreferenceActivity? Is it something that could be handled better via a Preference.OnPreferenceChangeListener? -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Permissions to install other apps...
That's why apps can't install other apps without the user being involved. I was addressing the first part of the original poster's request, being able to download and run Dalvik code in your own process. In that case the new API will let you do this, though of course you are running the other code as -yourself- so taking responsibility for anything it does. On Thu, Apr 9, 2009 at 3:35 PM, BIRJODH wrote: > > Would not it be somewhat dangerous to allow apps is /data/app folder > to install other applications?? An app can just create an infinite > loop in which downloads applications which do not require any > permission and keep on installing them and fill out the memory space? > > Birjodh > > > On Apr 9, 1:56 pm, Dianne Hackborn wrote: > > There is an API in cupcake to allow you to perform the dexopt into your > own > > directory. That will be available when cupcake is available. > > > > > > > > On Thu, Apr 9, 2009 at 2:05 AM, Eborix13 wrote: > > > > > Hi, > > > > > We are a team of Android developers and we are facing a serious > > > problem for quite some time. Our app (a game client) is designed in > > > such a way, that once it's installed it can be used to download games > > > from a game server. In order for the downloaded games to work, they > > > have to be installed and launched by the client. > > > > > The problem is that the client has no write/update rights for the / > > > data/dalvik-cache directory, unless we specifically execute the chmod > > > 777 command for that directory. Setting the > > > android.permission.INSTALL_PACKAGES permission in the client's > > > manifest file also doesn't work. After reading countless forums where > > > other people have complained about the same problem, we would like to > > > know when this issue is going to be resolved. Apparently the code for > > > this feature already exists (the DexFile class of the so called > > > "cupcake" release) but it hasn't been released yet. > > > > > What's more frustrating is that the Android team points out that all > > > Android apps are equal, that system apps are equal in rights to custom > > > apps. Obviously this is not the case. If the client game app is > > > installed in the /system/app the problem described above is solved. > > > System apps have the right to dynamically install other apps. Regular > > > apps (installed in the /data/data folder) do not. > > > > > Is this issue going to be resolved anytime soon? Will the "cupcake" > > > DexFile class going to be present in the next release? This is a > > > rather urgent problem since we are waiting for this new functionality > > > in order to continue development. > > > > > Thank you... > > > > -- > > Dianne Hackborn > > Android framework engineer > > hack...@android.com > > > > Note: please don't send private questions to me, as I don't have time to > > provide private support, and so won't reply to such e-mails. All such > > questions should be posted on public forums, where I and others can see > and > > answer them. > > > -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: list of request codes - their names and values?
But this is a RingtonePreference - I'm not starting the activity from code. RingtonePreference is defined in preferences.xml (which defines how the Preferences are laid out). All I know is that the request code - not the *result code* - that is returned is 100. I need to know the name associated with that value 100... I can't find it anywhere :-) Thanks Rob On Thu, Apr 9, 2009 at 1:42 AM, for android wrote: > The requestCode is the constant you send from ur code which starts the > activity > > startActivityForResult(intent,100); > > > So you are sending the code 100. > > you need to look at the result code which are RESULT_OK,RESULT_CANCELED > which are defined in the Activity class. > > > On Thu, Apr 9, 2009 at 7:09 AM, Rob Franz wrote: > >> >> Hi all >> I just can't seem to find this anywhere... I've been googling! >> >> I have a RingtonePreference in one of my classes and, upon return, the >> onActivityResult says that the requestCode being returned is 100. >> >> Unfortunately, I can't seem to find the *constant name* for this >> value. >> >> Is there a master list somewhere? It's just not jumping out at me in >> the documentation... >> >> Thanks >> Rob >> >> > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: OOM errors during inflation
Hi Romain, Thanks a lot for your answer: this should definitely help fix the issue! In fact, I wouldn't be surprised if a lot of posts regarding OutOfMemory issues are caused by the same problem. However, I think many hours of bug hunting could have been prevented if this 'recycler' point was mentioned in the API docs for Adapter. My own thinking was that "convertView" was basically the View that was previously generated (for the item above the current one in the list), and if you wouldn't use it, it would be garbage collected. Take the following from getView: "convertView - The old view to reuse, if possible. Note: You should check that this view is non-null and of an appropriate type before using. If it is not possible to convert this view to display the correct data, this method can create a new view." It actually talks about "this method can create a new view", but to me it's not clear that a reference to each returned View is kept somewhere in the ListView. How could I have known this? You may have written part of this code, so it's probably very obvious to you, but to the outside developer, it's not. The point about how you MUST reuse the convertView should be stressed much more clearly in the API docs, in my opinion. As well as the point about the recycler. Alternatively, maybe the Adapter implementation could be changed so that it always only keeps one reference of a particular type of View. Why should it keep multiple references to the same View type, if it's only possible to provide a single one as convertView? Either way, I'm very happy to finally understand the inner workings of the Adapter, and it will help create more robust code. Kind regards, - Niek On Apr 9, 8:44 pm, Romain Guy wrote: > There is no memory leak in LayoutInflater. While this is never a > proof, it's something we never encountered in > any of the apps we wrote. Also, the Android team works very hard to > plug all the memory leaks we can find > and when we tell developers to use less memory it's when we're pretty > sure that the APIs that seem to be > causing the memory leak are not responsible. > > For instance, in your case you are basically saying that if you > inflate views until you run out of memory, you > run out of memory. Every View created by the adapter is kept by the > ListView in a 'recycler'. That recycler is > used to provide the adapter with a convertView whenever possible. That > means you MUST reuse the > convertView. > > If you need views of different types in the list, just use the > appropriate APIs: Adapter.getViewTypeCount() and > Adapter.getItemViewType(int position) > (seehttp://d.android.com/reference/android/widget/Adapter.html). If > you implement these methods correctly, ListView will manage several > recyclers and always give you back the > correct convertView. > > On Wed, Apr 8, 2009 at 6:14 AM, Niek wrote: > > > Hi guys, > > > I've read several posts from developers having OutOfMemory issues, and > > a lot of them seem to be related to lists. I'm having a similar issue, > > and the root of the problem seems to be a memory leak in the inflation > > process. > > > The problem is particularly tricky to track down, because as of yet it > > seems impossible to get a view of part of the heap (where the bitmaps > > reside, and possibly other objects), as also mentioned by Ward and > > others. > > > I created a small demo, so hopefully some Google engineers (Romain, > > Dianne) can look at this, and either point out to me what I'm doing > > wrong, or fix a possible memory leak in the inflation process in the > > Android framework. I'm sure a lot of people would be very thankful if > > this issue got resolved, as it often results in sudden crashes of the > > app, without a clear reason. I must say it's disappointing to read the > > standard: "use less memory" reply from Google to a lot of these posts, > > as it seems to be worthy of further investigation. > > > Here's the demo, and the resulting logcat log with some peculiarities > > contained within. > > >http://www.coffeebreakmedia.com/android_heap_issue.zip > > > A small explanation: it's a very simple list implementation with a > > ListAdapter. It works fine if the list rows are inflated just once (by > > re-using the convertView), but I purposely commented out two lines of > > code: > > > // if(convertView == null) { > > convertView = inflater.inflate(R.layout.list_row, > > parent, false); > > // } > > > This is to ensure that for each row, the XML is inflated again. In > > this demo, this would be completely unnecessary and a big waste, but > > in a real life a similar scenario happens when you have a list with a > > few different types of rows (e.g., a different xml is used for the > > header of a set of items, which use their own xml). In that case, > > sometimes the convertView will be of the wrong type, in which case you > > have to inflate another one. Obviously, this would then
[android-developers] Re: Permissions to install other apps...
Would not it be somewhat dangerous to allow apps is /data/app folder to install other applications?? An app can just create an infinite loop in which downloads applications which do not require any permission and keep on installing them and fill out the memory space? Birjodh On Apr 9, 1:56 pm, Dianne Hackborn wrote: > There is an API in cupcake to allow you to perform the dexopt into your own > directory. That will be available when cupcake is available. > > > > On Thu, Apr 9, 2009 at 2:05 AM, Eborix13 wrote: > > > Hi, > > > We are a team of Android developers and we are facing a serious > > problem for quite some time. Our app (a game client) is designed in > > such a way, that once it's installed it can be used to download games > > from a game server. In order for the downloaded games to work, they > > have to be installed and launched by the client. > > > The problem is that the client has no write/update rights for the / > > data/dalvik-cache directory, unless we specifically execute the chmod > > 777 command for that directory. Setting the > > android.permission.INSTALL_PACKAGES permission in the client's > > manifest file also doesn't work. After reading countless forums where > > other people have complained about the same problem, we would like to > > know when this issue is going to be resolved. Apparently the code for > > this feature already exists (the DexFile class of the so called > > "cupcake" release) but it hasn't been released yet. > > > What's more frustrating is that the Android team points out that all > > Android apps are equal, that system apps are equal in rights to custom > > apps. Obviously this is not the case. If the client game app is > > installed in the /system/app the problem described above is solved. > > System apps have the right to dynamically install other apps. Regular > > apps (installed in the /data/data folder) do not. > > > Is this issue going to be resolved anytime soon? Will the "cupcake" > > DexFile class going to be present in the next release? This is a > > rather urgent problem since we are waiting for this new functionality > > in order to continue development. > > > Thank you... > > -- > 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: Exception locking surface - lockCanvas() returns a null?
If you want to use the standard 2d APIs, don't use OpenGL. On Thu, Apr 9, 2009 at 1:45 PM, mcmc wrote: > > wow thanks so much for your help. I think you're right! :D > > however, now I run into another problem. Do you know how to convert > openGL to simply using the standard android/java 2D APIs? > > On Apr 9, 2:31 am, "ellipsoidmob...@googlemail.com" > wrote: > > I hadn't realised you are doing openGL stuff. I've used surfaceview/ > > holder in the same was as the lunarlander, but I haven't used openGL > > so I don't know how that works. > > > > But, at a glance, it looks like you've got a mix of two different > > approaches here - maybe the lockcanvas/unlockcanvasandpost approach is > > not appropriate when using openGL as the openGL code is controlling > > and locking the surface? > > > -- 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: More Than One Instance of Application
It brings the currently running instance to the foreground. On Thu, Apr 9, 2009 at 2:39 PM, Noam wrote: > > Hello, > Is there a way to prevent the user of opening more than one instance > of my application? > > For example: > User clicks on App and opens it. > The user clicks on the home button. (the app is still running in the > background) > The user clicks on (not the menu button, but the button above it in > the homescreen), and then opens the application again. > Does it open the same instance, or does it create another one? > If it does create another one, how can I prevent it from creating > another one, and just opening the existing instance? > > Thanks, > Noam. > > > -- 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: Stopping all services..
greggnic wrote: > I just started writing an application for android and have run into a > wall. I would like my program to wait a certain amount of time and > then stop all currently running services. IMHO, that would be a rather significant security issue. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy 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] How to determine the amount of characters that will fit into a TextView
I am trying to place only the exact amount of data into a TextView but I need to know how much it can hold. Is there a way to do this based on it's height, width and the textsize? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: API Demos APK not running.
tamal123 wrote: > Hi, > I am trying to run API-Demos.apk in the zoom board. But it seems, the > APK is not getting installed properly. I have compiled the CodeBase > using Eclipse, and source is been taken from Android SDK 1.0. > > Please let me know, how can i run the application on zoom board. You may get better answers to your Android porting questions on a discussion list dedicated to Android porting: http://source.android.com/discuss -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy 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: sample source code for beginner
tonyc...@gmail.com wrote: > I'm trying to get my 1st android application (blackjack) going and am > so confused with layouts button etc etc. Are there any sample source > code for me to review? I have ran through the source that come with > the SDK and the android source tree. > > Still pretty confused. am I stupid? You are probably not stupid. There are hundreds of blog posts and anddev.org boards with sample source code. It requires a bit of searching to find what you want, though. There are many open source Android projects on code.google.com and github.com. There are several books on Android, at least some of which have their source code available for download. For example, you can download the source code for my book off of http://commonsware.com/Android/. Other books and programming resources can be found on my knol: http://knol.google.com/k/mark-murphy/android-programming And, if you post specific questions here, we might be able to give you more specific answers. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy 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: Read the SMS already stored
I think you need READ_SMS permission for reading the SMS. On Wed, Apr 8, 2009 at 7:29 PM, sermojohn wrote: > > You could probably, call a Cursor's method that returned the field of > the specified content's datbase table. > I have actually faced the same problem today, while trying to build > an SMS application. My problem is that > when trying to retrieve any info from the Cursor, I get a Security > exception mentioning something about Permissions. > > Do you have any idea what this might be? Should I add any permission > declaration in the Manifest file of my application? > > Concerning the URI, I have read around that it is content://sms/inbox > > Hope I helped, while it seems that I m looking for the same > information as you do. > Please let me know if you have any new on that. > > many thanx > > On Apr 2, 6:35 pm, binklee wrote: > > Hi everybody, > > > > I unfortunately don't find the necessary documentation to retrieve > theSMSalready received in theinbox. > > > > My goal is to do smthg like : > > > > ContentResolver cr = mCtx.getContentResolver(); > > Cursor cur = cr.query(Uri.parse("content://sms/inbox"), > > null, null, null, null); > > > > while (cur.moveToNext()) { > > // HOW TO KNOW HOW SHOULD I USE MY CURSOR? > > } > > > > My questions are : > > * Is the URI correct ? I heard about content://sms/inbox and > > content://sms/conversation. > > * What are the columns where my cursor points ? Where can I find this > > kind of information? > > * Am I using the good method ? > > > > Thank you for your help, > > Deniz > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] More Than One Instance of Application
Hello, Is there a way to prevent the user of opening more than one instance of my application? For example: User clicks on App and opens it. The user clicks on the home button. (the app is still running in the background) The user clicks on (not the menu button, but the button above it in the homescreen), and then opens the application again. Does it open the same instance, or does it create another one? If it does create another one, how can I prevent it from creating another one, and just opening the existing instance? Thanks, Noam. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Drawable or Uri for Notification icon
Looking for comments on this On Mar 24, 11:20 pm, android_dev 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: Visibility of ImageButton
Thanks for the information. Not sure how I could get out of the onclicklistener so I fixed the problem but changing the image source (image with arrow, image no arrow) within the listener (based on list position value). So it works as I wanted. On Apr 8, 12:47 pm, Mark Murphy wrote: > intbt wrote: > > I am trying to change visibility of a button (Image). > > > However this code does not affect the image - any ideas? > > > Prevword_btn = (ImageButton) this.findViewById(R.id.prev_btn); > > Prevword_btn.setVisibility(View.INVISIBLE); > > Nextword_btn = (ImageButton) this.findViewById(R.id.next_btn); > > Nextword_btn.setVisibility(View.INVISIBLE); > > Those should work. However, they will not take effect until you leave > whatever callback you are in (e.g., onCreate() in the activity, > onClick() in a button OnClickListener). > > > Also when I try to set visibility of the Image Button in the xml > > layout file (main.xml) I get an error message from this code > > > android:visibility="1" > > > saying integers are not accepted? > > Correct. In XML, the values are "visible", "invisible", and "gone". > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] problems with bitmaps
Hi everybody I am having a problem with the BitmapFactory: this is my function, that reads a stream, and returns a bitmap: static Bitmap getBitmap(InputStream is) throws IOException { Bitmap bmp=null; //do some stuff... bmp=BitmapFactory.decodeStream(is); return bmp; } after calling it a few times, it crashes giving me the following error: ERROR/(1329): VM won't let us allocate 215488 bytes ERROR/AndroidRuntime(1329): java.lang.OutOfMemoryError: bitmap size exceeds VM budget I am counting the memory used so far, and it's only 395328 bytes, so I am sure there must be something else... any ideas? 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: sample source code for beginner
Hi Tony. No, you are not stupid, although you would be if you didn't listen to my as-usual perfectly awesome advice. I recommend you look at the Android tutorial at http://developer.android.com/guide/index.html, and for UI layouts, see http://developer.android.com/guide/topics/ui/declaring-layout.html . Or you can go straight to the sample code at http://developer.android.com/guide/samples/index.html . The layout sample code is at http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/index.html . There are of course many other good tutorials out there as well. Yusuf The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Apr 7, 7:17 pm, "tonyc...@gmail.com" wrote: > Dear all android experts, > > I'm trying to get my 1st android application (blackjack) going and am > so confused with layouts button etc etc. Are there any sample source > code for me to review? I have ran through the source that come with > the SDK and the android source tree. > > Still pretty confused. am I stupid? > > really appreciate your help in advance > > Tony > in Beijing --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Exception locking surface - lockCanvas() returns a null?
wow thanks so much for your help. I think you're right! :D however, now I run into another problem. Do you know how to convert openGL to simply using the standard android/java 2D APIs? On Apr 9, 2:31 am, "ellipsoidmob...@googlemail.com" wrote: > I hadn't realised you are doing openGL stuff. I've used surfaceview/ > holder in the same was as the lunarlander, but I haven't used openGL > so I don't know how that works. > > But, at a glance, it looks like you've got a mix of two different > approaches here - maybe the lockcanvas/unlockcanvasandpost approach is > not appropriate when using openGL as the openGL code is controlling > and locking the surface? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to login to the root of Android Dev Phone 1?
Hi Gavin, Giving full rights to everything in /data is not a very good idea. I don't think chmod supports -R on android so it might not be possible at all. The easiest way to remove everything related to your application would be to uninstall it from "manage applications". Then when you'll run it from eclipse it would be just as a fresh install. Another solution is to connect your phone with USB to your desktop (there is a driver for windows, on Linux it should work by default), run adb shell, su to become root and rm /data/data// databases/ to delete the db. You could also use sqlite3 to only drop tables and not delete the entire db. Regards On Apr 9, 6:30 pm, Gavin Aiken wrote: > Hi Guys, > > I'm having the same issue. I just go a dev phone and i'm used to wiping the > database of my ap by removing it using eclipse from the > /data/data//databse.db location. > > Now i'm developing on a dev phone I don;t have access to /data/. > > I've installed terminal emulator but I need to know what command to use as a > recursive chmod on data returns the error message 'bad mode'. > > # chmod 777 -R /data/ > > Any help greatly appreciated! I'm trying different database setups, the sql > is bundled with the apk, the database remains upon reinstallation of the app > via eclipse and hence I need to remove it manually (A better approach would > also be a welcome suggestion). > > Cheers, > > Gav > > On Sun, Apr 5, 2009 at 4:26 AM, havexz wrote: > > > Well i finally get the solution..u have to use the "su" command to > > login as root and then have to change the permissions for the folder > > (in my case its data). Once done that then you can easily move files > > using the eclipse DDMS from the Android Dev Phone 1. But remember you > > also need to change the permissions for the file that you want to copy > > from the deviceAnd the "pull" and "push" commands only work > > outside "su" so you have to change permissions using "su" and den try > > "pull" or "push". > > > Thanks a lot to Jean-Baptiste Queru who helped me with su. > > > On Mar 25, 4:30 am, David Turner wrote: > > > "pull" is an adb command, you need to run it on the host (there is no > > easy > > > way to send a file to your host from the system). E.g. > > > > adb pull > > > > On Wed, Mar 25, 2009 at 4:34 AM, havexz wrote: > > > > > well i am able to access the folder but still unable to get the files > > > > out to local system .. > > > > the following is the snap shot. Here i had run the "su" command and > > > > the prompt changes from $ to # > > > > > # pull > > > > pull > > > > pull: not found > > > > # help > > > > help > > > > help: not found > > > > # > > > > > On Mar 24, 1:28 am, havexz wrote: > > > > > THANKS ITS WOKRING..:) > > > > > > BTW is there a way i can access using the UI DDMS which comes with > > > > > eclipse IDE.? > > > > > > On Mar 23, 10:40 pm, Jean-Baptiste Queru wrote: > > > > > > > Run "su" in your shell, and you'll be running arootshell. > > > > > > > JBQ > > > > > > > On Mon, Mar 23, 2009 at 7:45 PM, havexz > > > > wrote: > > > > > > > > Also tried login to shell using adb but i am unable to browse to > > that > > > > > > > directory.. the error is given below: > > > > > > > $ ls > > > > > > > ls > > > > > > > sqlite_stmt_journals > > > > > > > cache > > > > > > > sdcard > > > > > > > etc > > > > > > > init > > > > > > > default.prop > > > > > > > logo.rle > > > > > > > init.trout.rc > > > > > > > data > > > > > > > system > > > > > > > init.goldfish.rc > > > > > > > sys > > > > > > > proc > > > > > > > init.rc > > > > > > > sbin > > > > > > >root > > > > > > > dev > > > > > > > $ ls data > > > > > > > ls data > > > > > > > opendir failed, Permission denied > > > > > > > $ > > > > > > > > On Mar 23, 9:43 pm, havexz wrote: > > > > > > >> I am unable to copy the files from the data folder of the > > Android > > > > Dev > > > > > > >> Phone 1. I used to do that on the Emulator. I need to back up > > the > > > > > > >> application data so that I can restore it. > > > > > > > -- > > > > > > Jean-Baptiste M. "JBQ" Queru > > > > > > Android Engineer, Google. > > > > > > > Questions sent directly to me that have no reason for being private > > > > > > will likely get ignored or forwarded to a public forum with no > > further > > > > > > warning. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: ERROR/MediaPlayer(1066): setDataSource called in state 128
I am one, and the error you posted indicates you called setDataSource while the MediaPlayer was in the 'playback completed' state. It could be a race condition in the framework, but since I have never seen this problem occur with the Android music app, I'm inclined to think it's a problem with your code. As a workaround, you could create a new MediaPlayer when you want to play something new. On Wed, Apr 8, 2009 at 1:05 PM, ATrubka wrote: > > Guys, please... > Is there any Android native code developers around? > > On Apr 8, 12:38 am, ATrubka wrote: >> MediaPlayer.reset() always gets invoked. Here's the exact lines of >> code: >> >> _mediaPlayer.reset(); >> _mediaPlayer.setDataSource(resource); >> _mediaPlayer.prepare(); >> _mediaPlayer.start(); >> >> Additionally, the error occurs only when next audio starts while >> previous audio is about to end. >> If next audio starts in the middle of the playback or after it has >> completely stopped playing, then everything works fine. >> >> It looks pretty much like a synchronization issue to me. >> This method is not synchronized at the moment. >> Since most of the MediaPlayer code is native I'm not sure what should >> be synchronized. >> >> On Apr 7, 9:20 pm, Marco Nelissen wrote: >> >> > Looks like you're calling MediaPlayer.setDataSource() on a MediaPlayer >> > that was already initialized, without first calling >> > MediaPlayer.reset() >> >> > On Tue, Apr 7, 2009 at 1:28 PM, ATrubka wrote: >> >> > > Hi, guys. >> >> > > I'm using MediaPlayer and sometimes when first audio is about to end >> > > and I click to the next audio I get the exception below. Looks like >> > > the MediaPlayer is in some weird state of stopping playing and cannot >> > > accept audio at the moment. >> >> > > The exception goes to the native code which is greeks to me. >> > > I couldn't find anything about this error on the internet either. >> >> > > Is anyone here familiar with the problem? >> >> > > Thank you in advance! >> >> > > 04-07 20:19:35.855: ERROR/MediaPlayer(1066): setDataSource called in >> > > state 128 >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): Unable to play >> > > chapter audio >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): >> > > java.lang.IllegalStateException >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at >> > > android.media.MediaPlayer.setDataSource(Native Method) >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at >> > > com.tourizo.android.services.AudioPlayerService.playResource >> > > (AudioPlayerService.java:291) >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at >> > > com.tourizo.android.services.AudioPlayerService.access$3 >> > > (AudioPlayerService.java:287) >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at >> > > com.tourizo.android.services.AudioPlayerService$1.playCurrentChapter >> > > (AudioPlayerService.java:89) >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at >> > > com.tourizo.android.services.AudioPlayerRemoteInterface$Stub.onTransact >> > > (AudioPlayerRemoteInterface.java:99) >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at >> > > android.os.Binder.execTransact(Binder.java:276) >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at >> > > dalvik.system.NativeStart.run(Native Method) >> >> > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Intent to Trigger a Dialog Only
Works perfectly. Thanks! On Apr 9, 2:53 pm, Dianne Hackborn wrote: > Use Theme.Dialog for your activity's theme, and just put your dialog > contents inside of it instead of in a separate Dialog window. > > On Thu, Apr 9, 2009 at 12:41 PM, droozen wrote: > > > I want to expose a portion of my app with an intent that will only > > display a simple dialog box for system setting. The only way I > > currently know how to do this is to have an activity that accepts an > > intent. In the activity I don't use setContentView. I only create and > > show the dialog. The activity is finished after you press OK from the > > dialog. > > > This is kind of okay, but the activity shows as a black backdrop under > > the dialog, until you press OK which brings you back to the last > > application. I'd like to just be able to show the dialog on top of the > > calling Activity. Any idea on how this can be done? CAN it be done? > > -- > 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] ListView row not receiving highlight with ImageButton in row
Hi This must be something very simple but I've tried almost everything and still can't get this to work. Basically I've made a custom LinearLayout view with a TextView and an ImageButton to be used as a row for a ListView. The moment I use an ImageButton tapping on the row does not highlight the row any more. Moreover, I can't 'focus' the rows using the trackball, nor can I set focus on the button. If I remove the ImageButton and replace with an ImageView, the Row highlight/selection works. How can I get row selection/highlight along with ImageButton highlight at the same time? 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: How I call startActivity() in BradocastReceiver
You already asked this exact same question from a different email address. Please don't start multiple threads for the same question. On Tue, Apr 7, 2009 at 11:26 AM, yeons...@gmail.com wrote: > > hello, > > I'd like to launch one of settings app screen when I received a > certain event in idle state. > For that, I added my new intent to PhoneAppBroadcastReceiver() in > PhoneApp.java > (because it seems this receiver handles the misc intents) > But if I called startActivity(), seems phone goes to panic. > ex. startActivity(new Intent(this, NetworkSetting.class)); > > 1. How can I launch the activity inside of bradcastreceiver? > > 2. If the activity which I want to start is already started, how can I > check it? > I read can use NEW_TASK_LAUNCH but don't know how to use it. > If you have a sample code, could you post it? > > Thank you! > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Playback of dynamic MIDI?
This is not possible right now. On Wed, Apr 8, 2009 at 8:26 PM, meantime wrote: > > For one of my apps I generate MIDI data on the fly. Is there any way > to play MIDI data from a java.io.InputStream or directly from a byte > []? So far I've only seen ways to do MIDI playback from files. Given > the continuous and dynamic nature of my audio there is no way I can > write it to a file first. > > -c > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Intent to Trigger a Dialog Only
Use Theme.Dialog for your activity's theme, and just put your dialog contents inside of it instead of in a separate Dialog window. On Thu, Apr 9, 2009 at 12:41 PM, droozen wrote: > > I want to expose a portion of my app with an intent that will only > display a simple dialog box for system setting. The only way I > currently know how to do this is to have an activity that accepts an > intent. In the activity I don't use setContentView. I only create and > show the dialog. The activity is finished after you press OK from the > dialog. > > This is kind of okay, but the activity shows as a black backdrop under > the dialog, until you press OK which brings you back to the last > application. I'd like to just be able to show the dialog on top of the > calling Activity. Any idea on how this can be done? CAN it be done? > > > -- 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: weird accelerometer readings?
That looks pretty normal to me. On a perfectly level desk, you'd get numbers that sit around 0, 0, and -9.8. I don't know what causes the fluctuations, but that's just how it works. It's not an error. On Apr 8, 9:29 pm, Yuan wrote: > I implemented a simple program to record the accelerometer values as I > move it around. When I'm NOT moving anything, that is, it's lying flat > on a table, the values still seem to fluctuate wildly. > > Does anyone else notice this weirdness? > > I'm pasting some of the readings below: > x, y, z, time > Adata: 0.23154591, 0.44947147, -9.043911, 1239240099132 > Adata: 0.23154591, 0.23154591, -8.812365, 1239240099152 > Adata: 0.2860273, 0.2860273, -8.866846, 1239240099192 > Adata: 0.3405087, 0.23154591, -8.812365, 1239240099212 > Adata: 0.2860273, 0.23154591, -8.812365, 1239240099292 > Adata: 0.2860273, 0.2860273, -8.812365, 1239240099322 > Adata: 0.3405087, 0.2860273, -8.812365, 1239240099342 > Adata: 0.3405087, 0.2860273, -8.866846, 1239240099362 > Adata: 0.3949901, 0.23154591, -8.866846, 1239240099402 > Adata: 0.3405087, 0.23154591, -8.866846, 1239240099423 > Adata: 0.3405087, 0.23154591, -8.812365, 1239240099442 > Adata: 0.3405087, 0.23154591, -8.771504, 1239240099525 > Adata: 0.3405087, 0.2860273, -8.825985, 1239240099553 > Adata: 0.3405087, 0.2860273, -8.866846, 1239240099575 > Adata: 0.3949901, 0.3405087, -8.866846, 1239240099593 > Adata: 0.3405087, 0.3949901, -8.825985, 1239240099616 > Adata: 0.3949901, 0.3405087, -8.771504, 1239240099636 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Intent to Trigger a Dialog Only
I want to expose a portion of my app with an intent that will only display a simple dialog box for system setting. The only way I currently know how to do this is to have an activity that accepts an intent. In the activity I don't use setContentView. I only create and show the dialog. The activity is finished after you press OK from the dialog. This is kind of okay, but the activity shows as a black backdrop under the dialog, until you press OK which brings you back to the last application. I'd like to just be able to show the dialog on top of the calling Activity. Any idea on how this can be done? CAN it be done? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Audio record from Bluetooth headset
On Thu, Apr 9, 2009 at 6:08 AM, Dilli wrote: > > > > Hi all > > I am developing a recorder application > It works fine with Microphone. > > I want to record from Blue tooth headset > > i set it like > > my_Aud_Mgr.setMicrophoneMute(true); //AudioManager my_Aud_Mgr; > my_Aud_Mgr.setBluetoothScoOn(true); This routes audio to the Bluetooth chipset, but does not set up the SCO transport. We don't have public API's to do this yet, but you can look at ScoSocket.java or BluetoothHeadset.startVoiceRecognition() to see how we may release this in a future API. > > > but it cant record from Blue tooth device > > Ho to record from Blue tooth device > > Need help > > Thank you > > Dilli Rao > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: When will google post official cupcake SDK
The SDK Al is distributing contains a bug that prevents the emulator from using the network. On Thu, Apr 9, 2009 at 11:59 AM, Mattaku Betsujin wrote: > Thanks Al. I downloaded it. Works great. > > However, I couldn't connect to the network. E.g., launching browser will > show an error page. logcat reports "Unknown host www.google.com, throwing > UnknownHostException". > > I have a 1.0 emulator working on the same PC and it can access network just > fine. > > I tried passing -dns-server to emulator.exe, but that just made emulator.exe > to crash on start-up. > > Thanks > > On Thu, Apr 9, 2009 at 11:23 AM, Al Sutton wrote: >> >> http://andappstore.com/AndroidPhoneApplications/sdk/ >> >> >> --- >> >> * Written an Android App? - List it at http://andappstore.com/ * >> >> == >> Funky Android Limited is registered in England & Wales with the >> company number 6741909. The registered head office is Kemp House, >> 152-160 City Road, London, EC1V 2NX, UK. >> >> The views expressed in this email are those of the author and not >> necessarily those of Funky Android Limited, it's associates, or it's >> subsidiaries. >> >> >> >> From: android-developers@googlegroups.com >> [mailto:android-develop...@googlegroups.com] On Behalf Of Mattaku Betsujin >> Sent: 09 April 2009 19:22 >> To: android-developers@googlegroups.com >> Subject: [android-developers] When will google post official cupcake SDK >> >> Even a "beta" SDK would be helpful. There are lots of app developers who >> don't necessarily know how to build cupcake from the GIT. Given that HTC >> Magic (based on cupcake, I heard) is rolling out real soon now, wouldn't it >> be nice to give the app developers a chance to test if their app is >> compatible with cupcake? >> >> Sure, Android API is supposed to be backwards compatible. However, there >> are quite a few bugs in the G1 that I had to work around with ugly hacks. >> Now I start to worry if those hacks would break on cupcake. >> >> >> > > > > > -- 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: When will google post official cupcake SDK
Thanks Al. I downloaded it. Works great. However, I couldn't connect to the network. E.g., launching browser will show an error page. logcat reports "Unknown host www.google.com, throwing UnknownHostException". I have a 1.0 emulator working on the same PC and it can access network just fine. I tried passing -dns-server to emulator.exe, but that just made emulator.exe to crash on start-up. Thanks On Thu, Apr 9, 2009 at 11:23 AM, Al Sutton wrote: > http://andappstore.com/AndroidPhoneApplications/sdk/ > > > --- > > * Written an Android App? - List it at http://andappstore.com/ * > > == > Funky Android Limited is registered in England & Wales with the > company number 6741909. The registered head office is Kemp House, > 152-160 City Road, London, EC1V 2NX, UK. > > The views expressed in this email are those of the author and not > necessarily those of Funky Android Limited, it's associates, or it's > subsidiaries. > > > > -- > *From:* android-developers@googlegroups.com [mailto: > android-develop...@googlegroups.com] *On Behalf Of *Mattaku Betsujin > *Sent:* 09 April 2009 19:22 > *To:* android-developers@googlegroups.com > *Subject:* [android-developers] When will google post official cupcake SDK > > Even a "beta" SDK would be helpful. There are lots of app developers who > don't necessarily know how to build cupcake from the GIT. Given that HTC > Magic (based on cupcake, I heard) is rolling out real soon now, wouldn't it > be nice to give the app developers a chance to test if their app is > compatible with cupcake? > > Sure, Android API is supposed to be backwards compatible. However, there > are quite a few bugs in the G1 that I had to work around with ugly hacks. > Now I start to worry if those hacks would break on cupcake. > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Incorrect clip rect in onDraw()?
setText() invalidates the TextView entirely and when two invalidates happen in the same UI event (as it is the case in your code), the invalidate region becomes the union of the two original invalidate regions. On Wed, Apr 8, 2009 at 6:40 PM, Leisuresuit Larry wrote: > > Hi all, > > We came across a strange behavior. The clip rect of our custom view is > getting reset to its entire visible region, if we change the value of > another view. > > Below is a sample app to demonstrate the behavior: > > main.xml: > > http://schemas.android.com/apk/res/ > android" > android:orientation="vertical" > android:layout_width="fill_parent" > android:layout_height="fill_parent" > > > > android:id="@+id/view" > android:layout_width="fill_parent" > android:layout_height="100px" /> > > android:id="@+id/text" > android:layout_width="fill_parent" > android:layout_height="wrap_content" /> > > > > ClipTest.java: > package com.test; > > import android.app.Activity; > import android.os.Bundle; > import android.view.KeyEvent; > import android.widget.TextView; > > public class ClipTest extends Activity { > /** Called when the activity is first created. */ > �...@override > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main); > } > > > �...@override > public boolean onKeyDown(int keyCode, KeyEvent event) { > TextView tv = (TextView)findViewById(R.id.text); > tv.setText("Test"); > > findViewById(R.id.view).invalidate(100, 0, 150, 75); > return true; > } > } > > MyView.java: > package com.test; > > import android.content.Context; > import android.graphics.Canvas; > import android.graphics.Rect; > import android.util.AttributeSet; > import android.view.View; > > public class MyView extends View { > > public MyView(Context context) { > super(context); > } > > public MyView(Context context, AttributeSet attrs) { > super(context, attrs); > } > > protected void onDraw(Canvas canvas) { > super.onDraw(canvas); > > Rect clip = canvas.getClipBounds(); > System.out.println("clip " + clip); > } > } > > If you run the above app, MyView.onDraw() prints "clip Rect(0, 0, 320, > 100)". If you comment out "tv.setText("Test");", then MyView.onDraw() > prints "clip Rect(100, 0, 150, 75)". > > Why does setting the TextView's text affect MyView's clip rect? How > can we get the correct clip rect in MyView.onDraw()? Thanks for any > help! > > Larry > > > > -- 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: OOM errors during inflation
There is no memory leak in LayoutInflater. While this is never a proof, it's something we never encountered in any of the apps we wrote. Also, the Android team works very hard to plug all the memory leaks we can find and when we tell developers to use less memory it's when we're pretty sure that the APIs that seem to be causing the memory leak are not responsible. For instance, in your case you are basically saying that if you inflate views until you run out of memory, you run out of memory. Every View created by the adapter is kept by the ListView in a 'recycler'. That recycler is used to provide the adapter with a convertView whenever possible. That means you MUST reuse the convertView. If you need views of different types in the list, just use the appropriate APIs: Adapter.getViewTypeCount() and Adapter.getItemViewType(int position) (see http://d.android.com/reference/android/widget/Adapter.html). If you implement these methods correctly, ListView will manage several recyclers and always give you back the correct convertView. On Wed, Apr 8, 2009 at 6:14 AM, Niek wrote: > > Hi guys, > > I've read several posts from developers having OutOfMemory issues, and > a lot of them seem to be related to lists. I'm having a similar issue, > and the root of the problem seems to be a memory leak in the inflation > process. > > The problem is particularly tricky to track down, because as of yet it > seems impossible to get a view of part of the heap (where the bitmaps > reside, and possibly other objects), as also mentioned by Ward and > others. > > I created a small demo, so hopefully some Google engineers (Romain, > Dianne) can look at this, and either point out to me what I'm doing > wrong, or fix a possible memory leak in the inflation process in the > Android framework. I'm sure a lot of people would be very thankful if > this issue got resolved, as it often results in sudden crashes of the > app, without a clear reason. I must say it's disappointing to read the > standard: "use less memory" reply from Google to a lot of these posts, > as it seems to be worthy of further investigation. > > Here's the demo, and the resulting logcat log with some peculiarities > contained within. > > http://www.coffeebreakmedia.com/android_heap_issue.zip > > A small explanation: it's a very simple list implementation with a > ListAdapter. It works fine if the list rows are inflated just once (by > re-using the convertView), but I purposely commented out two lines of > code: > > // if(convertView == null) { > convertView = inflater.inflate(R.layout.list_row, > parent, false); > // } > > This is to ensure that for each row, the XML is inflated again. In > this demo, this would be completely unnecessary and a big waste, but > in a real life a similar scenario happens when you have a list with a > few different types of rows (e.g., a different xml is used for the > header of a set of items, which use their own xml). In that case, > sometimes the convertView will be of the wrong type, in which case you > have to inflate another one. Obviously, this would then happen less > often than in this demo, but this only postpones the issue: eventually > you'll run into the same problem as is demonstrated here. > > To test the demo, simply open the project in Eclipse (you can use the > emulator, but it also happens on the G1), and follow these > instructions: > > 1. Completely scroll down the list as fast as you can (all the way to > Item 199), and then back up again. > 2. Keep doing this until you scrolled down & up about 5 times, while > watching the LogCat. > > Eventually, you'll start getting errors such as these: > > 04-08 12:15:03.380: ERROR/dalvikvm-heap(345): 13824-byte external > allocation too large for this process. > 04-08 12:15:03.380: ERROR/(345): VM won't let us allocate 13824 bytes > > Keep scrolling! And you'll see this after a few more ups & downs: > > 04-08 12:16:48.589: DEBUG/dalvikvm(345): GC freed 0 objects / 0 bytes > in 169ms > 04-08 12:16:48.589: INFO/dalvikvm-heap(345): Clamp target GC heap from > 16.003MB to 16.000MB > 04-08 12:16:48.589: INFO/dalvikvm-heap(345): Grow heap (frag case) to > 16.000MB for 24-byte allocation > 04-08 12:16:48.810: INFO/dalvikvm-heap(345): Clamp target GC heap from > 18.003MB to 16.000MB > > Apparently, the 16MB heap is used completely at this point, which > seems rather wasteful considering the simplicity of the application in > question. > > After still more scrolling, you'll get errors such as this: > > 04-08 12:17:01.700: ERROR/dalvikvm-heap(345): Out of memory on a 708- > byte allocation. > 04-08 12:17:01.700: INFO/dalvikvm(345): "main" prio=5 tid=3 RUNNABLE > 04-08 12:17:01.700: INFO/dalvikvm(345): | group="main" sCount=0 > dsCount=0 s=0 obj=0x400103e8 > 04-08 12:17:01.700: INFO/dalvikvm(345): | sysTid=345 nice=0 > sched=0/0 handle=-1093522276 > 04-08 12:17:01.700: INFO/dalvikvm(345): at > java.lang.AbstractStringBuilder.enlar
[android-developers] Re: layout_weight is inconsistent for horizontal and vertical orientation.
I already explained this to you :) The weight is meant to distribute the remaining empty space amongst the views. In your case, there is NO remaining empty space since all your views are "fill_parent" (i.e., they are as wide and as tall as their parent.) In this case, LinearLayout *subtracts* the overflowing space from the views. So if a child has a weight of 2 it will be shrunk twice as much as a child with a weight of 1. On Wed, Apr 8, 2009 at 2:32 PM, Lars Dunemark wrote: > > Hi everybody! > > I have played around a bit with the xml files for creating layouts and > can't explain the behaviour of layout_weight when using it in a > LinearLayout that has orientation="vertical" > > When creating a layout that is horizontal everything follows the > documentation, that a child would get more space if it's has the > highest value. > > > But the following code for vertical orientation, give more space to > the item with lowest weight. > > > http://schemas.android.com/apk/res/android"; > android:orientation="vertical" > android:layout_width="fill_parent" > android:layout_height="fill_parent"> > > android:orientation="horizontal" > android:layout_width="fill_parent" > android:layout_height="fill_parent" > android:layout_weight="3"> > > android:text="test" > android:gravity="center_horizontal" > android:background="#aa" > android:layout_width="wrap_content" > android:layout_height="fill_parent" > android:layout_weight="1"/> > > > > android:orientation="horizontal" > android:layout_width="fill_parent" > android:layout_height="fill_parent" > android:layout_weight="2"> > > android:text="test" > android:gravity="center_horizontal" > android:background="#00aa00" > android:layout_width="wrap_content" > android:layout_height="fill_parent" > android:layout_weight="1"/> > > > > > > And the question is: Is this a bug or just a feature that maybe need > more documentation? > > Best Regards > Lars Dunemark > > > > -- 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: How could I put tab widget at the right or left side ?
Something I am in the process of doing right now. It's wonderful being able to look at the source of the TabWidget in GIT. makes it a lot easier. On Apr 9, 11:19 am, Dianne Hackborn wrote: > It's not supported. You'd need to write your own tab widget (which is > certainly possible, there is nothing especially magical about tab widget). > > > > On Wed, Apr 8, 2009 at 6:54 PM, milton wrote: > > > Hi all > > > Currently I could find tab widget which located at the upper side of > > the screen. (ex. Dialer, Contacts) > > How could I put the tab widget at the left or right side of the > > screen? > > I had checked the reference of SDK and some parts of the source code > > but I could not find a way to do it. > > Could anyone kindly give me advice or clue about how to do it ? > > > Thanks in advance. > > > Regards > > Milton > > -- > 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: When will google post official cupcake SDK
http://andappstore.com/AndroidPhoneApplications/sdk/ --- * Written an Android App? - List it at http://andappstore.com/ * == Funky Android Limited is registered in England & Wales with the company number 6741909. The registered head office is Kemp House, 152-160 City Road, London, EC1V 2NX, UK. The views expressed in this email are those of the author and not necessarily those of Funky Android Limited, it's associates, or it's subsidiaries. _ From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of Mattaku Betsujin Sent: 09 April 2009 19:22 To: android-developers@googlegroups.com Subject: [android-developers] When will google post official cupcake SDK Even a "beta" SDK would be helpful. There are lots of app developers who don't necessarily know how to build cupcake from the GIT. Given that HTC Magic (based on cupcake, I heard) is rolling out real soon now, wouldn't it be nice to give the app developers a chance to test if their app is compatible with cupcake? Sure, Android API is supposed to be backwards compatible. However, there are quite a few bugs in the G1 that I had to work around with ugly hacks. Now I start to worry if those hacks would break on cupcake. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] When will google post official cupcake SDK
Even a "beta" SDK would be helpful. There are lots of app developers who don't necessarily know how to build cupcake from the GIT. Given that HTC Magic (based on cupcake, I heard) is rolling out real soon now, wouldn't it be nice to give the app developers a chance to test if their app is compatible with cupcake? Sure, Android API is supposed to be backwards compatible. However, there are quite a few bugs in the G1 that I had to work around with ugly hacks. Now I start to worry if those hacks would break on cupcake. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Subclassed ImageView does not draw in Gallery View
I am subclassing the ImageView class and adding to the Gallery View. But, nothing seems to get drawn in the expected location; though I can fling through the Gallery list. I added an image from a resource, and it shows up correctly in the Gallery. Any idea on why this may be happening? Here is the code I am using: public class CustomCanvas extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Gallery g = (Gallery) findViewById(R.id.gallery); g.setAdapter(new ImageAdapter(this)); } private class CustomImageView extends ImageView { public CustomImageView(Context context) { this(context, null); } public CustomImageView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public CustomImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } protected void onDraw(Canvas canvas) { canvas.drawColor(Color.BLUE); } } private class ImageAdapter extends BaseAdapter{ public ImageAdapter(Context c) { mContext = c; } public int getCount() { return 2; } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent) { if (position == 1) { ImageView i = new ImageView(mContext); i.setImageResource(R.drawable.icon); return i; } else { CustomImageView w = new CustomImageView (mContext); w.invalidate(); return w; } } private Context mContext; } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How could I put tab widget at the right or left side ?
It's not supported. You'd need to write your own tab widget (which is certainly possible, there is nothing especially magical about tab widget). On Wed, Apr 8, 2009 at 6:54 PM, milton wrote: > > Hi all > > Currently I could find tab widget which located at the upper side of > the screen. (ex. Dialer, Contacts) > How could I put the tab widget at the left or right side of the > screen? > I had checked the reference of SDK and some parts of the source code > but I could not find a way to do it. > Could anyone kindly give me advice or clue about how to do it ? > > Thanks in advance. > > Regards > Milton > > > > -- 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: Send Email Automatically
On Wed, Apr 8, 2009 at 5:58 AM, Eileen Novack wrote: > I have been following this thread with some interest. Since I also want to > be able to send an email without any user intervention. Now before anyone > says that should not be possible since it would be a security problem, let > me point out that I can send an SMS message without user intervention, if I > have the permissions set properly. So I would expect that I would also need > to set permission to allow sending email as well. There is only one way SMSs can be handled. On the G1 there are two e-mail clients built in to the system, one of which can have multiple accounts. You CAN NOT send an e-mail without the user being involved, period, because you simply have no way to know how that e-mail should be sent. If you want to send an e-mail, you need to have the code for doing so in your app, and have the user specify the account information for it. > I have been poking around a bit in the source code and found this in the > stock Android email app: > > package com.android.email.mail.transport; > > /** > * This class handles all of the protocol-level aspects of sending messages > via SMTP. > */ > public class SmtpSender extends Sender { >public static final int CONNECTION_SECURITY_NONE = 0; >public static final int CONNECTION_SECURITY_TLS_OPTIONAL = 1; >public static final int CONNECTION_SECURITY_TLS_REQUIRED = 2; >public static final int CONNECTION_SECURITY_SSL_REQUIRED = 3; >public static final int CONNECTION_SECURITY_SSL_OPTIONAL = 4; >private Transport mTransport; 53 String mUsername; 54 String > mPassword; >.. > > /** Allowed formats for the Uri: > * smtp://user:passw...@server:port CONNECTION_SECURITY_NONE > * smtp+tls://user:passw...@server:port CONNECTION_SECURITY_TLS_OPTIONAL > * smtp+tls+://user:passw...@server:port CONNECTION_SECURITY_TLS_REQUIRED > * smtp+ssl+://user:passw...@server:port CONNECTION_SECURITY_SSL_REQUIRED > * smtp+ssl://user:passw...@server:port CONNECTION_SECURITY_SSL_OPTIONAL > * > * @param uriString the Uri containing information to configure this sender > */ > public SmtpSender(String uriString) throws MessagingException { > ... > > > Which seems to have public methods to send email. You are looking in the e-mail app. There is nothing public here at all. It is just internal implementation of the application. It doesn't matter if it makes a class public in its internal implementation, it is still internal, and nothing you can use. > As I understood the > philosophy behind building Android apps, which is to reuse > public Intents and methods to allow the scarce available memory to be > leveraged as much as possible. Yes, there are intents for using parts of an application that they want to allow others to access. There is no standard intent for "send an e-mail without the user being involved," and I don't expect there to be such a thing any time soon if at all. Some specific e-mail application may define its own intents to use for that, but this would be specific to that app, so you would need to know about it yourself. (And if multiple apps were to support this, you would still need to have the user involved to decide which app to use, and possible which account in that app to use.) > So the question is: Can we use the existing code to send email in the stock > Android email app? Or is that sort of thing frowned upon? It's not possible. -- 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] CONTROL_LOCATION_UPDATES permission failure
Hello, Although the manifest file in my application contains the operation, mTelephonyManager.enableLocationUpdates(); fails with 04-09 14:01:01.754: WARN/System.err(5495): java.lang.SecurityException: Neither user 10026 nor current process has android.permission.CONTROL_LOCATION_UPDATES. Could anyone help me understand where I am making a mistake, and how to correct it? Thanks. Alex Donnini --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How I call startActivity() in BradocastReceiver
1. This is the wrong group, you should be posting in android-porting. 2. You should post enough information for people to actually help you. What does "phone goes in panic" mean? Is there a stack crawl? Log output? What? 3. There is lots of documentation in the SDK about these things. Please be sure you read these first -- there is documentation in the Intent class for these flags, overview documentation about the general application model, etc. On Tue, Apr 7, 2009 at 11:26 AM, yeons...@gmail.com wrote: > > hello, > > I'd like to launch one of settings app screen when I received a > certain event in idle state. > For that, I added my new intent to PhoneAppBroadcastReceiver() in > PhoneApp.java > (because it seems this receiver handles the misc intents) > But if I called startActivity(), seems phone goes to panic. > ex. startActivity(new Intent(this, NetworkSetting.class)); > > 1. How can I launch the activity inside of bradcastreceiver? > > 2. If the activity which I want to start is already started, how can I > check it? > I read can use NEW_TASK_LAUNCH but don't know how to use it. > If you have a sample code, could you post it? > > Thank you! > > > > > > > -- 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: is there best way to passing array buffer between Activity in same application
Really really do not pass large amounts of data (such as bitmaps) through an Intent. This data must be marshalled over to the system process, held there the entire time the target activity can be in use, and marshalled back over to the application process when the activity is being launched. You can certainly put data in globals, but you need to be aware you will lose this if your process gets killed (such as if the user presses home to leave your app, goes and does something else, and memory is needed that causes it ot be killed). Then when the user returns to your app, your data will be gone. I would probably suggest that you store the data in a file. On Tue, Apr 7, 2009 at 1:13 PM, Hwayoung wrote: > > Hi. deer android developers :) > > I am developing an image applications. > > One activity decoding image file (jpg, bmp, and so on) to byte buffer > RGB 565 or 888 type. > > then want to pass image buffer to another activity for change image > data. > > i have 3 activity the main decoding activity[A] and selecting effect > activity[B] and apply effect activity[C] for change image data. > > if i use intent then activity[A] should make intent[1] and putExtra to > that intent. > and then [B] call getIntent and getByteArrayExtra for get byte buffer. > > if user select effect then [B] make new intent[2] and putExtra to > intent[2]. > and startActivityForResult with intent[2] and activity[C]. > > then activity[C] call getIntent to get intent[2] and getByteArrayExtra > for get byte buffer again. > > there takes much times to make new byte buffer and copy from parent's > activity's byte buffer 2 times. [A]->[B] and [B]->[C] > > That process drops application performance. > > Questions > > 1. can i pass intent[1] to activity[C] without make new intent[2] and > putExtra byte buffer? by modify intent[1]. (if it works just 1 buffer > copy will perform) > > 2. can i use application global memory for share byte buffer? if i use > hash map how can each activity access same hash map? (if it works > don't need to copy buffer) > > > > -- 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: Problem Starting New Activity
You can't currently replace the in-call experience. On Thu, Apr 9, 2009 at 6:58 AM, Marc Poppleton wrote: > > Hi, > > Where is the PHONE_STATE_CHANGED Intent defined? I can't find it > anywhere in the documentation and am in a situation similar to Bnet's. > I'm trying to get my Activity to pop-up when an incoming call occurs, > I don't like the default view and want my own instead (I wish to > display extra data about the callee than currently displayed). > > Thanks, > > Marc > > On 3 mar, 20:25, Marco Nelissen wrote: > > On Tue, Mar 3, 2009 at 9:09 AM, Bnet wrote: > > > > > I'm trying to call the SoundNotification.java from the > > >PhoneStateListenerto test a default system notification sound. When a > > > missed call state is true, the SoundNotification.java is called to > > > play the sound or beep. I understand your point about the receiver > > > dropping thephonestatelistenerand appreciate the feedback. Thanks > > > again. > > > > OK, so it sounds like *what* you want to do (your MyPhoneStateListener > > and SoundNotification classes are part of *how* you want to do it) is > > to play a sound when a call is missed. > > So first you need to figure out if a call is missed. There are a > > number of ways to do that. You were trying to do this by using > aPhoneStateListener, which is fine, but I don't think you actually need > > it. You already have a receiver for the PHONE_STATE_CHANGED Intent > > broadcast, and that Intent already contains an 'extra' that tells you > > the current state, so you shouldn't need to set up aPhoneStateListener. > > Then, since you're determining whether a call was missed by > > idle-ringing-idle transitions, you'll need some place to store the > > intermediate states, so that when the call state goes to idle again, > > you can check whether the previous state was offhook, and if not, play > > the sound. > > You could use a Service to keep track of the intermediate states, but > > a simpler solution might be to store/retrieve the previous state using > > a SharedPreference. However you want to do it is up to you, but you > > shouldn't rely on the broadcast receiver itself keeping any state for > > you. Once you've determined that a call was missed, you play the > > sound, probably using MediaPlayer. > > > > -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Activity can't be displayed from a notification
Have you tried just launching the activity from elsewhere to see if it actually works at all? (For example you can use the am command to launch an activity.) Fwiw, you don't want to use the Theme.Activity.Alert style. Actually that shouldn't even be part of the SDK, so I'm not sure how you are using it at all. (And if you are not using the SDK, you should not be here, but in android-porting.) On Wed, Apr 8, 2009 at 11:34 PM, Devin Yu wrote: > > Dears, > > I've a problem and would like somebody help me. > > When MountService received event from HAL and start a notification, > it would display an AlertActivity after user's click. > However, I found the AlertActivity is created and can't be displayed. > > I got some log as below, > > 06-01 19:17:56.178: INFO/ActivityManager(934): Starting activity: > Intent { comp={android/com.android.internal.app.UsbStorageActivity} } > 06-01 19:17:56.178: WARN/ActivityManager(934): startActivity called > from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: > Intent { flags=0x80 comp={android/ > com.android.internal.app.UsbStorageActivity} } > 06-01 19:17:56.278: DEBUG/Mount(934): USB activity create > 06-01 19:17:56.278: DEBUG/Mount(934): USB activity Resume > 06-01 19:17:56.308: VERBOSE/ActivityThread(934): Resuming > ActivityRecord{43936620 token=HistoryRecord{43933848 {android/ > com.android.internal.app.UsbStorageActivity}} {android/ > com.android.internal.app.UsbStorageActivity}} with isForward=true > 06-01 19:17:56.378: DEBUG/Mount(934): USB activity Pause > > and its description in AndroidManifest.xml is as below, > android:name="com.android.internal.app.UsbStorageActivity" >android:theme="@style/Theme.Dialog.Alert" >android:excludeFromRecents="true"> > > > Is it related to "FLAG_ACTIVITY_NEW_TASK"? however, how to solve it? > > I've tried to use "launchmode as singleTask", but is doesn't work. > > Is there anyone give me a hand? > Why my activity can be created but can't be displayed? > > I'm appreciated for your help. > > > > -- 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: WebView - issues with back button
I tried this approach and it worked out fine. I followed step 3 and I used WebViewClient implemented my own shouldOverrideUrlLoading() >From within this method public boolean shouldOverrideUrlLoading(WebView view, String url) { Intent i = new Intent( Intent.ACTION_VIEW, Uri.parse(url) ); i.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK ); try { view.getContext().startActivity( i ); } catch (Exception e) { Log.e("Problem", e.getMessage()); } return true; } This enabled me to get clicks and also handoff the URL to a different WebView. If you see issues with this approach, pls let me know. Thank you. On Thu, Apr 9, 2009 at 8:08 AM, rch wrote: > > Step 1: > I am subclassing WebView and rendering html content properly. The > intial content is very small with a div and image /link > This is displayed in a LInear Layout along with a TextView and > ListView. That is my first screen/activity of the application. > > Step 2: > When I click on a link on this webview, it goes through the > webViewclient and expands to full screen to fit the content of the > requested page. > > After Step 2, I am not able to go back to my activity screen once the > content is displayed. > When I click on the back button to getback to my activity screen > close my activity and goes to the phone's applications desktop. (i.e > goes out of my application). > > Step 3: > In order to fix this issue, I stopped setting my own subclasssed > WebViewClient. After doing this, the it seems to render the clicked > page in a webView as subactivity. Now When I click on backbutton, it > goes back to the activity screen. But, the issue now is, I am not > catch event when a link is clicked. How can I catch click events in > this case. > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Positioning a Dialog at a required location (x,y)
You need to get the Window from the dialog, and update the window layout params as desired. On Wed, Apr 8, 2009 at 10:19 AM, sacchu wrote: > > Hi, > I'm displaying some content in a Dialog. By default the Dialog is > displayed at the center of the window. I would like to position it at > a location (x,y). I'm not able to achieve this using Gravity. Probably > I'm not doing it in the right way.. Has any one faced a similar > issue? > > Regards, > Sachin > > > > > -- 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: MVC model state change requires creating an Intent?
They are all running in the same process, and in fact there is a method on Activity to get the containing activity. Just wire these together however you want. On Thu, Apr 9, 2009 at 7:07 AM, nick.titatingmembr...@googlemail.com < nick.titatingmembr...@googlemail.com> wrote: > > Hi, > > I have a main activity class that launches a couple of my subordinate > activities from a tabHost. > > Periodically (actually when I receive an incoming message on a > socket), I want to inform the subordinate activities that application > state has changed so that they can refresh their views. > > In Swing I could wire this together using something like a > PropertyChangeListener. As far as I can see, the Android design > philosophy requires creating an Intent and broadcasting to (as far as > I can tell all) other activities that are running. > > This strikes me as overkill considering that I'm only trying to notify > my own views of a model change. Am I missing something? > > Thanks, > > Nick. > > > > -- 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: Permissions to install other apps...
There is an API in cupcake to allow you to perform the dexopt into your own directory. That will be available when cupcake is available. On Thu, Apr 9, 2009 at 2:05 AM, Eborix13 wrote: > > Hi, > > We are a team of Android developers and we are facing a serious > problem for quite some time. Our app (a game client) is designed in > such a way, that once it's installed it can be used to download games > from a game server. In order for the downloaded games to work, they > have to be installed and launched by the client. > > The problem is that the client has no write/update rights for the / > data/dalvik-cache directory, unless we specifically execute the chmod > 777 command for that directory. Setting the > android.permission.INSTALL_PACKAGES permission in the client's > manifest file also doesn't work. After reading countless forums where > other people have complained about the same problem, we would like to > know when this issue is going to be resolved. Apparently the code for > this feature already exists (the DexFile class of the so called > "cupcake" release) but it hasn't been released yet. > > What's more frustrating is that the Android team points out that all > Android apps are equal, that system apps are equal in rights to custom > apps. Obviously this is not the case. If the client game app is > installed in the /system/app the problem described above is solved. > System apps have the right to dynamically install other apps. Regular > apps (installed in the /data/data folder) do not. > > Is this issue going to be resolved anytime soon? Will the "cupcake" > DexFile class going to be present in the next release? This is a > rather urgent problem since we are waiting for this new functionality > in order to continue development. > > Thank you... > > > > -- 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] Updating a built-in application - data preserved?
Hi, There was a discussion on this earlier (http://groups.google.com/group/ android-developers/msg/59f5c1ad46e6b94c) - could someone confirm whether the functionality of updating a built-in/system application with a app published on the Android Market will be available in cupcake? If I have an agreement with the device manufacturer/operator to pre- install my application on the device, I want to be able to publish an update to the application later via Android Market. I will have access to the same certificate as was used to sign the original application that was bundled with the device. Thanks, Ashutosh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Permissions to install other apps...
Hi, We are a team of Android developers and we are facing a serious problem for quite some time. Our app (a game client) is designed in such a way, that once it's installed it can be used to download games from a game server. In order for the downloaded games to work, they have to be installed and launched by the client. The problem is that the client has no write/update rights for the / data/dalvik-cache directory, unless we specifically execute the chmod 777 command for that directory. Setting the android.permission.INSTALL_PACKAGES permission in the client's manifest file also doesn't work. After reading countless forums where other people have complained about the same problem, we would like to know when this issue is going to be resolved. Apparently the code for this feature already exists (the DexFile class of the so called "cupcake" release) but it hasn't been released yet. What's more frustrating is that the Android team points out that all Android apps are equal, that system apps are equal in rights to custom apps. Obviously this is not the case. If the client game app is installed in the /system/app the problem described above is solved. System apps have the right to dynamically install other apps. Regular apps (installed in the /data/data folder) do not. Is this issue going to be resolved anytime soon? Will the "cupcake" DexFile class going to be present in the next release? This is a rather urgent problem since we are waiting for this new functionality in order to continue development. Thank you... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Modular resources under eclipse
I'm developing a family of applications that have a lot of functionality in common. In eclipse, I have a "core" project with all the base functionality. Each individual application project has this core project on its build path, so it can use the functionality offered by the core project. This works fine for code: the android eclipse plugin packages all code in the .apk files of the application projects, so each application apk file is then a self-contained application. However, I also want to reuse the resources that are used by the core project, like layouts and images. The "core" project is an android project with resources, but these resources are not packaged automatically in the application projects. In a perfect world, the "core" resources would be merged in the application project seamlessly, even updating R.java in the application project when a core resource changed. I understand this is probably too much to hope for, and I might end up juggling two "R" classes in my application: the core R in one package and the application R in another package. Outside of eclipse I can see how this might work: I package both sets of resources in the apk file, and with two AssetManager (and Resources) instances manage the two sets of resources. Or maybe I use ant to first create a single distribution by merging the core and application project files into a single directory, and then build the apk like you would do when there is only a single project. Is there some way to trick eclipse into packaging both "core" and "application" resources files into one .apk file? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to get the original string data?
XML handles some characters differently, for example quotes, and the Android XML parser is no different. I recommend you read up on it here: http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML What this means for your example is that you should have there$aposs instead of there's in your xml. Yusuf The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Apr 8, 5:35 am, manoj wrote: > Hi I am doing a small example which parses the .xml file and displays > it. > > The problem is, I am unable to parse properly. some characters are not > displaying properly. > > for example, there's is displaying as thereâs. > > I am using dom parser. > > Can some one please help me to resolve this problem. > > Thanks, > Manoj. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] layout_weight is inconsistent for horizontal and vertical orientation.
Hi everybody! I have played around a bit with the xml files for creating layouts and can't explain the behaviour of layout_weight when using it in a LinearLayout that has orientation="vertical" When creating a layout that is horizontal everything follows the documentation, that a child would get more space if it's has the highest value. But the following code for vertical orientation, give more space to the item with lowest weight. http://schemas.android.com/apk/res/android"; android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> And the question is: Is this a bug or just a feature that maybe need more documentation? Best Regards Lars Dunemark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 compile the apk file?
How can i building my application alone, generate the apk file?? My source path look like this: /packages/inputmethod/pinyinIME/src/***.java /packages/inputmethod/pinyinIME/res/ /packages/inputmethod/pinyinIME/lib/ /packages/inputmethod/pinyinIME/jni/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] problem while opening the Connection
hi this is anitha. I am new to andriod. While i was trying to open the connection through coding it raises an error like the below one. [2009-04-09 15:16:53 - DeviceMonitor]Error reading jdwp list: EOF [2009-04-09 15:16:53 - DeviceMonitor]Connection Failure when starting to monitor device 'emulator-5554' : device (emulator-5554) request rejected: device not found 2)Please give me the solution to avoid this error and also where the database is created in eclipse.exe editor. pls let me know . Its a little bit urgent. Thanks&Regards Anitha.A --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How to pass object in Parcel???
I have two class, class A and B, B includ class A, like this: class A { int a; int b; } class B { A a; //this is Class A int b; } class B should implement like this class B extends parcelable { //how to implement WriteToParcel and ReadFromParcel functions in class B in order to write/read object A??? } it is better give example for writetoparcel and readfromparcel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] ADP1 device not listing by adb devices command in Ubuntu.
Hi, I am trying to flash images to ADP1 G1 Android device. For this, I have tried to Setting up a Device for Development as follows: 1. Login as root and create this file: /etc/udev/rules.d/50- android.rules. SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666" 2. Now execute: chmod a+rx /etc/udev/rules.d/50-android.rules But, still I am not able to list the device on giving adb devices OR fastboot devices. Again I have tried as below steps. 1) Make an "android" group and add yourself to it. 2) Found out the Vendor ID of your device using lsusb. The vendor ID is the number before the semicolon. $ lsusb Bus 005 Device 005: ID 0bb4:0c02 High Tech Computer Corp. ... 3) Create a rules file as root. # cat - > 70-android.rules BUS=="usb", SYSFS{idVendor}=="0bb4", GROUP="android", MODE="0660" -D 4) # /etc/init.d/udev restart But, still no luck for me to list the device on giving adb devices OR fastboot devices. Can anyone help me to list the device to flash the images onto it. Thanks & regards, Lumit --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] setOnKeyListener does not works with MapView
Hi all, I am trying to write a map application based on the MapView, and I need to handle the UP/DOWN/LEFT/RIGHT keys. At first, I tried to implement with setOnKeyListener, please take a look at he following code. mapView = (MapView) findViewById(R.id.mapview); // set on key listener mapView.setOnKeyListener(onKeyListener); // Inner class for OnKeyListener final private OnKeyListener onKeyListener = new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { boolean ret = false; Log.i("SuperMap", "event.getAction()=" + event.getAction()); Log.i("SuperMap", "keyCode=" + keyCode); if (event.getAction() == KeyEvent.ACTION_DOWN) // key pressed down switch (keyCode) { case KeyEvent.KEYCODE_DPAD_UP: Toast.makeText(SuperMap.this, "UP", Toast.LENGTH_SHORT) .show(); ret = true; break; case KeyEvent.KEYCODE_DPAD_DOWN: Toast.makeText(SuperMap.this, "DOWN", Toast.LENGTH_SHORT) .show(); ret = true; break; case KeyEvent.KEYCODE_DPAD_LEFT: Toast.makeText(SuperMap.this, "LEFT", Toast.LENGTH_SHORT) .show(); ret = true; break; case KeyEvent.KEYCODE_DPAD_RIGHT: Toast.makeText(SuperMap.this, "RIGHT", Toast.LENGTH_SHORT) .show(); ret = true; break; default: // do nothing here ret = false; break; } else { // do nothing when key released or multiple keys pressed at the // same time ret = false; } return ret; } }; It compiles OK, but does not works (there isn't any log in Logcat, seems it does not receive any key press event). Later, I tried to use the onKeyDown() function, so no setOnKeyListener () is needed, and all I need is just the following function which override the one in the super class. @Override public boolean onKeyDown(int keyCode, KeyEvent event) { boolean ret = false; Log.i("SuperMap", "event.getAction()=" + event.getAction()); Log.i("SuperMap", "keyCode=" + keyCode); if (event.getAction() == KeyEvent.ACTION_DOWN) // key pressed down switch (keyCode) { case KeyEvent.KEYCODE_DPAD_UP: Toast.makeText(SuperMap.this, "UP", Toast.LENGTH_SHORT).show(); ret = true; break; case KeyEvent.KEYCODE_DPAD_DOWN: Toast.makeText(SuperMap.this, "DOWN", Toast.LENGTH_SHORT) .show(); ret = true; break; case KeyEvent.KEYCODE_DPAD_LEFT: Toast.makeText(SuperMap.this, "LEFT", Toast.LENGTH_SHORT) .show(); ret = true; break; case KeyEvent.KEYCODE_DPAD_RIGHT: Toast.makeText(SuperMap.this, "RIGHT", Toast.LENGTH_SHORT) .show(); ret = true; break; default: // do nothing here ret = false; break; } else { // do nothing when key released or multiple keys pressed at the // same time ret = false; } return ret; } This time, it works, but I am confused. According to my understanding, they are almost the same. Anybody knows why? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] ADP1 device is not listing by adb devices command in Ubuntu.
Hi, I am trying to flash images to ADP1 G1 Android device. For this, I have tried to Setting up a Device for Development as follows: 1. Login as root and create this file: /etc/udev/rules.d/50- android.rules. SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666" 2. Now execute: chmod a+rx /etc/udev/rules.d/50-android.rules But, still I am not able to list the device on giving adb devices OR fastboot devices. Again I have tried as below steps. 1) Make an "android" group and add yourself to it. 2) Found out the Vendor ID of your device using lsusb. The vendor ID is the number before the semicolon. $ lsusb Bus 005 Device 005: ID 0bb4:0c02 High Tech Computer Corp. ... 3) Create a rules file as root. # cat - > 70-android.rules BUS=="usb", SYSFS{idVendor}=="0bb4", GROUP="android", MODE="0660" -D 4) # /etc/init.d/udev restart But, still no luck for me to list the device on giving adb devices OR fastboot devices. Also my adb command is not responding for a long time Can anyone help me to list the device to flash the images onto it. Thanks & regards, Lumit --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] API Demos APK not running.
Hi, I am trying to run API-Demos.apk in the zoom board. But it seems, the APK is not getting installed properly. I have compiled the CodeBase using Eclipse, and source is been taken from Android SDK 1.0. Please let me know, how can i run the application on zoom board. Thanks, Tamal Tanu Biswas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] MVC model state change requires creating an Intent?
Hi, I have a main activity class that launches a couple of my subordinate activities from a tabHost. Periodically (actually when I receive an incoming message on a socket), I want to inform the subordinate activities that application state has changed so that they can refresh their views. In Swing I could wire this together using something like a PropertyChangeListener. As far as I can see, the Android design philosophy requires creating an Intent and broadcasting to (as far as I can tell all) other activities that are running. This strikes me as overkill considering that I'm only trying to notify my own views of a model change. Am I missing something? Thanks, Nick. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How could add a new src folder into android src for compiling?
You could do this very easily in eclipse. Just go to the project properties and choose java build path view.In the source tab add a folder that you want to set as souce folder. Is zte developing android phones? I come from china ,too. Vincent Chan On Thu, Apr 9, 2009 at 4:17 PM, chengli wrote: > > I want to add a new src folder to android project,but there are so > many file "android.mk",so are my src folder.I have no ideas how these > makefiles are connected with each other while compiling, how could I > do ? > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] WebView - issues with back button
Step 1: I am subclassing WebView and rendering html content properly. The intial content is very small with a div and image /link This is displayed in a LInear Layout along with a TextView and ListView. That is my first screen/activity of the application. Step 2: When I click on a link on this webview, it goes through the webViewclient and expands to full screen to fit the content of the requested page. After Step 2, I am not able to go back to my activity screen once the content is displayed. When I click on the back button to getback to my activity screen close my activity and goes to the phone's applications desktop. (i.e goes out of my application). Step 3: In order to fix this issue, I stopped setting my own subclasssed WebViewClient. After doing this, the it seems to render the clicked page in a webView as subactivity. Now When I click on backbutton, it goes back to the activity screen. But, the issue now is, I am not catch event when a link is clicked. How can I catch click events in this case. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: OOM errors during inflation
Hi guys, I've read several posts from developers having OutOfMemory issues, and a lot of them seem to be related to lists. I'm having a similar issue, and the root of the problem seems to be a memory leak in the inflation process. The problem is particularly tricky to track down, because as of yet it seems impossible to get a view of part of the heap (where the bitmaps reside, and possibly other objects), as also mentioned by Ward and others. I created a small demo, so hopefully some Google engineers (Romain, Dianne) can look at this, and either point out to me what I'm doing wrong, or fix a possible memory leak in the inflation process in the Android framework. I'm sure a lot of people would be very thankful if this issue got resolved, as it often results in sudden crashes of the app, without a clear reason. I must say it's disappointing to read the standard: "use less memory" reply from Google to a lot of these posts, as it seems to be worthy of further investigation. Here's the demo, and the resulting logcat log with some peculiarities contained within. http://www.coffeebreakmedia.com/android_heap_issue.zip A small explanation: it's a very simple list implementation with a ListAdapter. It works fine if the list rows are inflated just once (by re-using the convertView), but I purposely commented out two lines of code: // if(convertView == null) { convertView = inflater.inflate(R.layout.list_row, parent, false); // } This is to ensure that for each row, the XML is inflated again. In this demo, this would be completely unnecessary and a big waste, but in a real life a similar scenario happens when you have a list with a few different types of rows (e.g., a different xml is used for the header of a set of items, which use their own xml). In that case, sometimes the convertView will be of the wrong type, in which case you have to inflate another one. Obviously, this would then happen less often than in this demo, but this only postpones the issue: eventually you'll run into the same problem as is demonstrated here. To test the demo, simply open the project in Eclipse (you can use the emulator, but it also happens on the G1), and follow these instructions: 1. Completely scroll down the list as fast as you can (all the way to Item 199), and then back up again. 2. Keep doing this until you scrolled down & up about 5 times, while watching the LogCat. Eventually, you'll start getting errors such as these: 04-08 12:15:03.380: ERROR/dalvikvm-heap(345): 13824-byte external allocation too large for this process. 04-08 12:15:03.380: ERROR/(345): VM won't let us allocate 13824 bytes Keep scrolling! And you'll see this after a few more ups & downs: 04-08 12:16:48.589: DEBUG/dalvikvm(345): GC freed 0 objects / 0 bytes in 169ms 04-08 12:16:48.589: INFO/dalvikvm-heap(345): Clamp target GC heap from 16.003MB to 16.000MB 04-08 12:16:48.589: INFO/dalvikvm-heap(345): Grow heap (frag case) to 16.000MB for 24-byte allocation 04-08 12:16:48.810: INFO/dalvikvm-heap(345): Clamp target GC heap from 18.003MB to 16.000MB Apparently, the 16MB heap is used completely at this point, which seems rather wasteful considering the simplicity of the application in question. After still more scrolling, you'll get errors such as this: 04-08 12:17:01.700: ERROR/dalvikvm-heap(345): Out of memory on a 708- byte allocation. 04-08 12:17:01.700: INFO/dalvikvm(345): "main" prio=5 tid=3 RUNNABLE 04-08 12:17:01.700: INFO/dalvikvm(345): | group="main" sCount=0 dsCount=0 s=0 obj=0x400103e8 04-08 12:17:01.700: INFO/dalvikvm(345): | sysTid=345 nice=0 sched=0/0 handle=-1093522276 04-08 12:17:01.700: INFO/dalvikvm(345): at java.lang.AbstractStringBuilder.enlargeBuffer (AbstractStringBuilder.java:~100) 04-08 12:17:01.700: INFO/dalvikvm(345): at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java: 140) 04-08 12:17:01.700: INFO/dalvikvm(345): at java.lang.StringBuffer.append(StringBuffer.java:257) 04-08 12:17:01.700: INFO/dalvikvm(345): at java.io.StringWriter.write (StringWriter.java:128) 04-08 12:17:01.700: INFO/dalvikvm(345): at java.io.PrintWriter.doWrite(PrintWriter.java:659) 04-08 12:17:01.700: INFO/dalvikvm(345): at java.io.PrintWriter.write (PrintWriter.java:640) 04-08 12:17:01.700: INFO/dalvikvm(345): at java.io.PrintWriter.write (PrintWriter.java:624) 04-08 12:17:01.700: INFO/dalvikvm(345): at java.io.PrintWriter.write (PrintWriter.java:677) 04-08 12:17:01.700: INFO/dalvikvm(345): at java.io.PrintWriter.print (PrintWriter.java:471) 04-08 12:17:01.700: INFO/dalvikvm(345): at java.io.PrintWriter.println(PrintWriter.java:589) 04-08 12:17:01.700: INFO/dalvikvm(345): at java.lang.Throwable.printStackTrace(Throwable.java:267) 04-08 12:17:01.700: INFO/dalvikvm(345): at android.util.Log.getStackTraceString(Log.java:234) 04-08 12:17:01.700: INFO/dalvikvm(345): at com.android.internal.os.RuntimeInit.crash(RuntimeInit.java:278) 04-08 12:17:01.700: INFO
[android-developers] Positioning a Dialog at a required location (x,y)
Hi, I'm displaying some content in a Dialog. By default the Dialog is displayed at the center of the window. I would like to position it at a location (x,y). I'm not able to achieve this using Gravity. Probably I'm not doing it in the right way.. Has any one faced a similar issue? Regards, Sachin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---