[android-developers] Re: Multiple data for an intent
Any application you are going to send multiple pieces of data to would need to be written to explicitly support it -- it's not like maps is magically going to do anything sane with multiple geo URIs even if there was a way to get them to it. Intent supports one data field. I doubt this will change. In Eclair I believe there will be a new intent protocol for sharing multiple data items, but it puts that data in the bundle, and applications must explicitly support it. On Wed, Sep 9, 2009 at 10:44 PM, Dexter's Brain coomar@gmail.comwrote: But, I don't have control over the target application. Suppose, I want to send 3 geo points info to the google maps application, will this solve my problem? Thanks, Dexter. On Sep 10, 10:20 am, AJ ajeet.invinci...@gmail.com wrote: You could put all data in Bundle and send this Bundle with the Intent. This will solve your problem. Thanks, AJ On Sep 10, 10:02 am, Dexter#39;s Brain coomar@gmail.com wrote: Hi All, I was just wondering if it is possible to give the intent a set of data, instead of just one. A particular scenario where this could be applicable would be a music application. You select a list of songs, and pass all these data (file path) to the Music Player's application. Another scenario: You need to plot more than one address on the Google Maps. You launch the application with a set of data for the intent. Is this possible?? Thanks, Dexter. -- 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: Content Provider VS SQLiteDatabase
Content provider is (generally) built on top of SQLite. You don't pick one or the other. On Wed, Sep 9, 2009 at 9:24 PM, Chris narendrasingh.bi...@gmail.com wrote: I would like to know the exact difference between Content provider and SQLiteDatabase. If we have to share our data among applications then we use Content provider, otherwise SQLiteDatabase. Is this is the ONLY difference, OR using Content Provider has something to do with performence??? Any input will be highly appreciated. Thanks -- 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: Native code is being called successfully but not executed properly
Hi, you are more likely to get help on android-ndk. On Wed, Sep 9, 2009 at 9:36 PM, pink 444 pnk...@gmail.com wrote: hai folks, In Android , Native code is written as follows. JNIEXPORT void JNICALL Java_com_android_Test_show(JNIEnv *env, jobject obj) { printf(THIS IS TEST); } JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) { JNIEnv *env; JNINativeMethod meth; jclass k; jint r; r = (*vm)-GetEnv (vm, (void **) env, JNI_VERSION_1_4); k = (*env)-FindClass (env, com.android.Test.show); meth.name = show; meth.signature = ()V; meth.fnPtr = Java_com.android.Test.show; r = (*env)-RegisterNatives (env, k, meth, 1); return JNI_VERSION_1_4; } JNIEXPORT void JNI_OnUnload(JavaVM *vm, void *reserved) { JNIEnv *env; jclass k; jint r; r = (*vm)-GetEnv (vm, (void **) env, JNI_VERSION_1_4); k = (*env)-FindClass (env, com.android.Test.show); (*env)-UnregisterNatives(env, k); } While executing on Android the following messages are obeserved in adb logcat. JNI ( 524): Trying to load jni .so I/System.out( 524): /system/lib D/dalvikvm( 524): Trying to load lib /data/libjnilibs.so 0x433f22d0 D/dalvikvm( 524): Added shared lib /data/libjnilibs.so 0x433f22d0 I/ActivityManager( 50): Displayed activity com.android.helloactivity But THIS IS TEST is not being displayed, which is displayed in native code. There are no errors regarding loading shared library and calling native code.Then why is the message is not displayed in logging. Am i doing any mistake.If JNI_OnLoad and JNI_OnUnLoad are not implemented i am getting errors in Logging.If i do as above i not getting that native code message. Any help would be appreciated highly. Regards, -Siva. -- 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: Multiple data for an intent
Thanks Dianne, That, I guess answers my question. Dexter. On Sep 10, 10:59 am, Dianne Hackborn hack...@android.com wrote: Any application you are going to send multiple pieces of data to would need to be written to explicitly support it -- it's not like maps is magically going to do anything sane with multiple geo URIs even if there was a way to get them to it. Intent supports one data field. I doubt this will change. In Eclair I believe there will be a new intent protocol for sharing multiple data items, but it puts that data in the bundle, and applications must explicitly support it. On Wed, Sep 9, 2009 at 10:44 PM, Dexter's Brain coomar@gmail.comwrote: But, I don't have control over the target application. Suppose, I want to send 3 geo points info to the google maps application, will this solve my problem? Thanks, Dexter. On Sep 10, 10:20 am, AJ ajeet.invinci...@gmail.com wrote: You could put all data in Bundle and send this Bundle with the Intent. This will solve your problem. Thanks, AJ On Sep 10, 10:02 am, Dexter#39;s Brain coomar@gmail.com wrote: Hi All, I was just wondering if it is possible to give the intent a set of data, instead of just one. A particular scenario where this could be applicable would be a music application. You select a list of songs, and pass all these data (file path) to the Music Player's application. Another scenario: You need to plot more than one address on the Google Maps. You launch the application with a set of data for the intent. Is this possible?? Thanks, Dexter. -- 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: Native code is being called successfully but not executed properly
Hai, I am newbie to Android ,Hence can you explain it in detail . Thanks in Advance, -Siva. On Sep 10, 11:02 am, Dianne Hackborn hack...@android.com wrote: Hi, you are more likely to get help on android-ndk. On Wed, Sep 9, 2009 at 9:36 PM, pink 444 pnk...@gmail.com wrote: hai folks, In Android , Native code is written as follows. JNIEXPORT void JNICALL Java_com_android_Test_show(JNIEnv *env, jobject obj) { printf(THIS IS TEST); } JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) { JNIEnv *env; JNINativeMethod meth; jclass k; jint r; r = (*vm)-GetEnv (vm, (void **) env, JNI_VERSION_1_4); k = (*env)-FindClass (env, com.android.Test.show); meth.name = show; meth.signature = ()V; meth.fnPtr = Java_com.android.Test.show; r = (*env)-RegisterNatives (env, k, meth, 1); return JNI_VERSION_1_4; } JNIEXPORT void JNI_OnUnload(JavaVM *vm, void *reserved) { JNIEnv *env; jclass k; jint r; r = (*vm)-GetEnv (vm, (void **) env, JNI_VERSION_1_4); k = (*env)-FindClass (env, com.android.Test.show); (*env)-UnregisterNatives(env, k); } While executing on Android the following messages are obeserved in adb logcat. JNI ( 524): Trying to load jni .so I/System.out( 524): /system/lib D/dalvikvm( 524): Trying to load lib /data/libjnilibs.so 0x433f22d0 D/dalvikvm( 524): Added shared lib /data/libjnilibs.so 0x433f22d0 I/ActivityManager( 50): Displayed activity com.android.helloactivity But THIS IS TEST is not being displayed, which is displayed in native code. There are no errors regarding loading shared library and calling native code.Then why is the message is not displayed in logging. Am i doing any mistake.If JNI_OnLoad and JNI_OnUnLoad are not implemented i am getting errors in Logging.If i do as above i not getting that native code message. Any help would be appreciated highly. Regards, -Siva. -- 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: Tut (SDK 1.5) Get google account of user
I have been investigating whether GoogleLoginService can substitute for ClientLogin (see http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html) on Google App Engine. To use ClientLogin, I solicit the username and password from the user in a dialog and exchange them on the Google server (https:// www.google.com/accounts/ClientLogin) for a 203-character string called Auth. This Auth string can then be exchanged for a cookie on the application server (http://myapp.appspot.com/_ah/login?auth=...). The Value of this obtained cookie is a 460-character string. The cookie can be used from then on to maintain the user session. I was able to obtain the authtoken, aka SID, using the GoogleLoginService method described in this thread. The authtoken obtained through this method also happened to be 203 characters. I was hoping that the authtoken might be substituted for the Auth string in the ClientLogin process, thus bypassing the need to solicit the username/password. Sadly, this appears not to be the case. ClientLogin returns a 500 Server Error rather than the 204 I usually get with a good login. So unless anyone out there is aware to the contrary, my conclusion is that you must prompt the user for their password if you want an authenticated App Engine session. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] sqlite can't show chinese words
hi all, I found that sqlite can't store chinese words and will shows random code in the application when retrieve data. can somebody give some help? thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: sqlite can't show chinese words
I have try to store japanese and it works well.But the logcat can't show Japanese correctly,maybe you just test under eclipse, did you? -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of tstanly Sent: Thursday, September 10, 2009 3:44 PM To: Android Developers Subject: [android-developers] sqlite can't show chinese words hi all, I found that sqlite can't store chinese words and will shows random code in the application when retrieve data. can somebody give some help? thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: sqlite can't show chinese words
under eclipse,the shell shows chinese ok (via sqlite3 and select *) but random code in the app then retrieve data from database, the same situation in the machine. thanks On 9月10日, 下午2時51分, 楊健 y...@cycomtech.co.jp wrote: I have try to store japanese and it works well.But the logcat can't show Japanese correctly,maybe you just test under eclipse, did you? -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of tstanly Sent: Thursday, September 10, 2009 3:44 PM To: Android Developers Subject: [android-developers] sqlite can't show chinese words hi all, I found that sqlite can't store chinese words and will shows random code in the application when retrieve data. can somebody give some help? thanks!- 隱藏被引用文字 - - 顯示被引用文字 - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Translucent and FullScreen?
try this one :) requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); On Sep 10, 4:08 am, Illidane illid...@gmail.com wrote: Hi! I have an issue : I set Theme.Translucent.NoTitleBar.Fullscreen for my app, but status bar is still here. Is there a solution for it? 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: Check for internet connection
hi,Mark, i got errors in returning statement? do i need to catch the return value and display the status? I have been using: ConnectivityManager connMgr=(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo info=connMgr.getActiveNetworkInfo(); return(info!=null info.isConnected()); Are there scenarios where a NetworkInfo other than getActiveNetworkInfo() might be connected? -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Development Wiki:http://wiki.andmob.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Content Provider VS SQLiteDatabase
Hi Dianne, i get ur point that Content provider is built on top of SQlite but i wanna know is what additional features does a provider support. Say if a make my own Database Store class and provide methods in it to insert/update/delete into a database. And if i create a Provider for the same purpose, ...in what way will a Provider prove to be more beneficial over the DatabaseStore class other than the fact that provider will allow me to share data ovet different applications On Sep 10, 11:01 am, Dianne Hackborn hack...@android.com wrote: Content provider is (generally) built on top of SQLite. You don't pick one or the other. On Wed, Sep 9, 2009 at 9:24 PM, Chris narendrasingh.bi...@gmail.com wrote: I would like to know the exact difference between Content provider and SQLiteDatabase. If we have to share our data among applications then we use Content provider, otherwise SQLiteDatabase. Is this is the ONLY difference, OR using Content Provider has something to do with performence??? Any input will be highly appreciated. Thanks -- 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] Couldn't get connection factory client
Hi, Map api of Google, is an excellent abstraction, however the error messages could be improved more. For the above erorr message in the subject and the same discussed in the message http://groups.google.com/group/android-developers/browse_thread/thread/94e3d0454612d143 it would be nice to say it is a Invalid Map API key etc. Regards, Raja Nagendra Kumar, C.T.O www.tejasoft.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] do i need to close cursor?
Hi, Just wondering is it necessary to close cursor when an activity is stopped or pause? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 send DTMF in android?
ToneGenerator won't help here - This API is not for generating tones over the uplink audio path. On Sep 8, 12:44 pm, Mark Ellul mark.el...@gmail.com wrote: Hi Gulfam, Did you solve the issue? I am trying to do the same thing and only have a HTC Hero to test with and its failing as well. Please if you have resolved the issue let me know... I have seen this classhttp://developer.android.com/reference/android/media/ToneGenerator.html but I am not sure if it will help in this case. Regards Mark On Aug 28, 8:55 am, Gulfam gulfa...@gmail.com wrote: Hi all, I am facing a problem on sendingDTMFin android. I am sendingDTMFin this format tel:+15187127050,9563547896# Its working fine on G1 but when i install the app on HTC Hero /HTC Magic its dispalying error message like this (Invalid MMI) Any one can help me regarding this. Thanks in advance. Gulfam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: do i need to close cursor?
You will see some warning info in logcat if you do not close it . -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of jerryfan2000 Sent: Thursday, September 10, 2009 4:14 PM To: Android Developers Subject: [android-developers] do i need to close cursor? Hi, Just wondering is it necessary to close cursor when an activity is stopped or pause? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Couldn't get connection factory client
I had met before, it's key issue. you may use different keystore to export signed apk. On 9月10日, 下午3時12分, Raja Nagendra Kumar nagendra.r...@tejasoft.com wrote: Hi, Map api of Google, is an excellent abstraction, however the error messages could be improved more. For the above erorr message in the subject and the same discussed in the messagehttp://groups.google.com/group/android-developers/browse_thread/threa... it would be nice to say it is a Invalid Map API key etc. Regards, Raja Nagendra Kumar, C.T.Owww.tejasoft.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Deep sleep behaviour
Queue philosophy war. Another way one can look at this: your app is probably not nearly that important to most of your users. We are increasingly working on ways to let the users know which apps are doing this kind of stuff, so they can make good decisions about the things running on their device, and uninstall such apps if they don't find them important enough. Dianne, this second statement about 'giving choice to users' was diametrically opposed to your first, which out-of-hand discarded the possibility of a user requiring an app with such battery usage, without even knowing if the app would need to run 24/7. 'Please don't do this.' I've written an app that has a monitor running in the background. The user can select the alarm update period while the device is off. Horrors, he could select 5 seconds, though of course the default is on the order of 10 minutes. And of course there's a power warning. Power to the user! Lee --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Translucent and FullScreen?
If you have a translucent activity, I guess you see the title bar of the activity below your activity, so this is the expected behavior. Peli www.openintents.org On Sep 9, 11:08 pm, Illidane illid...@gmail.com wrote: Hi! I have an issue : I set Theme.Translucent.NoTitleBar.Fullscreen for my app, but status bar is still here. Is there a solution for it? 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: Native code is being called successfully but not executed properly
You were posting to the wrong forum. Post your question here to get help: http://groups.google.com/group/android-ndk Peli www.openintents.org On Sep 10, 8:17 am, pink 444 pnk...@gmail.com wrote: Hai, I am newbie to Android ,Hence can you explain it in detail . Thanks in Advance, -Siva. On Sep 10, 11:02 am, Dianne Hackborn hack...@android.com wrote: Hi, you are more likely to get help on android-ndk. On Wed, Sep 9, 2009 at 9:36 PM, pink 444 pnk...@gmail.com wrote: hai folks, In Android , Native code is written as follows. JNIEXPORT void JNICALL Java_com_android_Test_show(JNIEnv *env, jobject obj) { printf(THIS IS TEST); } JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) { JNIEnv *env; JNINativeMethod meth; jclass k; jint r; r = (*vm)-GetEnv (vm, (void **) env, JNI_VERSION_1_4); k = (*env)-FindClass (env, com.android.Test.show); meth.name = show; meth.signature = ()V; meth.fnPtr = Java_com.android.Test.show; r = (*env)-RegisterNatives (env, k, meth, 1); return JNI_VERSION_1_4; } JNIEXPORT void JNI_OnUnload(JavaVM *vm, void *reserved) { JNIEnv *env; jclass k; jint r; r = (*vm)-GetEnv (vm, (void **) env, JNI_VERSION_1_4); k = (*env)-FindClass (env, com.android.Test.show); (*env)-UnregisterNatives(env, k); } While executing on Android the following messages are obeserved in adb logcat. JNI ( 524): Trying to load jni .so I/System.out( 524): /system/lib D/dalvikvm( 524): Trying to load lib /data/libjnilibs.so 0x433f22d0 D/dalvikvm( 524): Added shared lib /data/libjnilibs.so 0x433f22d0 I/ActivityManager( 50): Displayed activity com.android.helloactivity But THIS IS TEST is not being displayed, which is displayed in native code. There are no errors regarding loading shared library and calling native code.Then why is the message is not displayed in logging. Am i doing any mistake.If JNI_OnLoad and JNI_OnUnLoad are not implemented i am getting errors in Logging.If i do as above i not getting that native code message. Any help would be appreciated highly. Regards, -Siva. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to display an arraylist
Thanks Yusuf it's answer my question for a part. Now i've change type of ArrayListArraylist to ArrayListString and i nearly understand how display this in the theory but eclipse don't accepte your code. I don't understand why you wrote list in list.setAdapter and why you wrote this.android.R.layout.list_item, array_list instead of R.layout.list_item. Thanks again for your attention Sweet On 9 sep, 19:02, Yusuf Saib (T-Mobile USA) yusuf.s...@t-mobile.com wrote: I'm not sure how you want to display a list of lists. For that you might want some kind of tree widget, not a list view. But if you want to display a list of string, use setAdapter(): list.setAdapter(new ArrayAdapterString(this, android.R.layout.list_item, array_list)); Does that answer your question or did you have something else in mind? Yusuf Saib Android ·T· · ·Mobile· stick together 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. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: how do real-time monitor the state of SD card
Hi Jerry, take a look over the broadcast receiver, a tutorial about this you can find in here, with some code included: http://www.itwizard.ro/tag/broadcast-receiver Best regards, ITWiz On Sep 10, 7:18 am, jerry zhang...@dopod.com wrote: my quetion is from switching usb connected in the phone notifications,which pop up from taskbar. try to all the ACTION_MEDIA_* series of Intent actions,but these are all failed.these actions couldn't real-time monitor the state of SD card. also, use broadcast receivers,the code like this, but it's still not dynamic mounted or unmounted: @Override public void onResume() { super.onResume(); IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_UMS_CONNECTED);//try all the other ACTION_MEDIA_* series of Intent actions,and these are also unsuccessed. registerReceiver( mBroadcastReceiver, filter ); } @Override public void onPause() { super.onPause(); unregisterReceiver( mBroadcastReceiver ); } private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver () { �...@override public void onReceive(Context context, Intent intent) { updateSDcardStatus(); } }; private void updateSDcardStatus() { Log.i(TAG, other status: + status ); } can you give me a demo,and you can success to mount the state of SD card On Sep 10, 1:07 am, Mark Murphy mmur...@commonsware.com wrote: jerry wrote: I want to know the state of SD card is dynamic mounted or not mounted? it's very kind of you if you can give me a demo(for example, use api registerReceiver、BroadcastReceiver、onReceive and so on). Look at the ACTION_MEDIA_* series of Intent actions: http://developer.android.com/intl/zh-CN/reference/android/content/Int... For examples of using broadcast receivers, both those registered in the manifest or those using registerReceiver(), I have some examples from my Advanced Android book up on github: http://github.com/commonsguy/cw-advandroid/tree/e50e087577f8b28e72735... -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android App Developer Training:http://commonsware.com/training.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: How to display an arraylist
Thanks Yusuf it's answer my question for a part. Now i've change type of ArrayListArraylist to ArrayListString and i nearly understand how display this in the theory but eclipse don't accepte your code. I don't understand why you wrote list in list.setAdapter and why you wrote this.android.R.layout.list_item, array_list instead of R.layout.list_item. Thanks again for your attention Sweet On 9 sep, 19:02, Yusuf Saib (T-Mobile USA) yusuf.s...@t-mobile.com wrote: I'm not sure how you want to display a list of lists. For that you might want some kind of tree widget, not a list view. But if you want to display a list of string, use setAdapter(): list.setAdapter(new ArrayAdapterString(this, android.R.layout.list_item, array_list)); Does that answer your question or did you have something else in mind? Yusuf Saib Android ·T· · ·Mobile· stick together 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. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Native code is being called successfully but not executed properly
Hi Siva, your printf call will be executed in C, while I presume you would like to see something being done in Java :) If you just want to see your method is being called, you have 2 options: a. in JNIEXPORT void JNICALL Java_com_android_Test_show(JNIEnv *env, jobject obj) open a file and write something dummy in it. You will be able to see this file on the disk, after you call it. b. return something in java from your function, for example your function could look like: static JNIEXPORT jstring JNICALL libVer (JNIEnv *env, jclass cls) { MLOG(function started\n); return env-NewStringUTF(Lib ver 1.0); } In this example you return a string containing the lib version. For a whole tutorial consult the NDK (in there you have 2 examples). For more complicated examples check our post here: http://www.itwizard.ro/category/android-cc Best regards, ITWiz On Sep 10, 10:39 am, Peli peli0...@googlemail.com wrote: You were posting to the wrong forum. Post your question here to get help:http://groups.google.com/group/android-ndk Peliwww.openintents.org On Sep 10, 8:17 am, pink 444 pnk...@gmail.com wrote: Hai, I am newbie to Android ,Hence can you explain it in detail . Thanks in Advance, -Siva. On Sep 10, 11:02 am, Dianne Hackborn hack...@android.com wrote: Hi, you are more likely to get help on android-ndk. On Wed, Sep 9, 2009 at 9:36 PM, pink 444 pnk...@gmail.com wrote: hai folks, In Android , Native code is written as follows. JNIEXPORT void JNICALL Java_com_android_Test_show(JNIEnv *env, jobject obj) { printf(THIS IS TEST); } JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) { JNIEnv *env; JNINativeMethod meth; jclass k; jint r; r = (*vm)-GetEnv (vm, (void **) env, JNI_VERSION_1_4); k = (*env)-FindClass (env, com.android.Test.show); meth.name = show; meth.signature = ()V; meth.fnPtr = Java_com.android.Test.show; r = (*env)-RegisterNatives (env, k, meth, 1); return JNI_VERSION_1_4; } JNIEXPORT void JNI_OnUnload(JavaVM *vm, void *reserved) { JNIEnv *env; jclass k; jint r; r = (*vm)-GetEnv (vm, (void **) env, JNI_VERSION_1_4); k = (*env)-FindClass (env, com.android.Test.show); (*env)-UnregisterNatives(env, k); } While executing on Android the following messages are obeserved in adb logcat. JNI ( 524): Trying to load jni .so I/System.out( 524): /system/lib D/dalvikvm( 524): Trying to load lib /data/libjnilibs.so 0x433f22d0 D/dalvikvm( 524): Added shared lib /data/libjnilibs.so 0x433f22d0 I/ActivityManager( 50): Displayed activity com.android.helloactivity But THIS IS TEST is not being displayed, which is displayed in native code. There are no errors regarding loading shared library and calling native code.Then why is the message is not displayed in logging. Am i doing any mistake.If JNI_OnLoad and JNI_OnUnLoad are not implemented i am getting errors in Logging.If i do as above i not getting that native code message. Any help would be appreciated highly. Regards, -Siva. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to display an arraylist
It's good but i've to write your code differently: ArrayListString array_list = renvoi_liste_recette_xml(); list.setAdapter(new ArrayAdapterString(this, R.layout.liste,array_list)); But an error stay in the part list.setAdapter (list cannot be resolve) I've an other question in my XML file (which name is liste.xml here) what i've to put for display my array ? A text view or nothing ? Thanks again Sweet On 9 sep, 19:02, Yusuf Saib (T-Mobile USA) yusuf.s...@t-mobile.com wrote: I'm not sure how you want to display a list of lists. For that you might want some kind of tree widget, not a list view. But if you want to display a list of string, use setAdapter(): list.setAdapter(new ArrayAdapterString(this, android.R.layout.list_item, array_list)); Does that answer your question or did you have something else in mind? Yusuf Saib Android ·T· · ·Mobile· stick together 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. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 display an arraylist
It's good but i've to write your code differently: ArrayListString array_list = renvoi_liste_recette_xml(); list.setAdapter(new ArrayAdapterString(this, R.layout.liste,array_list)); But an error stay in the part list.setAdapter (list cannot be resolve) I've an other question in my XML file (which name is liste.xml here) what i've to put for display my array ? A text view or nothing ? Thanks again Sweet On 9 sep, 19:02, Yusuf Saib (T-Mobile USA) yusuf.s...@t-mobile.com wrote: I'm not sure how you want to display a list of lists. For that you might want some kind of tree widget, not a list view. But if you want to display a list of string, use setAdapter(): list.setAdapter(new ArrayAdapterString(this, android.R.layout.list_item, array_list)); Does that answer your question or did you have something else in mind? Yusuf Saib Android ·T· · ·Mobile· stick together 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. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Deep sleep behaviour
That's all well and good, but what I am responding to is your clear recommendation to the original poster to set an alarm to wake up every 5 seconds, as if this is a reasonable thing to do. If you want to propose having a UI for the user to set the wakeup interval to something unreasonable, that is another topic, but unrelated to the original proposal of using 5 seconds as a way for the original poster to keep their service doing sometthing. On Thu, Sep 10, 2009 at 12:34 AM, Lee lee.wil...@googlemail.com wrote: Queue philosophy war. Another way one can look at this: your app is probably not nearly that important to most of your users. We are increasingly working on ways to let the users know which apps are doing this kind of stuff, so they can make good decisions about the things running on their device, and uninstall such apps if they don't find them important enough. Dianne, this second statement about 'giving choice to users' was diametrically opposed to your first, which out-of-hand discarded the possibility of a user requiring an app with such battery usage, without even knowing if the app would need to run 24/7. 'Please don't do this.' I've written an app that has a monitor running in the background. The user can select the alarm update period while the device is off. Horrors, he could select 5 seconds, though of course the default is on the order of 10 minutes. And of course there's a power warning. Power to the user! Lee -- 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: Content Provider VS SQLiteDatabase
If you need the features content provider adds (primarily interaction across separate application and associated discovery and cross-process calls, as well as MIME typing to integrate with intent resolution) then consider using it. Otherwise there probably isn't a reason to. On Thu, Sep 10, 2009 at 12:11 AM, jayant jayant.jais...@gmail.com wrote: Hi Dianne, i get ur point that Content provider is built on top of SQlite but i wanna know is what additional features does a provider support. Say if a make my own Database Store class and provide methods in it to insert/update/delete into a database. And if i create a Provider for the same purpose, ...in what way will a Provider prove to be more beneficial over the DatabaseStore class other than the fact that provider will allow me to share data ovet different applications On Sep 10, 11:01 am, Dianne Hackborn hack...@android.com wrote: Content provider is (generally) built on top of SQLite. You don't pick one or the other. On Wed, Sep 9, 2009 at 9:24 PM, Chris narendrasingh.bi...@gmail.com wrote: I would like to know the exact difference between Content provider and SQLiteDatabase. If we have to share our data among applications then we use Content provider, otherwise SQLiteDatabase. Is this is the ONLY difference, OR using Content Provider has something to do with performence??? Any input will be highly appreciated. Thanks -- 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: sqlite can't show chinese words
It stores unicode characters fine. (I believe the internal encoding it uses is UTF-8, but this should be invisible to the Java level.) I would suggest looking at your code around it to make sure there aren't any encoding problems or such. 2009/9/10 tstanly tsai.sta...@gmail.com under eclipse,the shell shows chinese ok (via sqlite3 and select *) but random code in the app then retrieve data from database, the same situation in the machine. thanks On 9月10日, 下午2時51分, 楊健 y...@cycomtech.co.jp wrote: I have try to store japanese and it works well.But the logcat can't show Japanese correctly,maybe you just test under eclipse, did you? -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of tstanly Sent: Thursday, September 10, 2009 3:44 PM To: Android Developers Subject: [android-developers] sqlite can't show chinese words hi all, I found that sqlite can't store chinese words and will shows random code in the application when retrieve data. can somebody give some help? thanks!- 隱藏被引用文字 - - 顯示被引用文字 - -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to display an arraylist
It's good but i've to write your code differently: ArrayListString array_list = renvoi_liste_recette_xml(); list.setAdapter(new ArrayAdapterString(this, R.layout.liste,array_list)); But an error stay in the part list.setAdapter (list cannot be resolve) I've an other question in my XML file (which name is liste.xml here) what i've to put for display my array ? A text view or nothing ? Thanks again Sweet On 9 sep, 19:02, Yusuf Saib (T-Mobile USA) yusuf.s...@t-mobile.com wrote: I'm not sure how you want to display a list of lists. For that you might want some kind of tree widget, not a list view. But if you want to display a list of string, use setAdapter(): list.setAdapter(new ArrayAdapterString(this, android.R.layout.list_item, array_list)); Does that answer your question or did you have something else in mind? Yusuf Saib Android ·T· · ·Mobile· stick together 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. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Sending a zip file as email attachment
Hi All, Does any body know how to send a zip file as an attachment of an email? Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_EMAIL, mailto); sendIntent.putExtra(Intent.EXTRA_SUBJECT, Sample); sendIntent.setType(application/zip); sendIntent.putExtra(Intent.EXTRA_STREAM,pathtozipfile); startActivity(Intent.createChooser(sendIntent,send the mail)); I tried about snippet.But didnt work. Anybody tried sending zip file attachments? Thanks Regards, Isuru --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Deep sleep behaviour
On Sep 10, 8:58 am, Dianne Hackborn hack...@android.com wrote: That's all well and good, but what I am responding to is your clear recommendation to the original poster to set an alarm to wake up every 5 seconds, as if this is a reasonable thing to do. Of course I see your point, I was just bristling about your blanket- ban (without an alternative given) as opposed to warning. Could be I bristle too easy :-) Lee --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Focusing the spinner object
Hi Prashanth, I have already tried it.But what I need is a different thing.I want to highlight the border of the spinner object once it is got focused.Right now I can see highlight when the items of spinner are selected. I want to highlight the border of the original spinner object when it is getting focused prior to items are selected. Thanks Regards, Isuru On Sep 8, 12:50 pm, prashanth prashanth.shivaku...@gmail.com wrote: Hello use android:focusable to true.I use few spinner objects and they get focus similar to textview .have a look at apidemos in the sdk installation to see if that does what u want to do gtg On Sep 7, 11:05 am,Isuruiisuru@gmail.com wrote: Hi, When components like TextViews got focus we can focus them using highlighting the border of the component.Like that how can we highlight the border of a spinner object when it got focus?.U can highlight borders of each and every item in the spinner at the time of selection. What I need is to highlight the border of spinner object when it got focus initially.I went through xml attributes and couldnt find matching one.Let me know if u have any clue to do this. Thanks Regards, Isuru --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 display an arraylist
It's good but i've to write your code differently: ArrayListString array_list = renvoi_liste_recette_xml(); list.setAdapter(new ArrayAdapterString(this, R.layout.liste,array_list)); But an error stay in the part list.setAdapter (list cannot be resolve) I've an other question in my XML file (which name is liste.xml here) what i've to put for display my array ? A text view or nothing ? Thanks again Sweet On 9 sep, 19:02, Yusuf Saib (T-Mobile USA) yusuf.s...@t-mobile.com wrote: I'm not sure how you want to display a list of lists. For that you might want some kind of tree widget, not a list view. But if you want to display a list of string, use setAdapter(): list.setAdapter(new ArrayAdapterString(this, android.R.layout.list_item, array_list)); Does that answer your question or did you have something else in mind? Yusuf Saib Android ·T· · ·Mobile· stick together 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. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Running Application as Service
Hi, I want to continuously listen for incoming messages in background. So what would be the best way of doing it? Shall I make that application as Service or just registering it as BroadCast Receiver would do. If I register the listener then will it keep on running continuously. This receiver should be able to receive all the incoming messages. Hope to get the reply soon. Regards Sunil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How can I start the ADB Deamon programatically ???
Thanks for your reply. It's not laziness but i can't read these source code. I had tried my best to find what the deamon's port is and what messages it receives but it seem to be too difficult for me to read these C/C++ source code. Can anyone help me ??? Thanks a lot. On Sep 10, 10:35 am, Dianne Hackborn hack...@android.com wrote: You could look at the source code and see how it is done. I believe adb is in the system/base project. On Wed, Sep 9, 2009 at 7:24 PM, HandsomeboyIT handsomebo...@gmail.comwrote: I believe that the deamon service can be communicate with other application through TCP/IP protocol (localhost:5039). I just don't know how to start it. The ADB server run on the development machine can do this. It can send some commands to deamon service to start the deamon and retrieve data from that. I don't care if the SDK supports this, but I think there is a same way to start it. On Sep 10, 12:24 am, Yusuf Saib (T-Mobile USA) yusuf.s...@t- Mobile.com wrote: I don't believe that's supported in the SDK. Yusuf Saib Android ·T· · ·Mobile· stick together 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 Sep 8, 11:29 pm, HandsomeboyIT handsomebo...@gmail.com wrote: I want to communicate with the ADB Deamon service on device for get some special data without using ADB server on development machine (suggest that my application running on device and do not know about ABD tools, except deamon). Can anyone show me how to do this ??? How to start the deamon service ? what is its provided function/command ??? -- 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] Sending a Image as a body of email
Hi All, I tried to send a image as a body of email. sendIntent.putExtra(Intent.EXTRA_TEXT, HTMLBODYbIMG SRC= \data:image/jpeg;base64, + uPathYour1.getPath()+.jpg + \ alt = \pleaseview this image\//b/BODY/HTML); However email was not received properly with the actual image. Anybody have tried this?? I can send image as attachment.I am trying to send multiple images in body because I couldnt send multiple image attachments once. Thanks Regards, Isuru --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Map view
Hi guys, I have doubt in map view. I need a mapview with marker. when i'm clicking the marker it should display some info window. when i click the info window it should goto another layout. any one can suggest idea for this.. -- Thanks Regards Sasi Kumar.S --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to display an arraylist
I've done some modifications to my code and eclipse don't find any error but the emulator force my application to quit: java class: import java.net.URL; import java.util.ArrayList; import java.util.Collection; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; import android.app.ListActivity; import android.os.Bundle; import android.widget.ArrayAdapter; public class Xml extends ListActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { ArrayListString array_list = null; try { array_list = renvoi_liste_recette_xml(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapterString(this, R.layout.liste,array_list)); } @SuppressWarnings(unchecked) public ArrayListString renvoi_liste_recette_xml() throws Exception { ArrayListString aTableRetour = new ArrayListString(); URL myURL = new URL(http://benji.roullet.free.fr/testXml.xml;); DocumentBuilderFactory fabrique = DocumentBuilderFactory.newInstance (); DocumentBuilder constructeur = fabrique.newDocumentBuilder(); Document document = constructeur.parse(myURL.openStream()); Element racine = document.getDocumentElement(); NodeList liste = racine.getElementsByTagName(Contact); for(int i=0; iliste.getLength(); i++){ ArrayListString aTableauTmp = new ArrayListString(); Element E1= (Element) liste.item(i); aTableauTmp.addAll((Collection? extends String) E1.getElementsByTagName(nom)); aTableRetour.addAll(aTableauTmp); } return aTableRetour; } } Xml file: ?xml version=1.0 encoding=utf-8? TextView android:layout_width=wrap_content android:layout_height=wrap_content xmlns:android=http://schemas.android.com/apk/res/android; android:id=@+id/text /TextView Do you see anythings wrong ? On 9 sep, 19:02, Yusuf Saib (T-Mobile USA) yusuf.s...@t-mobile.com wrote: I'm not sure how you want todisplaya list of lists. For that you might want some kind of tree widget, not a list view. But if you want todisplaya list of string, use setAdapter(): list.setAdapter(new ArrayAdapterString(this, android.R.layout.list_item, array_list)); Does that answer your question or did you have something else in mind? Yusuf Saib Android ·T· · ·Mobile· stick together 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. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 with launcher icon on update
Any idea about this point ? On 9 sep, 12:32, MIMRAN D david.mim...@gmail.com wrote: Hi, I have aproblemwith thelaunchericonwhen Iupdatemy application from 1.0 to 1.1. I have the rightlaunchericonin 1.0 but not in 1.1 just after anupdate. But, if I reboot my devices, it's ok. In the manifest, I just increase the android:versionCode and android:versionName but didn't change anything about my android:icon. But, I have new image in the folder drawable in 1.1. Here a copy of my manifest: ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=bla android:versionCode=2 android:versionName=1.1 application android:label=@string/app_name android:icon=@drawable/icon android:allowClearUserData=true android:debuggable=false activity android:name=.bla android:label=@string/ app_name android:screenOrientation=portrait android:launchMode=singleTask android:icon=@drawable/icon intent-filter android:icon=@drawable/icon action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity activity android:icon=@drawable/icon android:name=.bla android:screenOrientation=portrait android:launchMode=singleTask/ activity activity android:icon=@drawable/icon android:name=.blb android:screenOrientation=portrait/ activity activity android:icon=@drawable/icon android:name=.blc android:screenOrientation=portrait android:launchMode=singleTask/activity activity android:icon=@drawable/icon android:name=.bld android:screenOrientation=landscape/activity activity android:icon=@drawable/icon android:name=.ble android:screenOrientation=portrait/activity activity android:icon=@drawable/icon android:name=.blf android:screenOrientation=portrait android:launchMode=singleTask/ activity activity android:icon=@drawable/icon android:name=.blg android:screenOrientation=portrait/activity activity android:icon=@drawable/icon android:name=.blh android:screenOrientation=portrait/activity /application uses-sdk android:minSdkVersion=3 / uses-permission android:name=android.permission.INTERNET / /manifest Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: sqlite can't show chinese words
thanks Dianne, but actually I use sqlite3 to insert a record not by program, and I check when the record is English words, the app can output correctly, soI don't think this is a code issue??? thanks On 9月10日, 下午4時02分, Dianne Hackborn hack...@android.com wrote: It stores unicode characters fine. (I believe the internal encoding it uses is UTF-8, but this should be invisible to the Java level.) I would suggest looking at your code around it to make sure there aren't any encoding problems or such. 2009/9/10 tstanly tsai.sta...@gmail.com under eclipse,the shell shows chinese ok (via sqlite3 and select *) but random code in the app then retrieve data from database, the same situation in the machine. thanks On 9月10日, 下午2時51分, 楊健 y...@cycomtech.co.jp wrote: I have try to store japanese and it works well.But the logcat can't show Japanese correctly,maybe you just test under eclipse, did you? -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of tstanly Sent: Thursday, September 10, 2009 3:44 PM To: Android Developers Subject: [android-developers] sqlite can't show chinese words hi all, I found that sqlite can't store chinese words and will shows random code in the application when retrieve data. can somebody give some help? thanks!- 隱藏被引用文字 - - 顯示被引用文字 - -- 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: Deep sleep behaviour
Hello Dianne, My statement was a little misleading. Sorry for that. Actually i meant not an alarmbut actually a Phone state listener. The assumption is that my application sends and receives packets over a WiFi connection only. It does not use the cellular radio interface. Let me explain my use case in detail. I want to save on device resources by realizing this use case. These are the steps: 1. My application starts up 2. Now, if my application is idle (there is no incoming/outgoing traffic), i want to turn the screen off with the CPU still running by taking a PARTIAL_WAKE_LOCK. (Of course the user may switch to another application and turn on the screen in the process ! ) (However the docs say that any Wake Lock is bad for the battery !! I thought that turning the screen off will save on battery ! ) 3. I will have a broadcast receiver that listens to the ACTION_SCREEN_OFF. So, when the screen is turned off by my application in idle mode, i will stop some services that are only needed whenever there is a need to process calls (incoming and outgoing). 4. Now i will register a phone state listener like this: TelephonyManager tmgr = (TelephonyManager)context.getSystemService(context.TELEPHONY_SERVICE); AppPhoneStateListener myListner = new AppPhoneStateListener(); tmgr.listen(myListner, PhoneStateListener.LISTEN_DATA_ACTIVITY); // The docs say this data activity is for cellular. Does this mean i cannot get the state changes to WiFi data traffic ? (Eg: WiFi //connection idle..no traffic...incoming traffic starts etc) 5. After some time, i will receive a onDataActivity(int)http://developer.android.com/reference/android/telephony/PhoneStateListener.html#onDataActivity(int) callback when the data state changes. This is the time, i will initialize resources to handle the incoming traffic/ or send outbound traffic. Over here, i will also release the PARTIAL_WAKE_LOCK. 6. Once the call is disconnected, and the application is idle for a certain period of time, i will repeat the process from Step-2 above. Is the above scenario feasible ? Or does it incur a considerable cost on the system battery/resources due to the PARTIAL_WAKE_LOCK ? Thanks for your time.. On Wed, Sep 9, 2009 at 10:11 PM, Dianne Hackborn hack...@android.comwrote: On Wed, Sep 9, 2009 at 1:45 AM, Android Development indodr...@gmail.comwrote: 1) Suppose, i want my service to go into deep sleep initially. If my phone receives an incoming VoIP call (over the underlying IP connectivity, which may be WiFi), then i wish to start an activity, and alert one of my services to handle the incoming call. Is there an alarm for which i can register, for implementing this use case ? Sorry, an alarm for what? There are broadcasts sent for various things, but the platform doesn't natively know anything about VoIP so there wouldn't be an alarm or anything for that. For socket-level communication, you will wake up when you are receiving data. -- 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: Using Broadcast Receivers
Thanks Dianne, Mark for the insight. I will keep note of this. On Wed, Sep 9, 2009 at 10:04 PM, Dianne Hackborn hack...@android.comwrote: They are also WAY more overhead than just doing things in the local process (you need to do an IPC to the system, it needs to schedule the broadcast, then do an IPC back to each application that is receiving it, copying all of the data in it each time). For stuff happening in the local process, Handler and direct callbacks are the preferred approach. On Wed, Sep 9, 2009 at 5:42 AM, Mark Murphy mmur...@commonsware.comwrote: Android Development wrote: Is it feasible to use a BroadcastReceiver as a glue layer between the user interface and the underlying business logic ? Yes, but bear in mind that broadcast Intents are not private. Anyone who figures out an appropriate Intent filter can listen in. Depending on the nature of your application, this may or may not be acceptable to you. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need help for your Android OSS project? http://wiki.andmob.org/hado -- 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 any method to read sms and gmail?
Hello, You can read sms this way public class SmsApp extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String strUri=content://sms/inbox; Uri urisms=Uri.parse(strUri); //try{ Cursor c=this.getContentResolver().query(urisms, null, null, null, null); while(c.moveToNext()) -~--~~~~--~~--~--~--- but you need permission ,u described SMS_READ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] XML parser
Hi guys, I have a doubt in xml parsing. i'm parsing a xml file. that xml file contains more than 14000 lines. I'm fetching 15 tag in that xml file. it is taking more than 7 times to fetch. b'coz 14000 lines * 15 tag. that much time it is taking. can any one suggess any idea for this to reduce time. or give some other coding to fetch xml data easily. no i'm using rssreader to fetch data as like in java. thanks in advance. -- Thanks Regards Sasi Kumar.S --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: do i need to close cursor?
close the sursor each time. b'coz when u try to open another time the cursor. it will show exception as already cursor as opened. so close the cursor On Sep 10, 12:13 pm, jerryfan2000 jerryfan1...@gmail.com wrote: Hi, Just wondering is it necessary to close cursor when an activity is stopped or pause? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: XML parser
I found XML parsing in android to be slightly buggy, the parser seemed to have some strange behaviour dealing with whitespace and some special characters. I used dom4j as an alternative and it worked fine This thread discusses dom4j on android: http://groups.google.com/group/android-developers/browse_thread/thread/d742874f03c4d69c --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 any method to read sms and gmail?
Thank you very much ,I will try this。 _ From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of eaindra nilar Sent: Thursday, September 10, 2009 6:59 PM To: android-developers@googlegroups.com Subject: [android-developers] Re: Is there any method to read sms and gmail? Hello, You can read sms this way public class SmsApp extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String strUri=content://sms/inbox; Uri urisms=Uri.parse(strUri); //try{ Cursor c=this.getContentResolver().query(urisms, null, null, null, null); while(c.moveToNext()) -~--~~~~--~~--~--~--- but you need permission ,u described SMS_READ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Hmm... at last ADC2 is out of our way ... tell about your app and experience
A bit late I know, but here's the website for my app, mobilematics: http://mobilematics.co.uk/ On Sep 9, 6:59 am, broc.seib broc.s...@gmail.com wrote: For ADC2 I created BabelSnap! for the Travel category. You use the device's camera to snap a bit of text, whether from a public sign, a menu, or newspaper, etc. The image is fed through an OCR, and the resulting plain text can be translated to any language. http://babelsnap.com/ (Yes, the demo video has the world's cheesiest and generic music. :-) Maybe I should have left it with no audio! ) I attended GoogleIO at the end of May where I first learned about ADC2, and received one of the Google Ion devices. Substantial prize money plus free device -- I could not ignore the opportunity to participate. That prize money could afford me some more help, and maybe some better OCR that recognizes non-latin characters, and maybe help pay some bills too! :-) I built BabelSnap in about 5 weeks. I had all the basic stuff functioning in about half that time. The other half I spent learning the idiosyncrasies of an android app -- like what happens when someone presses the back button or home button while your background thread (not your UI thread) is still doing processing... And having to do manual garbage collection when manipulating/copying large images from the camera And the camera API itself -- could use some improvements in documentation, and in the API itself. (That is another topic.) The version of BabelSnap I submitted to ADC works well if you can acquire a good image for the OCR. But this takes a bit of practice, holding the camera steady while focusing, framing the text properly, and hitting the shutter button all at once. I want it to work a little more casually, and not require so much practice. The revision I am currently working on will permit the user to assist in picking out the relevant bits of the snapped pic that contain the text they want to translate, by simply touching/dragging across that part of the image. In all, I have a very positive experience in creating an Android app. I am impressed with what I could assemble in such a short period of time. As for the deadline and submitting updates. Google *had* the draw the line somewhere. I could have gone on indefinitely fixing things up. I was glad to have a hard deadline, and sad to give up some functions that I wish could have been present for the judging. I do like the approach of continuing to make revisions available in the Market independent of the ADC submission. I also think Google has the right approach in trying to cultivate new mobile app ideas -- everyone loves a little competition. And Google seems serious; they've put forth a great deal of cash and hardware. Good luck to all. I look forward to trying out your new apps. -broc On Sep 2, 12:41 am, Lout lout.r...@googlemail.com wrote: While you developers relax... would you mind sharing what apps to expect through this challenge.. and anything else you wish to share about ADC2 submissions... well anything including the fact: 'thank God, no more sleep less nights'! Am collecting information about the challenge (ADC2) for a news article as am with cnet (and AP). Pitch your app if you have already published or would soon publish on the market too. Your app name and description, web link if any, experience with ADC2, ... anything would be useful for our article(s). And do you feel that there would have been more submissions than in ADC1? Is the competition going to be tougher or less profound as you were allowed to put up apps not published before 1st Aug only? Do you think that all apps that didn't try for ADC1 should have had a chance? Congratulations on your submissions while you wait for the next phase. Thanks, Lout Reilly ps: Moderators we request you to let this through so that you too get some feedback. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Voice 2 text help
On Sep 8, 10:15 am, Abhi abhishek.r.sha...@gmail.com wrote: I want to know if I can extract the text result on the list view and use it as a String further on? The part of code I am refering to is below where mList is defined as ListView: ArrayListString matches = data.getStringArrayListExtra (RecognizerIntent.EXTRA_RESULTS); mList.setAdapter(new ArrayAdapterString(this, android.R.layout.simple_list_item_1, matches)); The results are in the matches variable as strings already. If you want the first one do something like this: String firstResult = null != matches !matches.isEmpty() ? matches.get(0) : null; --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Scaled down image + bottom buttons in dialog
This one is driving me up the wall... I just want a scaled image at the top and a couple of buttons at the bottom. The problem is that when the image is bigger than the screen, it first takes up all the space it can due to the size of the image, so when the image is scaled down (taking into account the aspect ratio) there are big loads of blank space left. I've tried every variation of layout_width, gravity, weight, image scaleType, container etc I can think of. Thanks for any tips to save my remaining hair, Lee --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] local service lifecycle...
i have a local service (based on LocalService). when I start my app, the service gets created. when I back out of my app (continuing to hit back until I get to the desktop), my service's onDestroy() gets called, but the service is still alive (presumably until android decides it's low on system resources and kills it). then I re-launch my app and call bindService() - a *new* service is created (at least my service's constructor is called). what I don't understand is why it doesn't simply attach to the existing service (because it's been destroyed?? but it's still running... ??). then my follow up question is: should i then make my service a singleton, or at least point to a singleton so when it's re-created I can point to the one that exists? tia. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: local service lifecycle...
sdphil wrote: i have a local service (based on LocalService). when I start my app, the service gets created. when I back out of my app (continuing to hit back until I get to the desktop), my service's onDestroy() gets called, but the service is still alive (presumably until android decides it's low on system resources and kills it). How do you know that the service is still alive? If it is because you have a background thread, you need to stop that background thread in onDestroy(). Otherwise, the service object, while detached from Android, will live until the thread terminates, or until Android force-closes your process due to lack of memory. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Deep sleep behaviour
Android Development wrote: 2. Now, if my application is idle (there is no incoming/outgoing traffic), i want to turn the screen off with the CPU still running by taking a PARTIAL_WAKE_LOCK. (Of course the user may switch to another application and turn on the screen in the process ! ) PARTIAL_WAKE_LOCK does not turn off the screen. The screen will turn off on its own when there is nothing to keep the screen on. (However the docs say that any Wake Lock is bad for the battery !! I thought that turning the screen off will save on battery ! ) The fact that you are trying to keep your code running all of the time -- and hence keep the CPU running -- is bad for the battery. Allowing the screen to turn off means it is somewhat less bad. It's like eating a large greasy pizza by yourself, then having a Diet Coke. 4. Now i will register a phone state listener like this: TelephonyManager tmgr = (TelephonyManager)context.getSystemService(context.TELEPHONY_SERVICE); AppPhoneStateListener myListner = new AppPhoneStateListener(); tmgr.listen(myListner, PhoneStateListener.LISTEN_DATA_ACTIVITY); // The docs say this data activity is for cellular. Does this mean i cannot get the state changes to WiFi data traffic ? (Eg: WiFi //connection idle..no traffic...incoming traffic starts etc) There are broadcast Intents for the WiFi state changes. Check out the WifiManager class. 5. After some time, i will receive a onDataActivity(int) http://developer.android.com/reference/android/telephony/PhoneStateListener.html#onDataActivity(int) callback when the data state changes. This is the time, i will initialize resources to handle the incoming traffic/ or send outbound traffic. Over here, i will also release the PARTIAL_WAKE_LOCK. What is your business goal? In other words, what are you really trying to achieve with all of this convoluted code? Or does it incur a considerable cost on the system battery/resources due to the PARTIAL_WAKE_LOCK ? As my lengthy post on this thread from yesterday attempted to demonstrate, you will significantly reduce battery life by this approach. You are keeping the CPU running 24x7, which is an extraordinarily bad idea on a battery-powered device. You can easily cut battery life in half, or perhaps worse in your case. Remember: just because something is technically possible does not mean it is intrinsically efficient, or even practical. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Native code is being called successfully but not executed properly
pink 444 wrote: I am newbie to Android ,Hence can you explain it in detail . Step #1: Click the following link: http://groups.google.com/group/android-ndk Step #2: Join that Google Group. Step #3: Ask questions related to JNI work there. Android's SDK alone does not support JNI. Hence, you are either attempting to modify the firmware (use the [android-platform] Google Group for questions) or you are using the Native Development Kit (NDK). The above steps will get you connected to the Google Group related to the NDK. Here is a link to the current NDK's home page: http://developer.android.com/sdk/ndk/1.5_r1/index.html -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Video quality
Any Suggestions?? On Sep 10, 2:05 am, Engin Arslan enginarsla...@gmail.com wrote: To be more specific, When I captured video, it only capture left top of screen with lowqualityas if it zooms top left of screen. What can be problem? On Sep 9, 10:07 pm, Engin Arslan enginarsla...@gmail.com wrote: Hi, i am capturing video with the code below. But there is problem on videoquality, that is, when I capture video with applicaiton I wrote itsqualityis not as well as videoqualityof telepohnes' which is recorded by Camcorder. public CamcorderPreview(Context context, AttributeSet attrs) { super(context, attrs); holder = getHolder(); holder.addCallback(this); holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setMaxDuration(MAX_RECORDING_DURATION_MS); recorder.setVideoSize(352,288); createVideoPath(); recorder.setOutputFile(mCameraVideoFilename); recorder.setVideoEncoder (MediaRecorder.VideoEncoder.H263); recorder.setAudioEncoder (MediaRecorder.AudioEncoder.AMR_NB); recorder.setPreviewDisplay(holder.getSurface()); }- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Check for internet connection
andymoris wrote: hi,Mark, i got errors in returning statement? do i need to catch the return value and display the status? I am not certain that I understand the question. The code I listed was intended to be the body of some method. Here is a larger listing: public boolean iCanHasDataNowKThxBye() { ConnectivityManager connMgr=(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo info=connMgr.getActiveNetworkInfo(); return(info!=null info.isConnected()); } You would call that method when you need to know if there is some form of data connectivity presently available. What you do with that information is up to you. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: local service lifecycle...
based on some other posts I have seen, I created a static variable inside my service class and I initialize it to false. when the service is created, I set it to true. public class MyService extends Service { private static boolean running = false; ... ... @Override public void onCreate() { super.onCreate(); running = true; ... ... then when I come back up, I can just check if Service.running is true - if it is, then my service object is still alive. to answer your question more specifically - I do have a background thread, but the whole point was that I wanted this service to run even though the app was closed (i.e. no activities) (isn't that the point of a service) ? Otherwise, the service object, while detached from Android, will live until the thread terminates, or until Android force-closes your process due to lack of memory. which is exactly what I want... tia. On Sep 10, 4:05 am, Mark Murphy mmur...@commonsware.com wrote: sdphil wrote: i have a local service (based on LocalService). when I start my app, the service gets created. when I back out of my app (continuing to hit back until I get to the desktop), my service's onDestroy() gets called, but the service is still alive (presumably until android decides it's low on system resources and kills it). How do you know that the service is still alive? If it is because you have a background thread, you need to stop that background thread in onDestroy(). Otherwise, the service object, while detached from Android, will live until the thread terminates, or until Android force-closes your process due to lack of memory. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Need Android talent? Ask on HADO!http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: local service lifecycle...
sdphil wrote: based on some other posts I have seen, I created a static variable inside my service class and I initialize it to false. when the service is created, I set it to true. public class MyService extends Service { private static boolean running = false; ... ... @Override public void onCreate() { super.onCreate(); running = true; ... ... then when I come back up, I can just check if Service.running is true - if it is, then my service object is still alive. You are mistaken. It means the process was not closed down. In Java, static data members live outside of any one instance of the class they are a part of. to answer your question more specifically - I do have a background thread, but the whole point was that I wanted this service to run even though the app was closed (i.e. no activities) (isn't that the point of a service) ? It is one use of a service. Otherwise, the service object, while detached from Android, will live until the thread terminates, or until Android force-closes your process due to lack of memory. which is exactly what I want... Hopefully this is not what you want -- I really expect your users do not want you leaking memory and threads like a sieve. If your goal is to have the service to persist after all activities that were using it have been destroyed, then you need to use startService(), perhaps in addition to bindService(). A service can be both started and have connections bound to it. In such a case, the system will keep the service running as long as either it is started or there are one or more connections to it with the Context.BIND_AUTO_CREATE flag. Once neither of these situations hold, the service's onDestroy() method is called and the service is effectively terminated. All cleanup (stopping threads, unregistering receivers) should be complete upon returning from onDestroy(). (from http://developer.android.com/reference/android/app/Service.html) -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: local service lifecycle...
by the way, is there any way to know when Android is about to force- close your process / service? On Sep 10, 4:24 am, sdphil phil.pellouch...@gmail.com wrote: based on some other posts I have seen, I created a static variable inside my service class and I initialize it to false. when the service is created, I set it to true. public class MyService extends Service { private static boolean running = false; ... ... @Override public void onCreate() { super.onCreate(); running = true; ... ... then when I come back up, I can just check if Service.running is true - if it is, then my service object is still alive. to answer your question more specifically - I do have a background thread, but the whole point was that I wanted this service to run even though the app was closed (i.e. no activities) (isn't that the point of a service) ? Otherwise, the service object, while detached from Android, will live until the thread terminates, or until Android force-closes your process due to lack of memory. which is exactly what I want... tia. On Sep 10, 4:05 am, Mark Murphy mmur...@commonsware.com wrote: sdphil wrote: i have a local service (based on LocalService). when I start my app, the service gets created. when I back out of my app (continuing to hit back until I get to the desktop), my service's onDestroy() gets called, but the service is still alive (presumably until android decides it's low on system resources and kills it). How do you know that the service is still alive? If it is because you have a background thread, you need to stop that background thread in onDestroy(). Otherwise, the service object, while detached from Android, will live until the thread terminates, or until Android force-closes your process due to lack of memory. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Need Android talent? Ask on HADO!http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Deep sleep behaviour
Thanks for the reply Mark. I read from the docs that PARTIAL_WAKE_LOCK turns the screen off...but the CPU runs :( Flag ValueCPUScreenKeyboardPARTIAL_WAKE_LOCKhttp://developer.android.com/reference/android/os/PowerManager.html#PARTIAL_WAKE_LOCK On*OffOffMy goal is..to shutdown some of my services when my application is idle, but keep only one service running (which is the main service of my application). Only when i start receiving packets from the underlying IP Connectivity Network and my protocol listeners intercept the messages,then i want to re-start these other services. If i do not take a wake lock, there is an outside chance that my Main service might be shutdown by android, which i want to avoid. So, you suggest, that i find an alternative to avoid a 'forever running' service to relieve the CPU ? That will be better to conserve battery life i suppose, as there will be no wake locks anymore to keep the CPU on. I will follow your suggestion then. It will be easy to find a workaround to avoid this long running service at this stage of my dev, as i have made just a proof of concept application right now to get my hands wet with all the concepts. Thanks for referring me the WiFiManager...i will take a look at it. ..and, thanks for taking the time to reply to my message. Its been of great help to me. On Thu, Sep 10, 2009 at 4:43 PM, Mark Murphy mmur...@commonsware.comwrote: Android Development wrote: 2. Now, if my application is idle (there is no incoming/outgoing traffic), i want to turn the screen off with the CPU still running by taking a PARTIAL_WAKE_LOCK. (Of course the user may switch to another application and turn on the screen in the process ! ) PARTIAL_WAKE_LOCK does not turn off the screen. The screen will turn off on its own when there is nothing to keep the screen on. (However the docs say that any Wake Lock is bad for the battery !! I thought that turning the screen off will save on battery ! ) The fact that you are trying to keep your code running all of the time -- and hence keep the CPU running -- is bad for the battery. Allowing the screen to turn off means it is somewhat less bad. It's like eating a large greasy pizza by yourself, then having a Diet Coke. 4. Now i will register a phone state listener like this: TelephonyManager tmgr = (TelephonyManager)context.getSystemService(context.TELEPHONY_SERVICE); AppPhoneStateListener myListner = new AppPhoneStateListener(); tmgr.listen(myListner, PhoneStateListener.LISTEN_DATA_ACTIVITY); // The docs say this data activity is for cellular. Does this mean i cannot get the state changes to WiFi data traffic ? (Eg: WiFi //connection idle..no traffic...incoming traffic starts etc) There are broadcast Intents for the WiFi state changes. Check out the WifiManager class. 5. After some time, i will receive a onDataActivity(int) http://developer.android.com/reference/android/telephony/PhoneStateListener.html#onDataActivity(int) callback when the data state changes. This is the time, i will initialize resources to handle the incoming traffic/ or send outbound traffic. Over here, i will also release the PARTIAL_WAKE_LOCK. What is your business goal? In other words, what are you really trying to achieve with all of this convoluted code? Or does it incur a considerable cost on the system battery/resources due to the PARTIAL_WAKE_LOCK ? As my lengthy post on this thread from yesterday attempted to demonstrate, you will significantly reduce battery life by this approach. You are keeping the CPU running 24x7, which is an extraordinarily bad idea on a battery-powered device. You can easily cut battery life in half, or perhaps worse in your case. Remember: just because something is technically possible does not mean it is intrinsically efficient, or even practical. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: local service lifecycle...
sdphil wrote: by the way, is there any way to know when Android is about to force- close your process / service? Not really. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Deep sleep behaviour
Android Development wrote: Only when i start receiving packets from the underlying IP Connectivity Network and my protocol listeners intercept the messages,then i want to re-start these other services. I do not know your application or what it is trying to achieve. I would recommend, though, that you use the Five Why's to determine the root cause for needing the above requirement, because that requirement is going to be the cause of your difficulty in terms of power management http://en.wikipedia.org/wiki/5_Whys For example, as Ms. Hackborn pointed out elsewhere in this thread, the phone will always try to maintain a data connection, whether WiFi or cellular data. There are plenty of scenarios where you would lose data connectivity (driving out of signal area, driving through a tunnel, user turns on airplane mode), but I am not convinced any of them happen frequently enough and are important enough that you need to find out *immediately* when they occur. Perhaps you do -- again, I do not know your application. But, if you can drop the requirement of having to react immediately upon a data connectivity change, then perhaps you can just let the device go to sleep and only take action on a periodic basis via AlarmManager (e.g., once an hour). That's why I was inquiring about the business goals -- it's one way I try to steer people in a Five-Why's-style analysis. It may be that the true business goal is to know, within milliseconds, whether you have data connectivity. However, if that is not the true business goal, then you may be expending a whole lot of effort fighting Android where it is not needed. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Development Wiki: http://wiki.andmob.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] best way to resize a bitmap...
i want to resize a bitmap and write to a file. what's the best way to do that? tia. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Native code is being called successfully but not executed properly
The fact that stdout does not point at the logs is android generic, not ndk specific. It derives not from the jni call, but from the excution environment of the vm, which probably has it pointed at /dev/ null. On Sep 10, 3:39 am, Peli peli0...@googlemail.com wrote: You were posting to the wrong forum. Post your question here to get help:http://groups.google.com/group/android-ndk Peliwww.openintents.org On Sep 10, 8:17 am, pink 444 pnk...@gmail.com wrote: Hai, I am newbie to Android ,Hence can you explain it in detail . Thanks in Advance, -Siva. On Sep 10, 11:02 am, Dianne Hackborn hack...@android.com wrote: Hi, you are more likely to get help on android-ndk. On Wed, Sep 9, 2009 at 9:36 PM, pink 444 pnk...@gmail.com wrote: hai folks, In Android , Native code is written as follows. JNIEXPORT void JNICALL Java_com_android_Test_show(JNIEnv *env, jobject obj) { printf(THIS IS TEST); } JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) { JNIEnv *env; JNINativeMethod meth; jclass k; jint r; r = (*vm)-GetEnv (vm, (void **) env, JNI_VERSION_1_4); k = (*env)-FindClass (env, com.android.Test.show); meth.name = show; meth.signature = ()V; meth.fnPtr = Java_com.android.Test.show; r = (*env)-RegisterNatives (env, k, meth, 1); return JNI_VERSION_1_4; } JNIEXPORT void JNI_OnUnload(JavaVM *vm, void *reserved) { JNIEnv *env; jclass k; jint r; r = (*vm)-GetEnv (vm, (void **) env, JNI_VERSION_1_4); k = (*env)-FindClass (env, com.android.Test.show); (*env)-UnregisterNatives(env, k); } While executing on Android the following messages are obeserved in adb logcat. JNI ( 524): Trying to load jni .so I/System.out( 524): /system/lib D/dalvikvm( 524): Trying to load lib /data/libjnilibs.so 0x433f22d0 D/dalvikvm( 524): Added shared lib /data/libjnilibs.so 0x433f22d0 I/ActivityManager( 50): Displayed activity com.android.helloactivity But THIS IS TEST is not being displayed, which is displayed in native code. There are no errors regarding loading shared library and calling native code.Then why is the message is not displayed in logging. Am i doing any mistake.If JNI_OnLoad and JNI_OnUnLoad are not implemented i am getting errors in Logging.If i do as above i not getting that native code message. Any help would be appreciated highly. Regards, -Siva. -- 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] XML RPC Parsing Error
I found xmlrpc problem alway! How to soleve this error of parsing? xmlrpc.android.XMLRPCException: org.xmlpull v1.XmlPullParserException : expected START_TAG {null} methodResponse ( position: start_tag html qxmls=http://www.w3.og/ 1999/xhtml'@2:44 in java.io. inputstreamrea...@435fi2a0) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Deep sleep behaviour
On Thu, Sep 10, 2009 at 5:40 PM, Mark Murphy mmur...@commonsware.comwrote: Android Development wrote: Only when i start receiving packets from the underlying IP Connectivity Network and my protocol listeners intercept the messages,then i want to re-start these other services. I do not know your application or what it is trying to achieve. I would recommend, though, that you use the Five Why's to determine the root cause for needing the above requirement, because that requirement is going to be the cause of your difficulty in terms of power management http://en.wikipedia.org/wiki/5_Whys For example, as Ms. Hackborn pointed out elsewhere in this thread, the phone will always try to maintain a data connection, whether WiFi or cellular data. There are plenty of scenarios where you would lose data connectivity (driving out of signal area, driving through a tunnel, user turns on airplane mode), but I am not convinced any of them happen frequently enough and are important enough that you need to find out *immediately* when they occur. Perhaps you do -- again, I do not know your application. Ok, i will tell what the application is supposed to do. It is a SIP client. As per the standard procedures that i am following, whenever there is loss of radio connectivity with the base station / data connectivity with the underlying IP network, I need to clean up my SIP registration state and any transient state that may have been maintained (eg: if a call was in progress then i need to clean up the call state, state maintained due to subscription to network side resources etc). So, basically its a clean up job. Subsequent to this clean up, i have to log the user out of the application and present the Login screen to him/her. But, if you can drop the requirement of having to react immediately upon a data connectivity change, then perhaps you can just let the device go to sleep and only take action on a periodic basis via AlarmManager (e.g., once an hour). This is also a possible alternative. But if this connectivity was lost during the course of a SIP call, then i need to 'drop' the call, clean up its FSM and stop RTP flow. That's why I was inquiring about the business goals -- it's one way I try to steer people in a Five-Why's-style analysis. It may be that the true business goal is to know, within milliseconds, whether you have data connectivity. However, if that is not the true business goal, then you may be expending a whole lot of effort fighting Android where it is not needed. I appreciate the systematic approach. I liked that link. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Development Wiki: http://wiki.andmob.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Platform 1.5 with Google Map API does it has any platform number
Hi, Is there a way to recognize 1.5 platforms with addon ap google maps. In absense of such things, we could recognize by trying to load the class MapView. In case the api level has different number for this special addon, we wish to use this approach. Regards, Raja Nagendra Kumar, C.T.O www.tejasoft.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Running Application as Service
Hi, I am currently just registering Broadcast Receiver for reading incoming messages. And this also works in Background which is what I required. Now is that Broadcast Receiver unregistered by Android Application Manager automatically or will it be able to process every incoming message. I just want to read incoming message process it and if it contains a specific content then send the current location of that to the number from which the message arrived. Will just extending Broadcast Receiver do the work or will I need to implement it as Service so that it runs forever. I have checked the Broadcast Receiver it works for now. One more question when will this Broadcast Receiver be called. Suppose the mobile is switched on then will this receiver be registered automatically. Regards Sunil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Deep sleep behaviour
Android Development wrote: Ok, i will tell what the application is supposed to do. It is a SIP client. And *that* explains a lot! As per the standard procedures that i am following, whenever there is loss of radio connectivity with the base station / data connectivity with the underlying IP network, I need to clean up my SIP registration state and any transient state that may have been maintained (eg: if a call was in progress then i need to clean up the call state, state maintained due to subscription to network side resources etc). So, basically its a clean up job. That makes sense. This is also a possible alternative. But if this connectivity was lost during the course of a SIP call, then i need to 'drop' the call, clean up its FSM and stop RTP flow. Yes. I am not a SIP expert by any means, though I use onSIP and Twinkle for my office line. My hope is that you will only need the WakeLock during the call for the cleanup process, and that the rest of Android will just work to give you control if, say, a call comes in while the phone is otherwise asleep. However, I have not tried any stateful socket connections -- all of my work has been with nice transient Web services. And, like I said, I am not a SIP expert and do not know the details of the protocol. If you can get by with the WakeLock and monitoring the connectivity state only during the call, you should not be too bad on the battery. If, on the other hand, you need to monitor the connectivity state all the time, battery life will suffer, but a SIP client is at least a decent justification for it. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Development Wiki: http://wiki.andmob.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Cannot upload Promotional Graphic to Android Market
It looks like the screenshots have stuck for the past few days, that's a little better. But, I'm with you, SoB, the promo graphics and promo text are still broken. On Sep 8, 8:41 am, Streets Of Boston flyingdutc...@gmail.com wrote: I meant that the 'images not sticking' problem does not occur on FireFox. I still cannot upload a PNG as a 'promo image'. On Sep 8, 9:40 am, Streets Of Boston flyingdutc...@gmail.com wrote: Try it on any other browser than IE8, if that's the one you're using. When i used FireFox, all went fine. On Sep 8, 8:24 am,jsdfjasons...@gmail.com wrote: Problem still exists. And, per Streets of Boston, my 2 full screenshots are not 'sticking' over time either. I don't think the Android Market guys actually tested this properly before publishing it. On Sep 4, 10:46 pm, String sterling.ud...@googlemail.com wrote: I've created and uploaded JPGs with no trouble, so it certainly can work. Try saving your file with different options - let us know if you find what's causing the trouble. String On Sep 4, 11:54 pm, Don Oleary donole...@gmail.com wrote: Also cannot upload any image. Getting the error Graphic must be a PNG or JPEG image file. Regards Don On Fri, Sep 4, 2009 at 5:44 PM, Streets Of Boston flyingdutc...@gmail.comwrote: Same here. In addition; i cannot upload any image (screenshots). They are there for a while, then a bit later they have disappeared. On Sep 4, 9:59 am,jsdfjasons...@gmail.com wrote: I've created 4 separate .png files with the appropriate specs (180w x 120h, PNG, full bleed, no border art) for 4 projects. I cannot upload any of them to my projects. In each case, I receive the error: The promotional graphic must be a PNG or JPEG image file. Is anyone else seeing the same issue? Thanks, jsdf- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Deep sleep behaviour
And *that* explains a lot! lol !! Thanks Mark. I am exploring another work around. When i start my stack, I bind it to a well defined IP and port. If IP connectivity is lost, then the stack should throw an exception. I am thinking of testing it out...catching that exception and then triggering the cleanup job. This way i can avoid the expensive Wake Lock. On Thu, Sep 10, 2009 at 6:22 PM, Mark Murphy mmur...@commonsware.comwrote: Android Development wrote: Ok, i will tell what the application is supposed to do. It is a SIP client. And *that* explains a lot! As per the standard procedures that i am following, whenever there is loss of radio connectivity with the base station / data connectivity with the underlying IP network, I need to clean up my SIP registration state and any transient state that may have been maintained (eg: if a call was in progress then i need to clean up the call state, state maintained due to subscription to network side resources etc). So, basically its a clean up job. That makes sense. This is also a possible alternative. But if this connectivity was lost during the course of a SIP call, then i need to 'drop' the call, clean up its FSM and stop RTP flow. Yes. I am not a SIP expert by any means, though I use onSIP and Twinkle for my office line. My hope is that you will only need the WakeLock during the call for the cleanup process, and that the rest of Android will just work to give you control if, say, a call comes in while the phone is otherwise asleep. However, I have not tried any stateful socket connections -- all of my work has been with nice transient Web services. And, like I said, I am not a SIP expert and do not know the details of the protocol. If you can get by with the WakeLock and monitoring the connectivity state only during the call, you should not be too bad on the battery. If, on the other hand, you need to monitor the connectivity state all the time, battery life will suffer, but a SIP client is at least a decent justification for it. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Development Wiki: http://wiki.andmob.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] external flash app?
I am hoping to start learning how to make apps this winter, and am wondering if this is even possible... Could an app be developed that would sense the flash of an external flash device, and take a picture? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Deep sleep behaviour
Yes. it worked..first the stack threw an exception..and then this nested exception: Caused by: java.net.BindException: Cannot assign requested address: Datagram send failed On Thu, Sep 10, 2009 at 6:28 PM, Android Development indodr...@gmail.comwrote: And *that* explains a lot! lol !! Thanks Mark. I am exploring another work around. When i start my stack, I bind it to a well defined IP and port. If IP connectivity is lost, then the stack should throw an exception. I am thinking of testing it out...catching that exception and then triggering the cleanup job. This way i can avoid the expensive Wake Lock. On Thu, Sep 10, 2009 at 6:22 PM, Mark Murphy mmur...@commonsware.comwrote: Android Development wrote: Ok, i will tell what the application is supposed to do. It is a SIP client. And *that* explains a lot! As per the standard procedures that i am following, whenever there is loss of radio connectivity with the base station / data connectivity with the underlying IP network, I need to clean up my SIP registration state and any transient state that may have been maintained (eg: if a call was in progress then i need to clean up the call state, state maintained due to subscription to network side resources etc). So, basically its a clean up job. That makes sense. This is also a possible alternative. But if this connectivity was lost during the course of a SIP call, then i need to 'drop' the call, clean up its FSM and stop RTP flow. Yes. I am not a SIP expert by any means, though I use onSIP and Twinkle for my office line. My hope is that you will only need the WakeLock during the call for the cleanup process, and that the rest of Android will just work to give you control if, say, a call comes in while the phone is otherwise asleep. However, I have not tried any stateful socket connections -- all of my work has been with nice transient Web services. And, like I said, I am not a SIP expert and do not know the details of the protocol. If you can get by with the WakeLock and monitoring the connectivity state only during the call, you should not be too bad on the battery. If, on the other hand, you need to monitor the connectivity state all the time, battery life will suffer, but a SIP client is at least a decent justification for it. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Development Wiki: http://wiki.andmob.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: do i need to close cursor?
It is recommended to close all cursors when you are not using they anymore. If you keep it opened, you will cause a memory leak on your application. Felipe Silveira On Thu, Sep 10, 2009 at 7:06 AM, Sasi Kumar sasikumar.it1...@gmail.comwrote: close the sursor each time. b'coz when u try to open another time the cursor. it will show exception as already cursor as opened. so close the cursor On Sep 10, 12:13 pm, jerryfan2000 jerryfan1...@gmail.com wrote: Hi, Just wondering is it necessary to close cursor when an activity is stopped or pause? -- Felipe Silveira Engenharia da Computação Universidade Federal de Itajubá http://www.felipesilveira.com.br MSN: felipeuni...@hotmail.com Skype: fsunifei - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Voice 2 text help
@Mark, Sorry if I took you by surprise :) I see your name in a lot of discussions around here and have been reading your Book (Beginning Android), so thought you would know. Thanks anyways Thanks Lance, I thought I knew how to do that but just didn't have direction... slowly getting there On Sep 10, 6:30 am, Lance Nanek lna...@gmail.com wrote: On Sep 8, 10:15 am, Abhi abhishek.r.sha...@gmail.com wrote: I want to know if I can extract the text result on the list view and use it as a String further on? The part of code I am refering to is below where mList is defined as ListView: ArrayListString matches = data.getStringArrayListExtra (RecognizerIntent.EXTRA_RESULTS); mList.setAdapter(new ArrayAdapterString(this, android.R.layout.simple_list_item_1, matches)); The results are in the matches variable as strings already. If you want the first one do something like this: String firstResult = null != matches !matches.isEmpty() ? matches.get(0) : null; --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: XML parser
Use the XmlPullParser. Regards, Keean. On Sep 10, 11:10 am, Lewis lewisandrewba...@googlemail.com wrote: I found XML parsing in android to be slightly buggy, the parser seemed to have some strange behaviour dealing with whitespace and some special characters. I used dom4j as an alternative and it worked fine This thread discusses dom4j on android:http://groups.google.com/group/android-developers/browse_thread/threa... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: DatePicker throw java.lang.StackOverflowError when embbeded with TableRow
Great answer! So problem in my activity :) In old version of SDK 1.1 there was no restrictions in view hierarchy. Application was already optimized on the beginnin of woriking with SDK 1.5 when you wrote me the same answer). Delete something else means that I must to delete some useful controls from my Application. On Sep 9, 10:58 am, Romain Guy romain...@google.com wrote: You have too many levels of views in your hierarchy. Remove some of them. On Wed, Sep 9, 2009 at 12:54 AM, dragosdrag...@gmail.com wrote: Have the same problem, with only one difference. In my case EditText is used as child of TableLayout (withoutTableRow). Exception: Uncaught handler: thread main exiting due to uncaught exception java.lang.StackOverflowError at android.text.method.ReplacementTransformationMethod $SpannedReplacementCharSequence.getSpans (ReplacementTransformationMethod.java:184) at android.text.Styled.each(Styled.java:43) at android.text.Styled.foreach(Styled.java:249) at android.text.Styled.measureText(Styled.java:371) at android.text.Layout.measureText(Layout.java:1477) -- 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: external flash app?
If you want to depend on an external flash to trigger the camera, and use that flash to improve the picture, I think you'll find that impossible as the camera is way too slow to react to such a sudden event. Try triggering the camera manually. It takes about a second before the image is captured, by then, the flash would be half way to the moon... -John Coryat What Zip Code? Radar Now! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] InstrumentationTestRunner not specified ??
Today Eclipse is telling me ERROR: Application does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses-library android.test.runner whenever I select the Run choice of the Run menu. What does this mean? The AVD manager is listing the target avd. The avd will launch with the emulator command. I have issued the Run-Run command a many times before w/out this happening. Can anyone help me understand what this mens and how to correct 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: 【招聘】Androi d开发工程师 15-20w-北京
在深圳可以吗? 本人熟悉java. c++ 开发10年经验。 2009/9/9 何斌斌 hbbs...@gmail.com hi, 如何联系, 本人的msn:hbbs...@hotmail.com 从事android开发:1.5 年 2009/9/8 IDA yydl...@gmail.com 职位描述: 从事Android或OMS平台手机终端应用的开发。 职位要求: 1、计算机及相关专业本科以上学历; 2、良好的Java技术功底; 3、熟悉Android系统架构及相关技术,1年以上实际Android平台开发经验; 4、熟悉无线网络及多媒体应用开发; 5、思路清晰,思维敏捷,快速的学习能力,良好的英文资料阅读能力; 6、能承担较大工作压力,具备良好的沟通能力和团队合作精神; 7、有手机输入法软件开发经验者优先。 MSN email: ida@live.cn --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: external flash app?
I have a lot of video from various cameras of live events, where someone else taking a flash picture washes out a frame now and then. So one possible approach would be to see if you can run in video camera mode, with some control over the exposure so things are fairly underexposed, and feeding your own compression scheme that in fact just throws away dim frames until it gets a well lighted one, which it saves at full fidelity and then quits. No idea what kind of performance you will get or even if you have the necessary low-level access to the camera. On Sep 10, 9:46 am, Maps.Huge.Info (Maps API Guru) cor...@gmail.com wrote: If you want to depend on an external flash to trigger the camera, and use that flash to improve the picture, I think you'll find that impossible as the camera is way too slow to react to such a sudden event. Try triggering the camera manually. It takes about a second before the image is captured, by then, the flash would be half way to the moon... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: InstrumentationTestRunner not specified ??
Here is the AndroidManifest.xml file: ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.myApp android:versionCode=1 android:versionName=1.0 application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.myApp android:label=@string/app_name intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity /application uses-sdk android:minSdkVersion=3 / instrumentation android:name=android.test.InstrumentationTestRunner android:targetPackage=com.myApp android:label=myApp / uses-permission android:name=android.permission.INTERNET/uses- permission /manifest On Sep 10, 9:50 am, WoodManEXP woodman...@gmail.com wrote: Today Eclipse is telling me ERROR: Application does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses-library android.test.runner whenever I select the Run choice of the Run menu. What does this mean? The AVD manager is listing the target avd. The avd will launch with the emulator command. I have issued the Run-Run command a many times before w/out this happening. Can anyone help me understand what this mens and how to correct 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] Invalid routing action. Node A2DP does not exist.
Hi, Can anyone Help me understand what this error message means? Or how I can avoid this error occurring? Its occurring on a HTC Hero. Invalid routing action. Node A2DP does not exist. It seems to occur when I am calling Intent to Dial a Number, you hear the first tone come through the speaker (which is wierd in itself) then the dialer crashes and the above error message is shown. I have tried the below code before I do my call or dial but to no avail. Context myContext = this; AudioManager am =(AudioManager) myContext.getSystemService (Context.AUDIO_SERVICE); am.setBluetoothA2dpOn(false); am.setRouting(AudioManager.MODE_CURRENT, AudioManager.ROUTE_EARPIECE, AudioManager.ROUTE_ALL); I basically get the issue when I am trying to call a number with the URL tel:555;ext=4535*433 which works in the emulator fine! Regards Mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Anyone know a lightweight geotagging library
I want to add gps latitude and longitude in a jpg. I can do it using Sanselan port to Android but the libray is 300kb and then copy protection on my app makes this 600kb - a huge increase in app size just to write a few exif tags. I've tried stripping down the Sanselan libraries to just the relevant parts but most classes seem to be needed and are mostly dependent on each other. Is there a more lightweight library to do this. I saw an ExifInterface in the sdk but it doesn't seem to initialize correctly as I think it needs to run native code in the camera apk. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: sqlite can't show chinese words
This is a code issue. There are many chinese application in Android Market It stores unicode characters fine On 9月10日, 下午5時37分, tstanly tsai.sta...@gmail.com wrote: thanks Dianne, but actually I use sqlite3 to insert a record not by program, and I check when the record is English words, the app can output correctly, soI don't think this is a code issue??? thanks On 9月10日, 下午4時02分, Dianne Hackborn hack...@android.com wrote: It stores unicode characters fine. (I believe the internal encoding it uses is UTF-8, but this should be invisible to the Java level.) I would suggest looking at your code around it to make sure there aren't any encoding problems or such. 2009/9/10 tstanly tsai.sta...@gmail.com under eclipse,the shell shows chinese ok (via sqlite3 and select *) but random code in the app then retrieve data from database, the same situation in the machine. thanks On 9月10日, 下午2時51分, 楊健 y...@cycomtech.co.jp wrote: I have try to store japanese and it works well.But the logcat can't show Japanese correctly,maybe you just test under eclipse, did you? -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of tstanly Sent: Thursday, September 10, 2009 3:44 PM To: Android Developers Subject: [android-developers] sqlite can't show chinese words hi all, I found that sqlite can't store chinese words and will shows random code in the application when retrieve data. can somebody give some help? thanks!- 隱藏被引用文字 - - 顯示被引用文字 - -- 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] Crash at drawing WebView into the Canvas.
Hi All, I am facing a problem. I launched a webview with some url. After url is completely loaded I try to get its content in a Canvas. But I am unable to do so. its crashing at libsgl.so My goal is to get webview complete data in a bitmap. There is one api getDrawingCache() which gets the webview data in a bitmap format, but it gets only the visible content. I actually want the whole content in a bitmap. If there is some another way, then how can I go about that. Here is mine code. ~~ WebView w = new WebView(this); w.loadUrl(http://www.msn.com;); int w1 = w.getWidth(); int h1 = w.getContentHeight(); Bitmap myBitMap = Bitmap.createBitmap(w1,h1, Bitmap.Config.ARGB_); Canvas myCanvas = new Canvas(); w.draw(myCanvas); // **CRASH POINT **// savePicture(myBitMap, yahoo2.jpg); * // Saving it as a file to locacal filesystem * private void savePicture(Bitmap bitmap, String filename) { String fileName = filename; if(bitmap!= null) { //BitmapDrawable drawable = new BitmapDrawable(mBitmap); //getWindow().setFeatureDrawable(Window.FEATURE_LEFT_ICON, (Drawable)drawable); ByteArrayOutputStream byteArrayOpStream = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 90, byteArrayOpStream); try { FileOutputStream fos = openFileOutput(fileName, MODE_WORLD_WRITEABLE); fos.write(byteArrayOpStream.toByteArray()); /*byte[] picByteArry = picture.toString().getBytes(); fos.write(picByteArry);*/ fos.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } ~~ I am also pasting the crash logs which are shown in ddms. 09-10 19:36:25.955: INFO/DEBUG(539): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 09-10 19:36:25.955: INFO/DEBUG(539): Build fingerprint: 'generic/sdk/ generic/:1.5/CUPCAKE/150240:eng/test-keys' 09-10 19:36:25.962: INFO/DEBUG(539): pid: 1544, tid: 1544 com.android.CapturePicture 09-10 19:36:25.962: INFO/DEBUG(539): signal 11 (SIGSEGV), fault addr 0024 09-10 19:36:25.962: INFO/DEBUG(539): r0 00313c68 r1 003a4e5c r2 003be7a4 r3 09-10 19:36:25.962: INFO/DEBUG(539): r4 r5 003a4a38 r6 ac12736c r7 003be7a4 09-10 19:36:25.962: INFO/DEBUG(539): r8 00313c68 r9 10 fp 09-10 19:36:25.972: INFO/DEBUG(539): ip ac052c50 sp bebdd3b8 lr ac052e68 pc ac052c6c cpsr 6010 09-10 19:36:26.092: INFO/DEBUG(539): #00 pc 00052c6c / system/lib/libsgl.so 09-10 19:36:26.092: INFO/DEBUG(539): #01 pc 00052e64 / system/lib/libsgl.so 09-10 19:36:26.102: INFO/DEBUG(539): #02 pc 00054f48 / system/lib/libsgl.so 09-10 19:36:26.102: INFO/DEBUG(539): #03 pc 00051d90 / system/lib/libsgl.so 09-10 19:36:26.122: INFO/DEBUG(539): #04 pc 0025e99a / system/lib/libwebcore.so 09-10 19:36:26.132: INFO/DEBUG(539): #05 pc 0025ea0e / system/lib/libwebcore.so 09-10 19:36:26.132: INFO/DEBUG(539): #06 pc e3b4 / system/lib/libdvm.so 09-10 19:36:26.142: INFO/DEBUG(539): #07 pc 00040a8a / system/lib/libdvm.so 09-10 19:36:26.142: INFO/DEBUG(539): #08 pc 00013118 / system/lib/libdvm.so 09-10 19:36:26.151: INFO/DEBUG(539): #09 pc 00017b1c / system/lib/libdvm.so 09-10 19:36:26.151: INFO/DEBUG(539): #10 pc 00017560 / system/lib/libdvm.so 09-10 19:36:26.151: INFO/DEBUG(539): #11 pc 00052268 / system/lib/libdvm.so 09-10 19:36:26.161: INFO/DEBUG(539): #12 pc 000596ee / system/lib/libdvm.so 09-10 19:36:26.172: INFO/DEBUG(539): #13 pc 00013118 / system/lib/libdvm.so 09-10 19:36:26.172: INFO/DEBUG(539): #14 pc 00017b1c / system/lib/libdvm.so 09-10 19:36:26.172: INFO/DEBUG(539): #15 pc 00017560 / system/lib/libdvm.so 09-10 19:36:26.182: INFO/DEBUG(539): #16 pc 000520ec / system/lib/libdvm.so 09-10 19:36:26.182: INFO/DEBUG(539): #17 pc 0003f0f8 / system/lib/libdvm.so 09-10 19:36:26.191: INFO/DEBUG(539): #18 pc 00031ac2 / system/lib/libdvm.so 09-10 19:36:26.191: INFO/DEBUG(539): #19 pc
[android-developers] Re: Translucent and FullScreen?
I tried that.. status bar is visible :( On 10 Вер, 10:05, sleith raysle...@gmail.com wrote: try this one :) requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); On Sep 10, 4:08 am, Illidane illid...@gmail.com wrote: Hi! I have an issue : I set Theme.Translucent.NoTitleBar.Fullscreen for my app, but status bar is still here. Is there a solution for it? 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: Translucent and FullScreen?
No, I don't see title bar, only status.. On 10 Вер, 10:36, Peli peli0...@googlemail.com wrote: If you have a translucent activity, I guess you see the title bar of the activity below your activity, so this is the expected behavior. Peliwww.openintents.org On Sep 9, 11:08 pm, Illidane illid...@gmail.com wrote: Hi! I have an issue : I set Theme.Translucent.NoTitleBar.Fullscreen for my app, but status bar is still here. Is there a solution for it? 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: InstrumentationTestRunner not specified ??
Oh, here ya go. Looking under Eclipse's Run-Run Configurations menu choice. Under that one can select a target AVD for the Android Application. That seems to do the trick. So if you get such an error try tinkering with the Run Configurations. On Sep 10, 10:04 am, WoodManEXP woodman...@gmail.com wrote: Here is the AndroidManifest.xml file: ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.myApp android:versionCode=1 android:versionName=1.0 application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.myApp android:label=@string/app_name intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity /application uses-sdk android:minSdkVersion=3 / instrumentation android:name=android.test.InstrumentationTestRunner android:targetPackage=com.myApp android:label=myApp / uses-permission android:name=android.permission.INTERNET/uses- permission /manifest On Sep 10, 9:50 am, WoodManEXP woodman...@gmail.com wrote: Today Eclipse is telling me ERROR: Application does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses-library android.test.runner whenever I select the Run choice of the Run menu. What does this mean? The AVD manager is listing the target avd. The avd will launch with the emulator command. I have issued the Run-Run command a many times before w/out this happening. Can anyone help me understand what this mens and how to correct it? Thank you!- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Deep sleep behaviour
On Sep 10, 8:40 am, Android Development indodr...@gmail.com wrote: But if this connectivity was lost during the course of a SIP call, then i need to 'drop' the call, clean up its FSM and stop RTP flow. If you are on a SIP call, I would think by definition that the processor is not sleeping. Therefore, if the network fails while you were so using it, isn't it safe to assume you will be awake to know? And if the network fails while you are not on a call, and thus potentially asleep, what useful activity do you want to do based on that? Tell the user that they are now out of touch? You could, but most cell phones do not do this. The perhaps interesting case would be when you drive back out of that tunnel, while still asleep. There you might like to re-connect automatically, and you may well not get any wakeup action to do so. This is presumably why the gsm or whatever radio on the cell phone side of the device is managed by a separate processor presumably configured to frequently wakeup for radio network housekeeping without drawing a lot of power. Most current smart phones don't seem to be optimized to be ideal voice- over-wifi devices; to be such they'd need that radio processor to handle the routine housekeeping of sip over wifi or whatever as well. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: InstrumentationTestRunner not specified ??
You need to add uses-library android:name=android.test.runner / inside the activity tag. example: http://developer.android.com/guide/samples/ApiDemos/tests/AndroidManifest.html -- Urs On Thu, Sep 10, 2009 at 4:20 PM, WoodManEXP woodman...@gmail.com wrote: Oh, here ya go. Looking under Eclipse's Run-Run Configurations menu choice. Under that one can select a target AVD for the Android Application. That seems to do the trick. So if you get such an error try tinkering with the Run Configurations. On Sep 10, 10:04 am, WoodManEXP woodman...@gmail.com wrote: Here is the AndroidManifest.xml file: ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.myApp android:versionCode=1 android:versionName=1.0 application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.myApp android:label=@string/app_name intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity /application uses-sdk android:minSdkVersion=3 / instrumentation android:name=android.test.InstrumentationTestRunner android:targetPackage=com.myApp android:label=myApp / uses-permission android:name=android.permission.INTERNET/uses- permission /manifest On Sep 10, 9:50 am, WoodManEXP woodman...@gmail.com wrote: Today Eclipse is telling me ERROR: Application does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses-library android.test.runner whenever I select the Run choice of the Run menu. What does this mean? The AVD manager is listing the target avd. The avd will launch with the emulator command. I have issued the Run-Run command a many times before w/out this happening. Can anyone help me understand what this mens and how to correct it? Thank you!- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: InstrumentationTestRunner not specified ??
Sorry ..inside the applicationtag On Thu, Sep 10, 2009 at 5:03 PM, Urs Grob grob@gmail.com wrote: You need to add uses-library android:name=android.test.runner / inside the activity tag. example: http://developer.android.com/guide/samples/ApiDemos/tests/AndroidManifest.html -- Urs On Thu, Sep 10, 2009 at 4:20 PM, WoodManEXP woodman...@gmail.com wrote: Oh, here ya go. Looking under Eclipse's Run-Run Configurations menu choice. Under that one can select a target AVD for the Android Application. That seems to do the trick. So if you get such an error try tinkering with the Run Configurations. On Sep 10, 10:04 am, WoodManEXP woodman...@gmail.com wrote: Here is the AndroidManifest.xml file: ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.myApp android:versionCode=1 android:versionName=1.0 application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.myApp android:label=@string/app_name intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity /application uses-sdk android:minSdkVersion=3 / instrumentation android:name=android.test.InstrumentationTestRunner android:targetPackage=com.myApp android:label=myApp / uses-permission android:name=android.permission.INTERNET/uses- permission /manifest On Sep 10, 9:50 am, WoodManEXP woodman...@gmail.com wrote: Today Eclipse is telling me ERROR: Application does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses-library android.test.runner whenever I select the Run choice of the Run menu. What does this mean? The AVD manager is listing the target avd. The avd will launch with the emulator command. I have issued the Run-Run command a many times before w/out this happening. Can anyone help me understand what this mens and how to correct it? Thank you!- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to get webview's content into a bitmap?
Hi again, I thought you pasted the correct code already ? Anyway for risk of being accused of writing the code for you, the following will write a jpg file, to the sdcard, which contains the entire content of the web page, when I test it on a G1 phone in portrait mode I get an image of the yahoo page that is currently 315 x 1476 pixels - // package com.testWebView; import java.io.FileOutputStream; import android.app.Activity; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Picture; import android.os.Bundle; import android.util.Log; import android.webkit.WebView; import android.webkit.WebViewClient; public class testWebView extends Activity { WebView w = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); w = new WebView(this); w.setWebViewClient(new WebViewClient() { public void onPageFinished(WebView view, String url) { Picture picture = view.capturePicture(); Bitmap b = Bitmap.createBitmap( picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_); Canvas c = new Canvas( b ); picture.draw( c ); FileOutputStream fos = null; try { fos = new FileOutputStream( /sdcard/yahoo_ + System.currentTimeMillis() + .jpg ); if ( fos != null ) { b.compress(Bitmap.CompressFormat.JPEG, 90, fos ); fos.close(); } } catch( Exception e ) { //... } } }); setContentView( w ); w.loadUrl( http://www.yahoo.com;); } } // and the AndroidManifest.xml - ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.testWebView android:versionCode=1 android:versionName=1.0 application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.testWebView android:label=@string/app_name intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity /application uses-sdk android:minSdkVersion=3 / uses-permission android:name=android.permission.INTERNET/uses- permission /manifest // Now you can stop asking the same question in the discuss group as well ! http://groups.google.com/group/android-discuss/browse_thread/thread/0c7891cac8225505/8bde5eab18ef05c0#8bde5eab18ef05c0 Regards On Sep 10, 1:33 pm, AJ ajeet.invinci...@gmail.com wrote: If somebody knows this, plz help me - AJ On Sep 9, 1:26 pm, Ajeet Singh ajeet.invinci...@gmail.com wrote: Hi gjs, Thanks for pointing that error. But that was a type error. Now I am pasting the correct code here. WebVieww = newWebView(this); w.loadUrl(http://www.yahoo.com;); BitmapmBitmap = null; ByteArrayOutputStream mByteArrayOpStream = null; //get the picture from thewebview Picture picture = w.capturePicture(); //Create the new Canvas Canvas mCanvas = new Canvas(); //Copy the view canvas to abitmap try{ //w.draw(mCanvas); //mCanvas.save(); //picture.draw(mCanvas); mCanvas.drawPicture(picture); //int restoreToCount =mCanvas.save(); //mCanvas.drawPicture(picture); //mCanvas.restore(); } catch (Exception e) { e.printStackTrace(); } mBitmap =Bitmap.createBitmap(w.getWidth(), w.getHeight (),Config.ARGB_); mCanvas.drawBitmap(mBitmap, 0, 0, null); if(mBitmap!= null) { mByteArrayOpStream = new ByteArrayOutputStream(); mBitmap.compress(Bitmap.CompressFormat.JPEG, 90, mByteArrayOpStream); try { fos = openFileOutput(yahoo.jpg, MODE_WORLD_WRITEABLE); fos.write(mByteArrayOpStream.toByteArray()); fos.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) {
[android-developers] Re: (unofficial) Bluetooth API v. 0.2
You may want to update the project summary, which currently says This library does to require a rooted device: it is intended to work with standard firmware provided by phone manufacturer. I think you want it to say it Does NOT require a rooted device... Steve On Mon, Sep 7, 2009 at 11:51 AM, Stefano Sanna gerda...@gmail.com wrote: Hi all. I've just published an update version (0.2) of the (unofficial) Bluetooth API for Android 1.1 and 1.5. Library source code, binaries and Javadoc have been published under Apache 2.0 License at: http://code.google.com/p/android-bluetooth/ New version includes: basic SDP, RemoteDevice signal level (RSSI) fixed, I/O stream close fixed. Features already implemented on first release are localBluetooth service enabling/disabling, remote device discovery and support for RFCOMM client connections. This release has been tested on HTC Dream, HTC Magic and Samsung Galaxy. As already highlighted on this list, the API uses Java Reflection: therefore, it is not guaranteed that it will work on future releases of Android. Have fun with Android and Bluetooth! Ciao, Stefano PS: old name of project was Experimental Bluetooth Library, which was hard to find on Google, since most people use Bluetooth API as key... -- Stefano Sanna gerda...@gmail.com (Skype: gerdavax) Personal blog: http://www.gerdavax.it Linkedin profile: http://www.linkedin.com/in/gerdavax QuadraSpace Project: http://www.quadraspace.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 change width of a SeekBar?
How to change width of a SeekBar? Below is a TableRow with two items in it, a Button and a SeekBar. How can the SeekBar be made to extend its right side to fill in the remaining width of the TableRow? Currently I have only been able to control the SeekBar width by setting it’s android:layout_width attribute. Is there a way to have the LayoutManager do this automatically or can it be done programmatically? It is especially noticeable when the Orientation is changed from vertical to horizontal and the SeekBar remain stuck way over there on the left with available real estate on its right :-) Thank you! Here is the TableLayout portion of the layout XML: TableLayout android:id=@+id/SeekBarTable android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=vertical TableRow android:id=@+id/SeekBarRow android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=horizontal Button android:id=@+id/CLRButton android:layout_width=wrap_content android:layout_height=wrap_content android:text=CLR /Button SeekBar android:id=@+id/SeekBar android:max=29 android:layout_width=250dip android:layout_marginTop=10dip android:layout_marginLeft=5dip /SeekBar /TableRow /TableLayout --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to change width of a SeekBar?
WoodManEXP wrote: Below is a TableRow with two items in it, a Button and a SeekBar. How can the SeekBar be made to extend its right side to fill in the remaining width of the TableRow? Currently I have only been able to control the SeekBar width by setting it’s android:layout_width attribute. android:layout_width=fill_parent doesn't work? I'm also not quite sure what you're gaining by the single-row, single-column TableLayout -- if that is all that will be in the layout, you are better served using just a horizontal LinearLayout. -- 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: InstrumentationTestRunner not specified ??
OK, I'll place that inside the application tag. The XML looks like this now. Can you tell if the other things in there are placed correctly? Thank you! ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.MyApp android:versionCode=1 android:versionName=1.3 application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.MyApp android:label=@string/app_name intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity uses-library android:name=android.test.runner / /application uses-sdk android:minSdkVersion=3 / instrumentation android:name=android.test.InstrumentationTestRunner android:targetPackage=com.MyApp android:label=MyApp / uses-permission android:name=android.permission.INTERNET/uses- permission /manifest --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to change width of a SeekBar?
I thought fill_parent would have worked as well but whenever it is set to that the SeekBar is very narrrow (maybe 40-50 pixels wide). BTW: No matter what kind of layout I have tried (Table, horizontal LinearLayout, etc...) the SeekBar behaves the same way. Unless I specify its width it is drawn very narrow. Is there another way to change its width? Thank you! On Sep 10, 11:49 am, Mark Murphy mmur...@commonsware.com wrote: WoodManEXP wrote: Below is a TableRow with two items in it, a Button and a SeekBar. How can the SeekBar be made to extend its right side to fill in the remaining width of the TableRow? Currently I have only been able to control the SeekBar width by setting it’s android:layout_width attribute. android:layout_width=fill_parent doesn't work? I'm also not quite sure what you're gaining by the single-row, single-column TableLayout -- if that is all that will be in the layout, you are better served using just a horizontal LinearLayout. -- 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: Best practices for handling passwords/keys in open source projects?
I'm not using Ant, and I'm not familiar with it at all. I'm using the regular Eclipse + SDK approach, and I'd like to stick with that. This API key also isn't used in a MapView (it's not for the Google Maps API), so I need a general sort of solution. Isn't there any way, using the Eclipse Android Toolkit, to make some sort of keys.xml file and have it available in like, R.keys or the like? It doesn't have to be that, either - as long as I can have all of the private strings in their own file, it works for me. I could just include a completely flat file and have the app read it in manually during operation, but that seems like the wrong way to do it. -- Eric On Sep 9, 4:09 pm, Mark Murphy mmur...@commonsware.com wrote: Eric Mill wrote: In my app, I'm taking advantage of a web-based API (the Sunlight Labs API) that requires an API Key. The project is also open source, hosted on Github. I want to avoid committing my API key into the codebase. I'd be fine with creating some other .xml file of special string values, and git-ignoring that file (while providing a .xml.example file to copy into its place), but I don't know the best way of doing that with the Android SDK. Any suggestions? Total brainstorm, never tried this, your kilometerage may vary, etc. It also assumes you're using Ant... Step #1: Put the layout file containing the MapView element that needs the API key somewhere other than res/layout/ (e.g., make a layout-template/ directory and put it there). Step #2: Create an Ant target that reads in a property file and uses copy and replaceregexp tasks to paste the API key out of the property file into a copy of the layout you make in the proper spot (e.g., copy from layout-template/ to res/layout/ and then paste in the key). Step #3: git-ignore the post-API-key edition of the layout file and your property file. Step #4: Possibly have your Ant target turn around and call some other target (e.g., the debug target). Side benefit of this: you can have two targets and two property files, one for debug and one for production. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _The Busy Coders' Guide to *Advanced* Android Development_ In Print! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---