[android-developers] Re: sqlite3?
use the path: /data/data/com.android.providers.settings/databases/ adb pull /data/data/com.android.providers.settings/databases/settings.db settings.db --- On Aug 25, 7:18 am, Anjan [EMAIL PROTECTED] wrote: I run command adb pull /data/data/com.google.android.providers.settings/databases/settings.db C:\Android i get error remote object /data/data/com.google.android.providers.settings/ databases/settings.db does not exists... On Aug 21, 3:51 pm, Mark Murphy [EMAIL PROTECTED] wrote: shan wrote: I need to access the system table in data/data/ com.android.providers.settings/databases/settings.db in the adb shell. I had earlier did this in the m5 to insert the 'http_proxy' field, but now i can't invokesqlite3from the adb shell. Please assist. Use adb pull (or the equivalent IDE action) to download your SQLite database to your development machine. Then use any SQLite client you want (sqlite3console app, SQLite Manager Firefox extension, etc.). If you make changes you want reflected on the phone, use adb push (or the equivalent IDE action) to put the database back on the phone. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.1 Published! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Creating a Dialog Activity with default OK and Cancel buttons
Hi, If you want an alert that looks like a dialog, you can use andoid:theme=@android:style/Theme.Dialog in your manifest. There is an example in API demos for doing this. If you are specifically looking for the functionality of AlertDialog in an activity, unfortunately for 1.0 we are not going to have time to implement this. On Aug 22, 9:36 am, webmonkey [EMAIL PROTECTED] wrote: How do I create a dialog activity that looks exactly the same as when you build a dialog with the AlertDialog class, including the buttons panel at the bottom. Basically, I want the same sort of activity that you get when you add a Bookmark in the Browser app. I checked the APIDemos Activity Dialog sample but it is missing the panel with the buttons. 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 [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: alwaysRetainTaskState - Some questions
What are you actually trying to do? I doubt this parameter is what you want -- it is used to defeat the default behavior of resetting an application's task state after the device has been asleep for a certain amount of time. That is, it will have -no- impact on the behavior of your application unless you put the emulator to sleep for that amount of time (I believe 30 minutes) and then launch it from home. If you are -always- returning back the initial screen of your app when returning from home, that indicates some other problem in how you have structure your app. This might be useful information to help understand what is going on: http://code.google.com/android/intro/appmodel.html Some common things to watch out for: - Don't use android:singleTask (unless you understand what that is and really actually do want everything it implies). - Don't use Intent.FLAG_ACTIVITY_NEW_TASK (unless you understand what that is and really actually do want everything it implies). The above referenced doc has information on these as well. On Aug 22, 6:05 am, code_android_festival_way [EMAIL PROTECTED] wrote: I came across the parameter alwaysRetainTaskState athttp://code.google.com/android/reference/android/R.attr.html#alwaysRe... and don't really know how to use it the right way. I've got several activities in my application and want to persist the state of my activity UI so that the user can press the home button and after starting my application again he will come back to the last opened activity. When I understand the parameter in the right way I think that he should do what I want. Now I've added the parameter to all activities in my AndroidManifest but after restarting my application from the home screen (after pressing the home button in my app) I'm always getting back to my initial screen. Here is one sample from my AndroidManifest: activity android:name=.Preferences android:alwaysRetainTaskState=true /activity What am I doing wrong? In addition I'd like to ask what state in detail will be presisted. (the complete UI state?) Regards! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to display a local file in the browser?
Why does this limit exists? If one wants to display html-code that has been fetched to view ONCE, this html-code has to be written in a content provider? On Aug 24, 12:49 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: So, creating a content provider, which returns the same content of the file, would be accessed by loadUrl from webview, without any url filtering? Such as, for example... content://my.mailclient/231 Should retrieve the content of file 231.html: content provider acts as webserver. Is it right? On 24 Ago, 00:07, Megha Joshi [EMAIL PROTECTED] wrote: In that case you should use the content provider option mentioned earlier...Using a content provider would allow images as the content provider would be used for image loading too. Another alternative is to put the image inline, using the data:// scheme. On Fri, Aug 22, 2008 at 4:47 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I already done that but there's another limit: data rendered via loadData arenotable to load remote resources (img src=http://...;). On 21 Ago, 22:21, Megha Joshi [EMAIL PROTECTED] wrote: On Wed, Aug 20, 2008 at 4:46 PM, Megha Joshi [EMAIL PROTECTED] wrote: For security reasons, WebView doesnotallow file: access any more. If you want the link to be loaded in your activity, you should provide a WebViewClient and implement shouldOverrideUrlLoading with { return false; } This option doesnotwork anymore, sorry for the confusion! So the only way to load local file contents into WebView, is as Gil pointed out ...by loading the contents with loadData()/ Sample code: static final int MAXFILESIZE = 8096; String path = uri.getPath(); File f = new File(path); final long length = f.length(); if (!f.exists() || length MAXFILESIZE) { return; } // typecast to int is safe as long as MAXFILESIZE MAXINT byte[] array = new byte[(int)length]; try { InputStream is = new FileInputStream(f); is.read(array); is.close(); } catch (FileNotFoundException ex) { // Checked for file existance already, so this shouldnot happen return; } catch (IOException ex) { // read or close failed Log.e(LOGTAG, Failed to access file: + path, ex); return; } mWebView.loadData(new String(array), mimeType, null); There is a 8KB limit on the file size. So if your data is more that 8KB, you should create a content provider for your files and then the use the ContentResolver.openContentURI()... On Wed, Aug 20, 2008 at 4:34 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I used WebView to display rich content emails (I'm writing a mail client). It worked well loading URI such as file://sdcard/filewhateveryouwant.xxx ... Now I upgraded to 0.9 and Android OS is displaying me apagewith The requested file wasnotfound. Maybe a PERMISSION issue? On 19 Ago, 20:36, Megha Joshi [EMAIL PROTECTED] wrote: Browser doesnotsupport viewing local files... On Tue, Aug 19, 2008 at 12:38 AM, Peli [EMAIL PROTECTED] wrote: Is it possible to open a local file in the browser? In the Android browser, I tried menu / go to: file:///sdcard/test.html I always receive the error message: Webpagenotavailable. Thewebpageat file:///sdcard/test.html couldnotbe loaded as: The requested file wasnotfound. even though the files exist in /sdcard/test.html. Do I have to use a different URL, or put files into a different folder? Peli PS: From within an application, there seems to be a way to load local files: The prefix file:///android_asset/ will cause WebView to load content from the current application's assets folder. http://code.google.com/android/reference/android/webkit/WebView.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 [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: java.net.SocketException: unknown error
oh thks! i'll try it :) On Aug 25, 2:49 am, dai [EMAIL PROTECTED] wrote: Did you add uses-permission android:name=android.permission.INTERNET / to your manifest? This tag is mandatory for beta 0.9 version. Without it, you could not connect to the internet. On 8月25日, 午前9:30, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I try to consume my soap webservice writted with cxf apache. Java client works fine and now, i want to create android client. I found a sample =http://groups.google.com/group/android-developers/browse_thread/threa... And i try to update it to work with the last android sdk version. (0.9 beta) So i decided to use ksoap2 snapshot + SE extension and write a sample.. the source code : public class Adder extends Activity { private static final String SOAP_ACTION = RegistrationService; private static final String METHOD_NAME = register; private static final String NAMESPACE = http:// unknown.namespace; private static final String URL = http://192.168.0.5:8080/poker- flex/ws/RegistrationService?wsdl; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); findViewById(R.id.cmdCalculate).setOnClickListener(new OnClickListener() { public void onClick(View view) { ((TextView)findViewById(R.id.lblStatus)).setText(... Invoking Web Service ...); SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.setOutputSoapObject(request); Transport androidHttpTransport = new HttpTransportSE (URL); try { androidHttpTransport.call(SOAP_ACTION, envelope); Object result = envelope.bodyIn; ((TextView)findViewById(R.id.lblStatus)).setText(result.toString()); } catch(Throwable E) { ((TextView)findViewById(R.id.lblStatus)).setText(ERROR: + E.getClass().getName() + : + E.getMessage()); } } }); } } but I have an exception during calling androidHttpTransport.call(SOAP_ACTION, envelope); at the line 68 from the file HttpTransportSE.java connection.connect(); = java.net.SocketException: unknown error someone use successfully cxf and android client? :-/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: sqlite3?
I run command adb pull /data/data/com.google.android.providers.settings/databases/settings.db C:\Android i get error remote object /data/data/com.google.android.providers.settings/ databases/settings.db does not exists... On Aug 21, 3:51 pm, Mark Murphy [EMAIL PROTECTED] wrote: shan wrote: I need to access the system table in data/data/ com.android.providers.settings/databases/settings.db in the adb shell. I had earlier did this in the m5 to insert the 'http_proxy' field, but now i can't invokesqlite3from the adb shell. Please assist. Use adb pull (or the equivalent IDE action) to download your SQLite database to your development machine. Then use any SQLite client you want (sqlite3console app, SQLite Manager Firefox extension, etc.). If you make changes you want reflected on the phone, use adb push (or the equivalent IDE action) to put the database back on the phone. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.1 Published! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: MapView and Zoom Control in 0.9 SDK
Guys you are lucky, I even can't display zoom control :-) and I can't drag my map ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: MapView and Zoom Control in 0.9 SDK
I correct myself, I can display but it disapears... actually I will try to implement one onLongClickListener. The method displayZoomControls displays temporary the controls. It is good but I need to implement onLongClickListener to fit the standard map application behaviour. Rgds, On Aug 25, 10:10 am, 6real [EMAIL PROTECTED] wrote: Guys you are lucky, I even can't display zoom control :-) and I can'tdragmymap... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android JNI
On Aug 22, 9:30 pm, Tyler Ernst [EMAIL PROTECTED] wrote: Also since the 0.9 beta has been released I have been unable to copy the .so to the /system/lib directory of the emulator. If anyone has found a way to do this that would be greatly appreciated. Hi, you have to mount the system rw. To do so run `adb remount` before you push your .so. And keep in mind JNI will not be supported, or did you find a way to deploy your native lib with a .apk? Volker Gropp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Question to Android team
Hi, My application needs TTS (text to speech). I don't see any news about that. My question : Do you plan to (on day) add this API in Android (emulator devices) ? Or is it better (and faster) to develop (port) it myself (on the emulator !) Could you give me some help/links in order to do that ? (I've tried FreeTTS, but there are too many stuff to comment/adapt, and even on a PC, the voice quality is not very good) Do you have some other links ? 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 [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] unsubscribe
--~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Does 0.9-SDK support Camera feature now??
any anwser @@? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] java.net.SocketException: unknown error
Hi, I try to consume my soap webservice writted with cxf apache. Java client works fine and now, i want to create android client. I found a sample = http://groups.google.com/group/android-developers/browse_thread/thread/9b246db7d612a6b5/ And i try to update it to work with the last android sdk version. (0.9 beta) So i decided to use ksoap2 snapshot + SE extension and write a sample.. the source code : public class Adder extends Activity { private static final String SOAP_ACTION = RegistrationService; private static final String METHOD_NAME = register; private static final String NAMESPACE = http:// unknown.namespace; private static final String URL = http://192.168.0.5:8080/poker- flex/ws/RegistrationService?wsdl; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); findViewById(R.id.cmdCalculate).setOnClickListener(new OnClickListener() { public void onClick(View view) { ((TextView)findViewById(R.id.lblStatus)).setText(... Invoking Web Service ...); SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.setOutputSoapObject(request); Transport androidHttpTransport = new HttpTransportSE (URL); try { androidHttpTransport.call(SOAP_ACTION, envelope); Object result = envelope.bodyIn; ((TextView)findViewById(R.id.lblStatus)).setText(result.toString()); } catch(Throwable E) { ((TextView)findViewById(R.id.lblStatus)).setText(ERROR: + E.getClass().getName() + : + E.getMessage()); } } }); } } but I have an exception during calling androidHttpTransport.call(SOAP_ACTION, envelope); at the line 68 from the file HttpTransportSE.java connection.connect(); = java.net.SocketException: unknown error someone use successfully cxf and android client? :-/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Question to Android team
Nanard wrote: My application needs TTS (text to speech). I don't see any news about that. There was a post in this discussion group about it, three days ago: http://tinyurl.com/6l59t8 In short, there is a new open source TTS project for Android, apparently based on FreeTTS: http://code.google.com/p/android-text2speech/ I have no idea how far the authors have gotten. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.1 Published! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: MapView and Zoom Control in 0.9 SDK
My issues : - Can't display the zoom control dialog after a long click. I called the longclickable method and implemented an onlongclicklistener. The onlongclick method is never called. - Can't drag the map. It open the map and i am unable to move it as in the standard map application. I try your Solution Jokochi and the onInterceptTouchEvent method is called but the map never move. So if someone knows where to find the standard map application source code ! It could be relevant to provide it there :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: DateUtils.getRelativeTimeSpanString in v0.9
Old DateFormat and DateUtils classes are still available in the hidden package android.pim, hope these classes become public again... On 22 août, 12:18, Guillaume Perrot [EMAIL PROTECTED] wrote: In Android SDK v0.9, theDateUtilsclass has been removed. Where is the equivalent to format relative dates ? The function was getRelativeTimeSpanString, I hope I don't have to code it myself. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Text2Speech now hosted at google code
Great idea ! I have no time to help you on this port (or for easy/fast stuff : it's OK). And : I also don't know any thing about speech/sound/grammar/... on this topic. But I will be pleased to test all versions of it :-) My project (for ADC I), is a document speaker. I really needs TTS. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Destroying a view
Yes the method removeView is there for that purpose. The garbage collector manage the memory. Rgds, On Aug 25, 9:42 am, Teo [EMAIL PROTECTED] wrote: Is it possible to destroy a view and recreate it? I'm looking into this as a workaround for TabHost's inability to delete tabs (properly). Thanks, Teo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Unable to display maps in API Demo
Hi guys, I can't play with the MapView in API Demo. I just have a blue sky screen and LogCat returns the folowing : 08-25 13:19:32.578: INFO/ActivityManager(45): Starting activity: Intent { comp={com.android.samples/ com.android.samples.view.MapViewDemo} } 08-25 13:19:32.618: WARN/MapActivity(261): Replacing old dispatcher [EMAIL PROTECTED] 08-25 13:19:32.649: VERBOSE/MapActivity(261): Recycling map object. 08-25 13:19:32.718: INFO/MapActivity(261): Handling network change notification:CONNECTED 08-25 13:19:32.718: ERROR/MapActivity(261): Couldn't get connection factory client 08-25 13:19:32.828: INFO/ActivityManager(45): Displayed activity com.android.samples/.view.MapViewDemo: 249 ms The standard maps application works fine ! Does anyone understand the error Couldn't get connection factory client ? I have the same error in my app. Thanks for tour help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: sqlite3?
Thanks for the information..it worked.. another hurdle 1. I download system.db to local 2. edit to add entry (99,'http_proxy','proxy:'); 3. Upload system.db back to device. but i could not run the browser successfully (i am expecting http://www.google.com/ to show up on device). i also tried step 2 above with IP address of the proxy. could you please support me getting access to internet on device. thanks. On Aug 25, 11:50 am, Yalcin [EMAIL PROTECTED] wrote: use the path: /data/data/com.android.providers.settings/databases/ adb pull /data/data/com.android.providers.settings/databases/settings.db settings.db --- On Aug 25, 7:18 am, Anjan [EMAIL PROTECTED] wrote: I run command adb pull /data/data/com.google.android.providers.settings/databases/settings.db C:\Android i get error remote object /data/data/com.google.android.providers.settings/ databases/settings.db does not exists... On Aug 21, 3:51 pm, Mark Murphy [EMAIL PROTECTED] wrote: shan wrote: I need to access the system table in data/data/ com.android.providers.settings/databases/settings.db in the adb shell. I had earlier did this in the m5 to insert the 'http_proxy' field, but now i can't invokesqlite3from the adb shell. Please assist. Use adb pull (or the equivalent IDE action) to download your SQLite database to your development machine. Then use any SQLite client you want (sqlite3console app, SQLite Manager Firefox extension, etc.). If you make changes you want reflected on the phone, use adb push (or the equivalent IDE action) to put the database back on the phone. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.1 Published!- 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 [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Destroying a view
Yes but that removes a child view, doesn't it? And this view i want to remove (the TabHost object) isn't really a child of another view, it's the first thing in the base LinearLayout. I've also tried with getParent() and casting to LinearLayout but that gives me an error. Here's my code below: if (tabs!=null){ ((LinearLayout)(tabs.getParent())).removeView(tabs); } tabs=(TabHost)findViewById(R.id.tabhost); tabs.setup(); // i want to be able to call this again and again //because it's in onResume() and the XML: ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent TabHost android:id=@+id/tabhost android:layout_width=fill_parent android:layout_height=fill_parent TabWidget android:id=@android:id/tabs android:layout_width=fill_parent android:layout_height=wrap_content / FrameLayout android:id=@android:id/tabcontent android:layout_width=fill_parent android:layout_height=fill_parent android:paddingTop=62px /FrameLayout /TabHost /LinearLayout Basically all i want is to be able to get a fresh, new TabHost object instead of the old one.. Thanks for the help, Teo On Mon, Aug 25, 2008 at 3:58 PM, 6real [EMAIL PROTECTED] wrote: Yes the method removeView is there for that purpose. The garbage collector manage the memory. Rgds, On Aug 25, 9:42 am, Teo [EMAIL PROTECTED] wrote: Is it possible to destroy a view and recreate it? I'm looking into this as a workaround for TabHost's inability to delete tabs (properly). Thanks, Teo -- Teo (a.k.a. Teodor Filimon, Teominator) Site - www.teodorfilimon.com | Blog - www.teodorfilimon.blogspot.com GMT +2 (or PDT +10) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Internet access in emulator
Hi, with below inputs i could cross a hurdle but i am still struck in getting accessing internet on device. 1. I downloaded settings.db 2. Edited to add entry in system table (99,'http_proxy','proxy:') // here is port number 3. uploaded to device via adb push i still not able to access the net.. use the proxy in my local browser as http://proxy:/ could you please help me getting access to net on device... thanks On Aug 25, 11:50 am, Yalcin [EMAIL PROTECTED] wrote: use the path: /data/data/com.android.providers.settings/databases/ adb pull /data/data/com.android.providers.settings/databases/settings.db settings.db --- On Aug 25, 7:18 am, Anjan [EMAIL PROTECTED] wrote: I run command adb pull /data/data/com.google.android.providers.settings/databases/settings.db C:\Android i get error remote object /data/data/com.google.android.providers.settings/ databases/settings.db does not exists... On Aug 21, 3:51 pm, Mark Murphy [EMAIL PROTECTED] wrote: shan wrote: I need to access the system table in data/data/ com.android.providers.settings/databases/settings.db in the adb shell. I had earlier did this in the m5 to insert the 'http_proxy' field, but now i can't invokesqlite3from the adb shell. Please assist. Use adb pull (or the equivalent IDE action) to download your SQLite database to your development machine. Then use any SQLite client you want (sqlite3console app, SQLite Manager Firefox extension, etc.). If you make changes you want reflected on the phone, use adb push (or the equivalent IDE action) to put the database back on the phone. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.1 Published!- 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 [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Trouble with 0.9 beta and MapActivity
How are you trying to register touches? Are you using Overlay's and overriding the onTap / onTouchEvent methods? On Aug 23, 4:50 am, Casey Borders [EMAIL PROTECTED] wrote: Now I am having another weird problem. If I define the MapView in a layout xml file, everything works like you would expect. If I create it programmatically like I show above, then it doesn't register touches. Any idea what's up with that? On Fri, Aug 22, 2008 at 3:20 AM, Casey Borders [EMAIL PROTECTED] wrote: That did it!! Thank you!! On Fri, Aug 22, 2008 at 3:05 AM, woodm [EMAIL PROTECTED] wrote: I was having this same problem yesterday but managed to solve it. It's just a case of fixing your AndroidManifest.xml file. It needs to use the correct permissions and contain a uses-library android:name=com.google.android.maps / tag. This post: http://groups.google.com/group/android-developers/browse_thread/threa... was a great help to me, and shows the permissions you need to use. On Aug 22, 6:45 am, Casey Borders [EMAIL PROTECTED] wrote: I have and application that was running fine under m5, but it fails in 0.9. I tried to nail down what was causing it to fail and I have an extremely simple MapActivity that is failing too. Here's the code: package org.moo.android.Test; import com.google.android.maps.MapActivity; import com.google.android.maps.MapView; import android.os.Bundle; import android.view.Window; public class MapTest extends MapActivity { private MapView mMap; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); requestWindowFeature(Window.FEATURE_NO_TITLE); mMap = new MapView(this, MapAPIKey); setContentView(mMap); } @Override protected boolean isRouteDisplayed() { return false; } } Here's the logcat output: 08-22 05:36:30.274: WARN/dalvikvm(263): Unable to resolve superclass of Lorg/moo/android/Test/MapTest; (4) 08-22 05:36:30.284: WARN/dalvikvm(263): Link of class 'Lorg/moo/android/Test/MapTest;' failed 08-22 05:36:30.294: DEBUG/AndroidRuntime(263): Shutting down VM 08-22 05:36:30.304: WARN/dalvikvm(263): threadid=3: thread exiting with uncaught exception (group=0x40010e28) 08-22 05:36:30.304: ERROR/AndroidRuntime(263): Uncaught handler: thread main exiting due to uncaught exception 08-22 05:36:30.334: ERROR/AndroidRuntime(263): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.moo.android.Test/org.moo.android.Test.MapTest}: java.lang.ClassNotFoundException: org.moo.android.Test.MapTest in loader [EMAIL PROTECTED] 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2060) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2147) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at android.app.ActivityThread.access$1800(ActivityThread.java:112) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1572) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at android.os.Handler.dispatchMessage(Handler.java:88) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at android.os.Looper.loop(Looper.java:123) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at android.app.ActivityThread.main(ActivityThread.java:3708) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at java.lang.reflect.Method.invokeNative(Native Method) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at java.lang.reflect.Method.invoke(Method.java:492) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:734) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:492) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at dalvik.system.NativeStart.main(Native Method) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): Caused by: java.lang.ClassNotFoundException: org.moo.android.Test.MapTest in loader [EMAIL PROTECTED] 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:215) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at java.lang.ClassLoader.loadClass(ClassLoader.java:453) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at java.lang.ClassLoader.loadClass(ClassLoader.java:421) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at android.app.Instrumentation.newActivity(Instrumentation.java:1095) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2052) 08-22 05:36:30.334: ERROR/AndroidRuntime(263): ... 11 more 08-22 05:36:30.364: INFO/Process(51): Sending signal.
[android-developers] Re: Creating a Dialog Activity with default OK and Cancel buttons
Hello Hackbod, I indeed looked at the API demo you refer to, but I want to get the same type of buttons panel at the bottom so that I am consistent with the overall platform. The look of the dialog and the panel at the bottom has changed a couple of times, and by using AlertDialog I don't have to worry about any future changes. Plus, I don't have to build everything myself. My solution right now is to use an activity with a transparent theme and then call showDialog in onCreate. This way I can still use AlertDialog. It now works like the Edit Bookmarks activity behaviour I was looking for. It would of course be better to have an activity that you can style like an AlertDialog. I have looked at the classes com.android.internal.app.AlertActivity and com.android.internal.app.AlertController which seem to do what I want, but I obviously cannot use them. Hope you will make these public in the future. On Aug 25, 9:03 am, hackbod [EMAIL PROTECTED] wrote: Hi, If you want an alert that looks like a dialog, you can use andoid:theme=@android:style/Theme.Dialog in your manifest. There is an example in API demos for doing this. If you are specifically looking for the functionality of AlertDialog in an activity, unfortunately for 1.0 we are not going to have time to implement this. On Aug 22, 9:36 am, webmonkey [EMAIL PROTECTED] wrote: How do I create a dialog activity that looks exactly the same as when you build a dialog with the AlertDialog class, including the buttons panel at the bottom. Basically, I want the same sort of activity that you get when you add a Bookmark in the Browser app. I checked the APIDemos Activity Dialog sample but it is missing the panel with the buttons. Thanks- 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 [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: alwaysRetainTaskState - Some questions
I have the same problem but I can solve it temporarily doing a clean restart: using Windows XP that is: 1. Closing Eclipse. 2. Clearing the folder C:\Documents and Settings\username\Local Settings\Application Data\Android 3. Starting Eclipse and running my App. (Clearing using just wipe-data does not seem to work) It will now work great and I get the expected behavior where the app goes back to activity that you had when you pressed Home. But as soon a I re-run the app in Eclipse (even without code changes) it will always go back to the main launch activity after pressing Home. I won't get the expected behavior again until I do another clean restart. I have no unusual settings in my AndroidManifest.xml and because it fully works after a restart I assume it is an Eclipse/Emulator thing. Sometimes after the re-run I also get this message in the console: [2008-08-25 15:02:09 - myApp] Re-installation failed due to different application signatures. [2008-08-25 15:02:09 - myApp] You must perform a full uninstall of the application. WARNING: This will remove the application data! [2008-08-25 15:02:09 - myApp] Please execute 'adb uninstall com.mycompany.myApp' in a shell. On Aug 25, 10:05 am, code_android_festival_way [EMAIL PROTECTED] wrote: Some information about my application (simplified): startActivty (user can choose which kind of kontent he wants to post in his blog) - some activity to input some data (let me call ist content activity) - service gets started and does some work (posting the blogpost, working with some web apis) What I actually wanted achieve is that when the user clicks on the Home button while he is at the content activity and restarts the application afterwards he should be brought back to the content activity. At the moment the following happens regarding to tasks: Starting the app: The first activty (MAIN) has Task ID 7 Starting another activity from my MAIN screen: The started activity has Task ID 7 Clicking the HOME button and restarting my application: MAIN activity gets started with Task ID 7 So the application remains in the same task but doesn't get back to the last opened activity before leaving the app to the home screen. I have never set any flags like the two you mentioned above. Do I have to control that by myself (monitoring where I am in the chain of activities that the user starts and restart the activity in my initial screen) or is there some flag? I can't find that out from the app model document. Regards! On 25 Aug., 09:16, hackbod [EMAIL PROTECTED] wrote: What are you actually trying to do? I doubt this parameter is what you want -- it is used to defeat the default behavior of resetting an application's task state after the device has been asleep for a certain amount of time. That is, it will have -no- impact on the behavior of your application unless you put the emulator to sleep for that amount of time (I believe 30 minutes) and then launch it from home. If you are -always- returning back the initial screen of your app when returning from home, that indicates some other problem in how you have structure your app. This might be useful information to help understand what is going on:http://code.google.com/android/intro/appmodel.html Some common things to watch out for: - Don't use android:singleTask (unless you understand what that is and really actually do want everything it implies). - Don't use Intent.FLAG_ACTIVITY_NEW_TASK (unless you understand what that is and really actually do want everything it implies). The above referenced doc has information on these as well. On Aug 22, 6:05 am, code_android_festival_way [EMAIL PROTECTED] wrote: I came across the parameter alwaysRetainTaskState athttp://code.google.com/android/reference/android/R.attr.html#alwaysRe... and don't really know how to use it the right way. I've got several activities in my application and want to persist the state of my activity UI so that the user can press the home button and after starting my application again he will come back to the last opened activity. When I understand the parameter in the right way I think that he should do what I want. Now I've added the parameter to all activities in my AndroidManifest but after restarting my application from the home screen (after pressing the home button in my app) I'm always getting back to my initial screen. Here is one sample from my AndroidManifest: activity android:name=.Preferences android:alwaysRetainTaskState=true /activity What am I doing wrong? In addition I'd like to ask what state in detail will be presisted. (the complete UI state?) Regards!- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To
[android-developers] Re: Inconsistent usage of setResult(..) Intent.
Same here! I suggest that you follow the guide on http://code.google.com/android/intro/upgrading.html to check your code... Regards, Luciano On Thu, Aug 21, 2008 at 2:22 AM, Spencer Riddering [EMAIL PROTECTED]wrote: It appears that the example applications from version 0.9 and the migration tips are not consistent in their usage of the Intent that is passed to setResult(..) Example: From ReceiveResults.java in ApiDemos: setResult(RESULT_OK, (new Intent()).setAction(Corky!)); and setResult(RESULT_OK, (new Intent()).setAction(Violet!)); From NoteEditor.java in NotePad: setResult(RESULT_OK, (new Intent()).setAction(mUri.toString())); From NotesList.java in NotePad: setResult(RESULT_OK, new Intent().setData(uri)); From M5 to 0.9 porting and migration tips: Bundle bundle = new Bundle(); bundle.putString(TEST_STRING, Corky!); Intent mIntent = new Intent(); mIntent.putExtras(bundle); setResult(RESULT_OK, mIntent); I believe that the NotesList.java is the only one which does it correctly. I'm not sure why M5 to 0.9 porting and migration tips bothers with the Bundle. Isn't it more straight forward to just call mIntent.putExtra(TEST_STRING, Corky!); ? I think that ReceiveResults.java should have also called putExtra(..): setResult(RESULT_OK, (new Intent()).putExtra(NAME, Violet!)); NoteEditor.java should have used putExtra(..): setResult(RESULT_OK, (new Intent()).putExtra(NAME, mUri.toString())); or better yet, it should have used the setData(..) method: setResult(RESULT_OK, (new Intent()).setData(mUri)); Many of these inconsistent usages stem from attempting to replace the setResult(..) String parameter with the setAction(..) method's String. IMHO, this hijacking of setAction(..) corrupts the clear purpose of the Action String and so should be avoided. Do I have it right? Am I missing something? I'm interested in other people's take on this ambiguity because I see it as an impediment to seamless integration between applications. Originally blogged at: http://spencer.riddering.net/2008/8/21/inconsistent-usage-setresult-intent -- Luciano --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Inconsistent usage of setResult(..) Intent.
UPDATE: Sorry Spencer... I didn't read the From M5 to 0.9 porting and migration tips: from your e-mail... But... well.. I have the same problem here... Any news is appreciated... Regards, Luciano On Mon, Aug 25, 2008 at 11:12 AM, Luciano Ricardi [EMAIL PROTECTED] wrote: Same here! I suggest that you follow the guide on http://code.google.com/android/intro/upgrading.html to check your code... Regards, Luciano On Thu, Aug 21, 2008 at 2:22 AM, Spencer Riddering [EMAIL PROTECTED] wrote: It appears that the example applications from version 0.9 and the migration tips are not consistent in their usage of the Intent that is passed to setResult(..) Example: From ReceiveResults.java in ApiDemos: setResult(RESULT_OK, (new Intent()).setAction(Corky!)); and setResult(RESULT_OK, (new Intent()).setAction(Violet!)); From NoteEditor.java in NotePad: setResult(RESULT_OK, (new Intent()).setAction(mUri.toString())); From NotesList.java in NotePad: setResult(RESULT_OK, new Intent().setData(uri)); From M5 to 0.9 porting and migration tips: Bundle bundle = new Bundle(); bundle.putString(TEST_STRING, Corky!); Intent mIntent = new Intent(); mIntent.putExtras(bundle); setResult(RESULT_OK, mIntent); I believe that the NotesList.java is the only one which does it correctly. I'm not sure why M5 to 0.9 porting and migration tips bothers with the Bundle. Isn't it more straight forward to just call mIntent.putExtra(TEST_STRING, Corky!); ? I think that ReceiveResults.java should have also called putExtra(..): setResult(RESULT_OK, (new Intent()).putExtra(NAME, Violet!)); NoteEditor.java should have used putExtra(..): setResult(RESULT_OK, (new Intent()).putExtra(NAME, mUri.toString())); or better yet, it should have used the setData(..) method: setResult(RESULT_OK, (new Intent()).setData(mUri)); Many of these inconsistent usages stem from attempting to replace the setResult(..) String parameter with the setAction(..) method's String. IMHO, this hijacking of setAction(..) corrupts the clear purpose of the Action String and so should be avoided. Do I have it right? Am I missing something? I'm interested in other people's take on this ambiguity because I see it as an impediment to seamless integration between applications. Originally blogged at: http://spencer.riddering.net/2008/8/21/inconsistent-usage-setresult-intent -- Luciano -- Luciano --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Feature Suggestion: Maps caching
Hi, I would like to see the maps application to be able to cache all tiles required to navigate a calculated route from start to finish. Additionally, the user should be able to set a custom distance from his/her designated route that should also be covered by the cache (detours, camping-stays etc.). That way its possible to use maps on route without a permanent WiFi/3G- connection (especially for people going abroad). Nils --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: MapView and Zoom Control in 0.9 SDK
Hi. I'm so sorry for my code to confuse all of you. This is the shortest sample. /* BEGIN --*/ /*-- ZoomControlMapSample.java ---*/ public class ZoomControlMapSample extends MapActivity { private static final String API_KEY = mapapikey; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MapView zmv = new ZoomMapView(this, API_KEY); setContentView(zmv); } @Override protected boolean isRouteDisplayed() { return false; } } /*-- ZoomMapView.java ---*/ public class ZoomMapView extends MapView implements OnLongClickListener { private static final int FILL = ViewGroup.LayoutParams.FILL_PARENT; public ZoomMapView(Context context, String apiKey) { super(context, apiKey); // long click settings. setClickable(true); setLongClickable(true); setOnLongClickListener(this); // ZoomControls settings. ZoomControls zoomControls = (ZoomControls) getZoomControls(); zoomControls.setLayoutParams(new ViewGroup.LayoutParams(FILL, FILL)); zoomControls.setGravity(Gravity.BOTTOM + Gravity.CENTER_HORIZONTAL); addView(zoomControls); } // OnLongClickListener interface method public boolean onLongClick(View arg0) { displayZoomControls(true); return false; } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { onTouchEvent(ev); return false; } } /*-- AndroidManifest.java ---*/ ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.adamrocker.android.sample.map.zoom application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.ZoomControlMapSample 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=com.google.android.maps / /application uses-permission android:name=android.permission.INTERNET / /manifest /*-- END */ These are the all files except the R.java. Thank you, jokochi. Your advice is useful. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] SMS directed to application
How can I send an SMS directed to an application? My app looks for messages with a particular prefix and then must consume it. Other applications (including the Messaging app) should not get the SMS messages directed to my app. I have an SMS broadcast receiver that can get all the messages and processes the ones only with the particular prefix. After processing the SMS, if I do abortBroadcast(), then it throws a runtime exception. Anyway, aborting the SMS in the middle of a broadcast is not a good idea as it can cause other problems. The issue is that the SMS targeted to my app is also passed to the Messaging app. The SMS directed to my app must never go to Messaging app since it is odd to show that message in the ticker text of the status bar notification and to see it in the SMS inbox. Android doesn't seem to have the concept of a port number to listen for incoming SMS. I am sure there are apps out there that use SMS for communication. Any ideas, android team? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] DateUtils - Alternatives?
The class android.util.DateUtils is gone. What can we use instead? The method getRelativeTimeSpanString was useful to format relative time nicely, like the call log does. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: GPS LocationProvider journey simulation
The Location sample posted in the files section still gives me the error mentioned by Marcel in addition to about two hundred other errors. Will this only work on linux systems? I'm using Windows and eclipse. Thanks. On Aug 21, 2:13 pm, Megha Joshi [EMAIL PROTECTED] wrote: Can you try using the Location sample app posted in the Files section. There are also some sample gpx/kml files for input... On Thu, Aug 21, 2008 at 6:05 AM, marcel-182 [EMAIL PROTECTED] wrote: Hello again, I found something interesting whilst starting up the emulator: 08-21 13:01:44.762: ERROR/GpsLocationProvider(47): Could not open GPS configuration file /etc/gps.conf 08-21 13:01:44.762: ERROR/GpsLocationProvider(47): java.io.FileNotFoundException: /etc/gps.conf Maybe that's the reason why the default journey simulation doesn't work?! Regards, Marcel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Inconsistent usage of setResult(..) Intent.
There is not really a correct way. There is no direct mapping between the old arguments and the new ones -- you can structure your data in the Intent as you want. Generally you should follow the same conventions as used elsewhere for Intents. If this Intent is not going to travel outside of your app, it really doesn't matter how you structure it. If it is going between apps, more thought should be put into it, and the NotePad example is a good one to follow. Note that the ApiDemo example is very artificial, those results don't -mean- anything, so there isn't a strong convention to use. On Aug 20, 10:22 pm, Spencer Riddering [EMAIL PROTECTED] wrote: From ReceiveResults.java in ApiDemos: setResult(RESULT_OK, (new Intent()).setAction(Corky!)); and setResult(RESULT_OK, (new Intent()).setAction(Violet!)); From NoteEditor.java in NotePad: setResult(RESULT_OK, (new Intent()).setAction(mUri.toString())); From NotesList.java in NotePad: setResult(RESULT_OK, new Intent().setData(uri)); From M5 to 0.9 porting and migration tips: Bundle bundle = new Bundle(); bundle.putString(TEST_STRING, Corky!); Intent mIntent = new Intent(); mIntent.putExtras(bundle); setResult(RESULT_OK, mIntent); I believe that the NotesList.java is the only one which does it correctly. I'm not sure why M5 to 0.9 porting and migration tips bothers with the Bundle. Isn't it more straight forward to just call mIntent.putExtra(TEST_STRING, Corky!); ? I think that ReceiveResults.java should have also called putExtra(..): setResult(RESULT_OK, (new Intent()).putExtra(NAME, Violet!)); NoteEditor.java should have used putExtra(..): setResult(RESULT_OK, (new Intent()).putExtra(NAME, mUri.toString())); or better yet, it should have used the setData(..) method: setResult(RESULT_OK, (new Intent()).setData(mUri)); Many of these inconsistent usages stem from attempting to replace the setResult(..) String parameter with the setAction(..) method's String. IMHO, this hijacking of setAction(..) corrupts the clear purpose of the Action String and so should be avoided. Do I have it right? Am I missing something? I'm interested in other people's take on this ambiguity because I see it as an impediment to seamless integration between applications. Originally blogged at:http://spencer.riddering.net/2008/8/21/inconsistent-usage-setresult-i... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Using the ItemizedOverlay and OverlayItem
I've been trying to use the ItemizedOverlay and OverlayItem classes in the 0.9 Beta to simulate map markers but have been having some problems getting it to display on the map. Once I've implemented my own ItemizedOverlay (and overriden createItem), creating a new instance of my class seems to work (I can extract OverlayItems from it) but adding it to the overlay list for one of my maps doesn't seem to do anything. I've included the code for adding the ItemizedOverlay to the map, and the ItemizedOverlay implementation itself is also included. Have I done something wrong or is this functionality not yet available? // Add the ItemizedOverlay to the Map private void addItemizedOverlay() { Resources r = getResources(); mapView = (MapView)findViewById(R.id.map_view); ListOverlay overlays = mapView.getOverlays(); MyItemizedOverlay markers = new MyItemizedOverlay(r.getDrawable(R.drawable.icon)); overlays.add(markers); OverlayItem oi = markers.getItem(0); markers.setFocus(oi); mapView.postInvalidate(); } Where MyItemizedOverlay is defined as: public class MyItemizedOverlay extends ItemizedOverlayOverlayItem { public MyItemizedOverlay(Drawable defaultMarker) { super(defaultMarker); populate(); } @Override protected OverlayItem createItem(int index) { Double lat = (index+37.422006)*1E6; Double lng = -122.084095*1E6; GeoPoint point = new GeoPoint(lat.intValue(), lng.intValue()); OverlayItem oi = new OverlayItem(point, Marker, Marker Text); return oi; } @Override public int size() { return 5; } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: REST + JSON Web Service Client
Hello Jeffrey, I was wondering if you could provide me something about how you appended your JSON string to the web service request. I am trying to communicate with this rest web service via POST method. But I am unable to identify how to append the JSON string as the parameters. Object.setParameter is not working in this scenario... Hope to hear from you soon!! On Aug 21, 10:12 am, Jeffrey Sharkey [EMAIL PROTECTED] wrote: Just a heads up that I've been using simpleJSON with Android, and it's working pretty well. It's somewhat nicer than the defaultJSON included in the SDK because it's iterator-able, making for slick code: for(JSONValue value : (JSONArray)JSONValue.parse(string)) { JSONObject obj = (JSONObject)value; ... } http://www.json.org/java/simple.txt j On Aug 20, 11:00 pm, Baran [EMAIL PROTECTED] wrote: Hi, Thanks for the reply, actually I was confused with how we can use JSON. I suppose this is for manipulating the response we get after a successfulwebservicerequest. Please correct me if I am wrong. Still new to this thing. On Aug 20, 7:00 pm, Mark Murphy [EMAIL PROTECTED] wrote: Baran wrote: Hi, I need to access a .NetwebserviceinRestformat usingJSON. I m pretty new to this concept and very much confused about how this works Any one who can give an overview of the two. I need the steps that I need to follow to useJSON. Right now my doubt is how to useJSONto grab to output. Lets say we create a httpclientand it get the respone now what? How can we use theJSONobject to manipulate the response... There is aJSONparser built into Android: http://code.google.com/android/reference/org/json/package-summary.html And there is an HTTPclientbuilt into Android: http://code.google.com/android/reference/org/apache/http/package-summ... though you may wish to view the HttpClient documentation here: http://hc.apache.org/ Both of these are open source projects with their own documentation, on top of what is in Android. Both are usable in other Java projects outside of Android. If you have specific questions regarding the use of one or the other, particular as it pertains to Android, write back with the details! -- Mark Murphy (a Commons Guy)http://commonsware.com Warescription: All titles, revisions, ebook formats, just $35/year --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Supported Media Player / Media Recorder Formats
Hi, Is there a definitive list on the media formats you can playback and record in the latest SDK? I'm pretty sure I remember a list in the documentation at one point but it seems to have disappeared. Cheers Reto --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: alwaysRetainTaskState - Some questions
If you hit back from the new home activity, do you see the previous secondary activity? Could you please post more information about what you are doing? Please note that this behaves correctly in other places, such as ApiDemos, so there must be something different than normal that you are doing. On Aug 25, 1:05 am, code_android_festival_way [EMAIL PROTECTED] wrote: Some information about my application (simplified): startActivty (user can choose which kind of kontent he wants to post in his blog) - some activity to input some data (let me call ist content activity) - service gets started and does some work (posting the blogpost, working with some web apis) What I actually wanted achieve is that when the user clicks on the Home button while he is at the content activity and restarts the application afterwards he should be brought back to the content activity. At the moment the following happens regarding to tasks: Starting the app: The first activty (MAIN) has Task ID 7 Starting another activity from my MAIN screen: The started activity has Task ID 7 Clicking the HOME button and restarting my application: MAIN activity gets started with Task ID 7 So the application remains in the same task but doesn't get back to the last opened activity before leaving the app to the home screen. I have never set any flags like the two you mentioned above. Do I have to control that by myself (monitoring where I am in the chain of activities that the user starts and restart the activity in my initial screen) or is there some flag? I can't find that out from the app model document. Regards! On 25 Aug., 09:16, hackbod [EMAIL PROTECTED] wrote: What are you actually trying to do? I doubt this parameter is what you want -- it is used to defeat the default behavior of resetting an application's task state after the device has been asleep for a certain amount of time. That is, it will have -no- impact on the behavior of your application unless you put the emulator to sleep for that amount of time (I believe 30 minutes) and then launch it from home. If you are -always- returning back the initial screen of your app when returning from home, that indicates some other problem in how you have structure your app. This might be useful information to help understand what is going on:http://code.google.com/android/intro/appmodel.html Some common things to watch out for: - Don't use android:singleTask (unless you understand what that is and really actually do want everything it implies). - Don't use Intent.FLAG_ACTIVITY_NEW_TASK (unless you understand what that is and really actually do want everything it implies). The above referenced doc has information on these as well. On Aug 22, 6:05 am, code_android_festival_way [EMAIL PROTECTED] wrote: I came across the parameter alwaysRetainTaskState athttp://code.google.com/android/reference/android/R.attr.html#alwaysRe... and don't really know how to use it the right way. I've got several activities in my application and want to persist the state of my activity UI so that the user can press the home button and after starting my application again he will come back to the last opened activity. When I understand the parameter in the right way I think that he should do what I want. Now I've added the parameter to all activities in my AndroidManifest but after restarting my application from the home screen (after pressing the home button in my app) I'm always getting back to my initial screen. Here is one sample from my AndroidManifest: activity android:name=.Preferences android:alwaysRetainTaskState=true /activity What am I doing wrong? In addition I'd like to ask what state in detail will be presisted. (the complete UI state?) Regards! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Order of Axis Values in onSensorChanged
Could one of the Googlers with access to a physical phone confirm the order of the axis values returned by the on onSensorChanged event within the SensorListener class? I assume it's [x, y, z] Where, for a device lying flat on its back on the table in front of me in portrait orientation: The X axis is out of the top of the device. The Y axis is out the left hand side. The Z axis is up out of the screen. Also, is that order the same for the Orientation Sensor (where each value is rotation on that axis) and the Accelerometer Sensor (where each value is acceleration in that direction)? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: MapView and Zoom Control in 0.9 SDK
Thanks for the code. I have just one remark: onInterceptTouchEvent(MotionEvent ev) has to return true in order to be able to scroll while the ZoomControls are being displayed. But I'm not sure if that triggers another bad behaviour :-). On 25 Aug., 17:36, adamrocker [EMAIL PROTECTED] wrote: Hi. I'm so sorry for my code to confuse all of you. This is the shortest sample. /* BEGIN --*/ /*-- ZoomControlMapSample.java ---*/ public class ZoomControlMapSample extends MapActivity { private static final String API_KEY = mapapikey; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MapView zmv = new ZoomMapView(this, API_KEY); setContentView(zmv); } @Override protected boolean isRouteDisplayed() { return false; } } /*-- ZoomMapView.java ---*/ public class ZoomMapView extends MapView implements OnLongClickListener { private static final int FILL = ViewGroup.LayoutParams.FILL_PARENT; public ZoomMapView(Context context, String apiKey) { super(context, apiKey); // long click settings. setClickable(true); setLongClickable(true); setOnLongClickListener(this); // ZoomControls settings. ZoomControls zoomControls = (ZoomControls) getZoomControls(); zoomControls.setLayoutParams(new ViewGroup.LayoutParams(FILL, FILL)); zoomControls.setGravity(Gravity.BOTTOM + Gravity.CENTER_HORIZONTAL); addView(zoomControls); } // OnLongClickListener interface method public boolean onLongClick(View arg0) { displayZoomControls(true); return false; } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { onTouchEvent(ev); return false; } } /*-- AndroidManifest.java ---*/ ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.adamrocker.android.sample.map.zoom application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.ZoomControlMapSample 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=com.google.android.maps / /application uses-permission android:name=android.permission.INTERNET / /manifest /*-- END */ These are the all files except the R.java. Thank you, jokochi. Your advice is useful. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: MapView and Zoom Control in 0.9 SDK
Thanks for your code ! I miss setClickable and I also found setEnabled. My code ran on the previous SDK ... I don't know if it is usefull to indicate this on the migration tips... On 25 août, 19:24, marcel-182 [EMAIL PROTECTED] wrote: Thanks for the code. I have just one remark: onInterceptTouchEvent(MotionEvent ev) has to return true in order to be able to scroll while the ZoomControls are being displayed. But I'm not sure if that triggers another bad behaviour :-). On 25 Aug., 17:36, adamrocker [EMAIL PROTECTED] wrote: Hi. I'm so sorry for my code to confuse all of you. This is the shortest sample. /* BEGIN --*/ /*-- ZoomControlMapSample.java ---*/ public class ZoomControlMapSample extends MapActivity { private static final String API_KEY = mapapikey; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MapView zmv = new ZoomMapView(this, API_KEY); setContentView(zmv); } @Override protected boolean isRouteDisplayed() { return false; } } /*-- ZoomMapView.java ---*/ public class ZoomMapView extends MapView implements OnLongClickListener { private static final int FILL = ViewGroup.LayoutParams.FILL_PARENT; public ZoomMapView(Context context, String apiKey) { super(context, apiKey); // long click settings. setClickable(true); setLongClickable(true); setOnLongClickListener(this); // ZoomControls settings. ZoomControls zoomControls = (ZoomControls) getZoomControls(); zoomControls.setLayoutParams(new ViewGroup.LayoutParams(FILL, FILL)); zoomControls.setGravity(Gravity.BOTTOM + Gravity.CENTER_HORIZONTAL); addView(zoomControls); } // OnLongClickListener interface method public boolean onLongClick(View arg0) { displayZoomControls(true); return false; } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { onTouchEvent(ev); return false; } } /*-- AndroidManifest.java ---*/ ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.adamrocker.android.sample.map.zoom application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.ZoomControlMapSample 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=com.google.android.maps / /application uses-permission android:name=android.permission.INTERNET / /manifest /*-- END */ These are the all files except the R.java. Thank you, jokochi. Your advice is useful. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Abort SMS broadcast
Hi Justin, How to direct an SMS to an application without passing the SMS to other apps and the SMS inbox? On Aug 20, 11:24 am, Justin (Google Employee) [EMAIL PROTECTED] wrote: --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: v0.9 beta - SystemClock.setCurrentTimeMillis() failed
User apps cannot set the time. Only the system processes can. This is for security, but also because it won't have much effect--the time is reset from the radio via network time. 2008/8/22 samlu [EMAIL PROTECTED] I am using v0.9 beta SDK, got the following warning when I call SystemClock.setCurrentTimeMillis() WARN/SystemClock(516): Unable to open alarm driver: Permission denied Does anyone know which permission should be specified? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Gallery missing attribute / method
android.widget.Gallery: What is the equivalent for these in SDK 0.9? android:drawSelectorOnTop or setDrawSelectorOnTop(boolean) android:spinnerSelector or setSelectorSkin(Drawable) 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 [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Sensor values returned by tricorder
Wow, this has really got me excited too Peli! I'm sitting on The Island now and can't wait to scan the environs with my HTC Dream : thank you! Bruno Peli wrote: Hi, I've seen excitedly that the improved sensor classes SensorManager and SensorListener allow for a fully functional Tricorder. http://code.google.com/android/reference/android/hardware/SensorManager.html#SENSOR_TRICORDER I'm so thankful that it returns values in SI units :-) but would be happy to know the order of the various sensor data returned. Also, there seem to be two general types: a standard tricorder and a medical one ( http://en.wikipedia.org/wiki/Tricorder ). Can I assume the standard one is implemented? Would the tricorder also work correctly if gravity is as low as on the death star ( http://code.google.com/android/reference/android/hardware/SensorManager.html#GRAVITY_DEATH_STAR_I )? Thanks, Peli :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-releas... For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: DateUtils.getRelativeTimeSpanString in v0.9
2008/8/25 Guillaume Perrot [EMAIL PROTECTED] Old DateFormat and DateUtils classes are still available in the hidden package android.pim, hope these classes become public again... Yes...DateUtils will be public in the next release... On 22 août, 12:18, Guillaume Perrot [EMAIL PROTECTED] wrote: In Android SDK v0.9, theDateUtilsclass has been removed. Where is the equivalent to format relative dates ? The function was getRelativeTimeSpanString, I hope I don't have to code it myself. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: java.net.SocketException: unknown error
thks it's working. ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=fr.sokaris.poker.android uses-permission android:name=android.permission.INTERNET / ... On 25 août, 09:37, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: oh thks! i'll try it :) On Aug 25, 2:49 am, dai [EMAIL PROTECTED] wrote: Did you add uses-permission android:name=android.permission.INTERNET / to your manifest? This tag is mandatory for beta 0.9 version. Without it, you could not connect to the internet. On 8月25日, 午前9:30, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I try to consume my soap webservice writted with cxf apache. Java client works fine and now, i want to create android client. I found a sample =http://groups.google.com/group/android-developers/browse_thread/threa... And i try to update it to work with the last android sdk version. (0.9 beta) So i decided to use ksoap2 snapshot + SE extension and write a sample.. the source code : public class Adder extends Activity { private static final String SOAP_ACTION = RegistrationService; private static final String METHOD_NAME = register; private static final String NAMESPACE = http:// unknown.namespace; private static final String URL = http://192.168.0.5:8080/poker- flex/ws/RegistrationService?wsdl; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); findViewById(R.id.cmdCalculate).setOnClickListener(new OnClickListener() { public void onClick(View view) { ((TextView)findViewById(R.id.lblStatus)).setText(... Invoking Web Service ...); SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.setOutputSoapObject(request); Transport androidHttpTransport = new HttpTransportSE (URL); try { androidHttpTransport.call(SOAP_ACTION, envelope); Object result = envelope.bodyIn; ((TextView)findViewById(R.id.lblStatus)).setText(result.toString()); } catch(Throwable E) { ((TextView)findViewById(R.id.lblStatus)).setText(ERROR: + E.getClass().getName() + : + E.getMessage()); } } }); } } but I have an exception during calling androidHttpTransport.call(SOAP_ACTION, envelope); at the line 68 from the file HttpTransportSE.java connection.connect(); = java.net.SocketException: unknown error someone use successfully cxf and android client? :-/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android JNI
Thanks, that was exactly what we needed. We realize JNI is not supported, but Java code is just too slow to do the things we need... On Aug 25, 2:23 am, Volker Gropp [EMAIL PROTECTED] wrote: On Aug 22, 9:30 pm, Tyler Ernst [EMAIL PROTECTED] wrote: Also since the 0.9 beta has been released I have been unable to copy the .so to the /system/lib directory of the emulator. If anyone has found a way to do this that would be greatly appreciated. Hi, you have to mount the system rw. To do so run `adb remount` before you push your .so. And keep in mindJNIwill not be supported, or did you find a way to deploy your native lib with a .apk? Volker Gropp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: alwaysRetainTaskState - Some questions
I got it to work now, but only when I do the following: 1. I run my app in Eclipse using Run Run History myApp. The app opens up with the home activity 2. I hit the Back button. The Android home screen with the app menu is displayed 3. I start my app from the Android app menu. The app opens up with the home activity 4. From now on, it will work as expected so when I press Home in a 'secondary' activity and then restart my App again from the Android app menu it will go back to the 'secondary' activity. Does this have something to do with the way Eclipse starts the application? Because if I don't run it from Eclipse it works. On Aug 25, 6:58 pm, hackbod [EMAIL PROTECTED] wrote: If you hit back from the new home activity, do you see the previous secondary activity? Could you please post more information about what you are doing? Please note that this behaves correctly in other places, such as ApiDemos, so there must be something different than normal that you are doing. On Aug 25, 1:05 am, code_android_festival_way [EMAIL PROTECTED] wrote: Some information about my application (simplified): startActivty (user can choose which kind of kontent he wants to post in his blog) - some activity to input some data (let me call ist content activity) - service gets started and does some work (posting the blogpost, working with some web apis) What I actually wanted achieve is that when the user clicks on the Home button while he is at the content activity and restarts the application afterwards he should be brought back to the content activity. At the moment the following happens regarding to tasks: Starting the app: The first activty (MAIN) has Task ID 7 Starting another activity from my MAIN screen: The started activity has Task ID 7 Clicking the HOME button and restarting my application: MAIN activity gets started with Task ID 7 So the application remains in the same task but doesn't get back to the last opened activity before leaving the app to the home screen. I have never set any flags like the two you mentioned above. Do I have to control that by myself (monitoring where I am in the chain of activities that the user starts and restart the activity in my initial screen) or is there some flag? I can't find that out from the app model document. Regards! On 25 Aug., 09:16, hackbod [EMAIL PROTECTED] wrote: What are you actually trying to do? I doubt this parameter is what you want -- it is used to defeat the default behavior of resetting an application's task state after the device has been asleep for a certain amount of time. That is, it will have -no- impact on the behavior of your application unless you put the emulator to sleep for that amount of time (I believe 30 minutes) and then launch it from home. If you are -always- returning back the initial screen of your app when returning from home, that indicates some other problem in how you have structure your app. This might be useful information to help understand what is going on:http://code.google.com/android/intro/appmodel.html Some common things to watch out for: - Don't use android:singleTask (unless you understand what that is and really actually do want everything it implies). - Don't use Intent.FLAG_ACTIVITY_NEW_TASK (unless you understand what that is and really actually do want everything it implies). The above referenced doc has information on these as well. On Aug 22, 6:05 am, code_android_festival_way [EMAIL PROTECTED] wrote: I came across the parameter alwaysRetainTaskState athttp://code.google.com/android/reference/android/R.attr.html#alwaysRe... and don't really know how to use it the right way. I've got several activities in my application and want to persist the state of my activity UI so that the user can press the home button and after starting my application again he will come back to the last opened activity. When I understand the parameter in the right way I think that he should do what I want. Now I've added the parameter to all activities in my AndroidManifest but after restarting my application from the home screen (after pressing the home button in my app) I'm always getting back to my initial screen. Here is one sample from my AndroidManifest: activity android:name=.Preferences android:alwaysRetainTaskState=true /activity What am I doing wrong? In addition I'd like to ask what state in detail will be presisted. (the complete UI state?) Regards!- 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 [EMAIL
[android-developers] Re: REST + JSON Web Service Client
This might help... JSONObject mLocationJSON = createLocationJSON(mLatitude, mLongitude, mDateTime); postLocationJSON(SERVER_URL, mLocationJSON); /** * @param mUrl The URL of location tracking server. * @param mLocationJSON The location data with time in JSON format. */ public void postLocationJSON(String mUrl, JSONObject mLocationJSON) { HttpClient httpClient = new DefaultHttpClient(); HttpPost postMethod = new HttpPost(mUrl); try { // prepare parameters HttpParams params = new BasicHttpParams(); params.setParameter(locationJSON, mLocationJSON.toString()); postMethod.setParams(params); httpClient.execute(postMethod); Log.i(TAG, Post request, data: + mLocationJSON.toString()); } catch (Exception e) { Log.e(Exception, e.getMessage()); } finally { postMethod.abort(); } } /** * @param mLatitude The latitude data received from location update sent by *LocationManager Service. * @param mLongitude The longitude received from location update sent by *LocationManager Service. * @param mDateTime The DateTime at which location update was sent. * @return JSONObject The JSONObject holding latitude,longitude reported by * the LocationManager Service and DateTime in RFC3339 format. */ public JSONObject createLocationJSON(double mLatitude, double mLongitude, String mDateTime) { JSONObject mLocationJSON = new JSONObject(); try { mLocationJSON.put(latitude, mLatitude); mLocationJSON.put(longitude, mLongitude); mLocationJSON.put(date, mDateTime); } catch (JSONException ex) { Log.e(TAG, Error in creating Location JSON object.); } return mLocationJSON; } 2008/8/25 Baran [EMAIL PROTECTED] Hello Jeffrey, I was wondering if you could provide me something about how you appended your JSON string to the web service request. I am trying to communicate with this rest web service via POST method. But I am unable to identify how to append the JSON string as the parameters. Object.setParameter is not working in this scenario... Hope to hear from you soon!! On Aug 21, 10:12 am, Jeffrey Sharkey [EMAIL PROTECTED] wrote: Just a heads up that I've been using simpleJSON with Android, and it's working pretty well. It's somewhat nicer than the defaultJSON included in the SDK because it's iterator-able, making for slick code: for(JSONValue value : (JSONArray)JSONValue.parse(string)) { JSONObject obj = (JSONObject)value; ... } http://www.json.org/java/simple.txt j On Aug 20, 11:00 pm, Baran [EMAIL PROTECTED] wrote: Hi, Thanks for the reply, actually I was confused with how we can use JSON. I suppose this is for manipulating the response we get after a successfulwebservicerequest. Please correct me if I am wrong. Still new to this thing. On Aug 20, 7:00 pm, Mark Murphy [EMAIL PROTECTED] wrote: Baran wrote: Hi, I need to access a .NetwebserviceinRestformat usingJSON. I m pretty new to this concept and very much confused about how this works Any one who can give an overview of the two. I need the steps that I need to follow to useJSON. Right now my doubt is how to useJSONto grab to output. Lets say we create a httpclientand it get the respone now what? How can we use theJSONobject to manipulate the response... There is aJSONparser built into Android: http://code.google.com/android/reference/org/json/package-summary.html And there is an HTTPclientbuilt into Android: http://code.google.com/android/reference/org/apache/http/package-summ... though you may wish to view the HttpClient documentation here: http://hc.apache.org/ Both of these are open source projects with their own documentation, on top of what is in Android. Both are usable in other Java projects outside of Android. If you have specific questions regarding the use of one or the other, particular as it pertains to Android, write back with the details! -- Mark Murphy (a Commons Guy)http://commonsware.com Warescription: All titles, revisions, ebook formats, just $35/year --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android JNI
Blame the Dalvik, not java :P On Mon, Aug 25, 2008 at 2:15 PM, Tyler Ernst [EMAIL PROTECTED] wrote: Thanks, that was exactly what we needed. We realize JNI is not supported, but Java code is just too slow to do the things we need... On Aug 25, 2:23 am, Volker Gropp [EMAIL PROTECTED] wrote: On Aug 22, 9:30 pm, Tyler Ernst [EMAIL PROTECTED] wrote: Also since the 0.9 beta has been released I have been unable to copy the .so to the /system/lib directory of the emulator. If anyone has found a way to do this that would be greatly appreciated. Hi, you have to mount the system rw. To do so run `adb remount` before you push your .so. And keep in mindJNIwill not be supported, or did you find a way to deploy your native lib with a .apk? Volker Gropp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: java.net.SocketException: unknown error
Did you add uses-permission android:name=android.permission.INTERNET / to your manifest? This tag is mandatory for beta 0.9 version. Without it, you could not connect to the internet. On 8月25日, 午前9:30, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I try to consume my soap webservice writted with cxf apache. Java client works fine and now, i want to create android client. I found a sample =http://groups.google.com/group/android-developers/browse_thread/threa... And i try to update it to work with the last android sdk version. (0.9 beta) So i decided to use ksoap2 snapshot + SE extension and write a sample.. the source code : public class Adder extends Activity { private static final String SOAP_ACTION = RegistrationService; private static final String METHOD_NAME = register; private static final String NAMESPACE = http:// unknown.namespace; private static final String URL = http://192.168.0.5:8080/poker- flex/ws/RegistrationService?wsdl; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); findViewById(R.id.cmdCalculate).setOnClickListener(new OnClickListener() { public void onClick(View view) { ((TextView)findViewById(R.id.lblStatus)).setText(... Invoking Web Service ...); SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.setOutputSoapObject(request); Transport androidHttpTransport = new HttpTransportSE (URL); try { androidHttpTransport.call(SOAP_ACTION, envelope); Object result = envelope.bodyIn; ((TextView)findViewById(R.id.lblStatus)).setText(result.toString()); } catch(Throwable E) { ((TextView)findViewById(R.id.lblStatus)).setText(ERROR: + E.getClass().getName() + : + E.getMessage()); } } }); } } but I have an exception during calling androidHttpTransport.call(SOAP_ACTION, envelope); at the line 68 from the file HttpTransportSE.java connection.connect(); = java.net.SocketException: unknown error someone use successfully cxf and android client? :-/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Does 0.9-SDK support Camera feature now??
You cannot use a USB camera device, because the emulator does not support Camera capture... 2008/8/25 brad [EMAIL PROTECTED] any anwser @@? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] MapView on load
Hi all, Is there a function callback for when the MapView is fully loaded (tiles, etc), or when the projection class is valid? The problem I'm having is that I'm loading an overlay apparently too early and it's crashing the application when it tries to access the view's projection class in onDraw(). Or maybe there is a way to check the projection class's validity? Thanks! -David --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Simple Mock Location Provider
Hi, I'd just like to create to get a location (not tracking, just get the last postion fixed), but for my mock location provider, I'd like this fix change time to time. I tried the old method by creating a new directory under the location directory but it seems it does not work anymore (as documented by the way :-) ). I also add the test providers with the method : public static void addMyMockLocationProvider(LocationManager locmgr) { String mocLocationProvider = LocationManager.GPS_PROVIDER; if (locmgr.getProvider(mocLocationProvider) == null || ! locmgr.isProviderEnabled(mocLocationProvider)) { locmgr.addTestProvider(mocLocationProvider, false, false, false, false, false, false, false, 0, 5); locmgr.setTestProviderEnabled(mocLocationProvider, true); } } But I still don't have the position given in KML file I send thanks to DDMS (or even GPX files) (I import files and then push on the PLAY button when clickable). I have the folowing error in the logcat: 08-25 19:11:30.926: ERROR/LocationManagerService(52): isProviderEnabled got exception: 08-25 19:11:30.926: ERROR/LocationManagerService(52): java.lang.IllegalArgumentException: provider=network 08-25 19:11:30.926: ERROR/LocationManagerService(52): at com.android.server.LocationManagerService._isProviderEnabled(LocationManagerService.java: 1145) 08-25 19:11:30.926: ERROR/LocationManagerService(52): at com.android.server.LocationManagerService.isProviderEnabled(LocationManagerService.java: 1131) 08-25 19:11:30.926: ERROR/LocationManagerService(52): at android.location.ILocationManager $Stub.onTransact(ILocationManager.java:211) I can't also succeed in having my current location in the standard maps application. The system still returns 0, 0 ! Does anyone here can provide a quick step by step solution to have a mock location provider working ? Thx ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: MapView on load
Apologies, error in my code :D On Aug 25, 3:10 pm, David Foelber [EMAIL PROTECTED] wrote: Hi all, Is there a function callback for when the MapView is fully loaded (tiles, etc), or when the projection class is valid? The problem I'm having is that I'm loading an overlay apparently too early and it's crashing the application when it tries to access the view's projection class in onDraw(). Or maybe there is a way to check the projection class's validity? Thanks! -David --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Keytool apparently not signing apk - What am I missing here?
Check the logcat output...it will tell you what the problem is. 2008/8/24 Zack [EMAIL PROTECTED] Thanks for your help. add the JDK version of Keytool to your PATH variable. -- Done. Signing in Eclipse/ADT If you are developing in Eclipse and have set up Keytool as described above, signing in debug mode is enabled by default. When you run or debug your app, ADT signs the .apk for you and installs it on the emulator. No specific action on your part is needed, provided ADT has access to Keytool. Debug version on Windows Vista using eclipse... [2008-08-23 23:27:35 - HelloActivity] Installing HelloActivity.apk... [2008-08-23 23:27:38 - HelloActivity] Installation failed due to invalid APK file! Not sure what else I'm suppose to do. Is something missing from the directions that is obvious to experienced eclipse users? Do I some how have to direct eclipse to load the keytool plug-in? Thanks again. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Audio Picking / Video Picking (ACTION_PICK) - Should it work in 0.9?
This is a bug in the sdk , it will be fixed in a future release... 2008/8/24 code_android_festival_way [EMAIL PROTECTED] Hello guys! I got a question regarding the picking of audio and video files with the ACTION_PICK in the Media ContentProvider. It is working for images but audio gets me a: 08-24 17:43:52.010: ERROR/AndroidRuntime(19692): android.content.ActivityNotFoundException: No Activity found to handle Intent { action=android.intent.action.PICK data=content://media/ internal/audio/media } For video I can open the picking dialog and I get my videos in a ListView. But after choosing a video file it gets played but the user can't pick it. I'm using the following code to take the action (differs in Video,Audio,Images): Uri uri = Video.Media.INTERNAL_CONTENT_URI; Intent intent = new Intent(Intent.ACTION_PICK,uri); startActivityForResult(intent,0); It would be nice if someone could tell me if I'm doing something wrong (which I don't assume because image picking is working just fine) or if it is just not yet implemented in 0.9. Regards! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Feature Suggestion: Maps caching
Could you log this as a feature request in Android Issue Tracker...Thanks! 2008/8/24 Nils [EMAIL PROTECTED] Hi, I would like to see the maps application to be able to cache all tiles required to navigate a calculated route from start to finish. Additionally, the user should be able to set a custom distance from his/her designated route that should also be covered by the cache (detours, camping-stays etc.). That way its possible to use maps on route without a permanent WiFi/3G- connection (especially for people going abroad). Nils --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Code working in standalone java; doesnot work in android (android-sdk-windows-0.9_beta)
You didn't answer what type myService is here. Cheers, Justin Android Team @ Google --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Creating a Dialog Activity with default OK and Cancel buttons
It would of course be better to have an activity that you can style like an AlertDialog. But an AlertDialog is not an Activity and an Activity is not an AlertDialog. These classes represent two distinct concepts and should, therefore, have different styles so users can immediately know visually what they're dealing with. Cheers, Justin Android Team @ Googl On Aug 25, 8:11 am, webmonkey [EMAIL PROTECTED] wrote: Hello Hackbod, I indeed looked at the API demo you refer to, but I want to get the same type of buttons panel at the bottom so that I am consistent with the overall platform. The look of the dialog and the panel at the bottom has changed a couple of times, and by using AlertDialog I don't have to worry about any future changes. Plus, I don't have to build everything myself. My solution right now is to use an activity with a transparent theme and then call showDialog in onCreate. This way I can still use AlertDialog. It now works like the Edit Bookmarks activity behaviour I was looking for. It would of course be better to have an activity that you can style like an AlertDialog. I have looked at the classes com.android.internal.app.AlertActivity and com.android.internal.app.AlertController which seem to do what I want, but I obviously cannot use them. Hope you will make these public in the future. On Aug 25, 9:03 am, hackbod [EMAIL PROTECTED] wrote: Hi, If you want an alert that looks like a dialog, you can use andoid:theme=@android:style/Theme.Dialog in your manifest. There is an example in API demos for doing this. If you are specifically looking for the functionality of AlertDialog in an activity, unfortunately for 1.0 we are not going to have time to implement this. On Aug 22, 9:36 am, webmonkey [EMAIL PROTECTED] wrote: How do I create a dialog activity that looks exactly the same as when you build a dialog with the AlertDialog class, including the buttons panel at the bottom. Basically, I want the same sort of activity that you get when you add a Bookmark in the Browser app. I checked the APIDemos Activity Dialog sample but it is missing the panel with the buttons. Thanks- 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 [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: attempt to acquire a reference on a close SQLiteClosable
Another option if you still want to use Activity.managedQuery() is to get your information and then: stopManaging(cursor); cursor.close(); Cheers, Justin Android Team @ Google On Aug 21, 1:23 am, Jeff Hamilton [EMAIL PROTECTED] wrote: So what is the best way to call a Cursor? since i got a meta-database i have quite a few queries where i just get myself a small piece of information and then i don't need the cursor anymore, so i call close() directly after extracting information from it. within an activity, i think the most comfortable way is to call managedQuery() because you don't have to care about exceptions and stuff. but how long will the system try to kkep my cursor available although i don't need it anymore? is the only efficient way to call, get data from and close a cursor through a call to If you know you only need the info for a short period of time you can just call getContentResolver().query(...) to get your cursor and then call close() on it as soon as you're done reading the data you need. If you're doing something like creating a list of items from a database using CursorAdapter it's cleaner to go the managedQuery() route since you want the life cycle of the cursor to match the life cycle of the activity that's displaying its data. try{ Cursor c = getContentResolver().acquireProvider(uri).query(...); }catch(RemoteException e){...} or are there other ways how i can get a cursor that i can manage myself? If you're managing the cursor yourself the cleanest way to go is probably this: Cursor cursor = getContentResolver().query(...); try { // read from the cursor and do stuff} finally { if (cursor != null) cursor.close(); } If you're worried about the time the query will take you can also have a look athttp://code.google.com/android/reference/android/content/AsyncQueryHa That will run the query on a worker thread and call back onto the UI thread when the work is done so you can update your UI state safely without having to worry about locking. -Jeff Again, thanks a lot for your useful tips. you saved my ass! On Aug 21, 1:58 am, Jeff Hamilton [EMAIL PROTECTED] wrote: If you're using a managed cursor you shouldn't be calling close() or deactivate() on the cursor yourself, since the system will do that for you. If you're not using a managed cursor and you call close() on it you cannot use that cursor again and should make sure that you don't have any observers registered before calling close(), and then explicitly set all references you hold to the cursor to null just to make sure you won't use it again. If you plan on reusing the cursor again, you should call deactivate(), which releases a bunch of resources, but not all of them. A deactivated cursor can't be used again until you call requery() on it. -Jeff On Wed, Aug 20, 2008 at 1:36 AM, simon [EMAIL PROTECTED] wrote: Thanks for your help. But i still don't understand exactly what i'm doing wrong. I'm navigating from Activity1 to Activity2. Then i navigate back to Activity1 by pushing the Back-Button. You say i should overwrite onPause() on Activity2 to release its resources. So the error has nothing to do with Activity1? But i'm already using a managed Cursor plus i'm calling Cursor.close() in onPause() (just to be sure) in Activity2. Other Cursors i am using in other classes also get released (by calling close()) immediately after gathering information from them. so i don't know what i am doing wrong...is close() the wrong function to call? Do i have to release other resources as well? such as ContentProviders? i found out that ContentResolver got a new method called releaseProvider(IContentProvider icp). But it's not documented yet. should it be used to release the ContentProviders? just because i'm interested: why does the system try to acquire a reference on a Cursor if an activity gets closed anyway? i'm getting the following RuntimeException (which gets caused by the Exception i posted earlier): java.lang.RuntimeException: Unable to resume activity {my.package/ my.package.Activity2}: java.lang.IllegalStateException: attempt to acquire a reference on a close SQLiteClosable Why does the system tell me that it's unable to resume an Activity which i just wanted to close by pushing the back button? and what is a close SQLiteClosable? shouldn't it read closeD SQLiteClosable? And if i release Cursors by calling close(), aren't these also close SQLiteClosables which can't be acquired? i just dont get it... I would be happy to get more information about what the system is doing between the Activities and why those strange error messages occur Thanks a lot Simon On Aug 19, 6:05 pm, Justin (Google Employee) [EMAIL PROTECTED] wrote: My guess would be that you have an SQLite cursor that you're not releasing when your Activity
[android-developers] Re: Shared library/separate module not found
My previous statement was incorrect, awt *is* included. The library is android.awt instead of java.awt, so use uses-library android:name=android.awt / . Cheers, Justin Android Team @ Google On Aug 20, 11:20 pm, deviand [EMAIL PROTECTED] wrote: The package com.google.android.maps has also been removed, but it is used in ApiDemos and the application can be installed. The package com.google.android.gtalkservice is in the same situation. I don't understand why when java.awt is used the behavior is different. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android JNI
Native code is not supported in 1.0. On Aug 25, 11:15 am, Tyler Ernst [EMAIL PROTECTED] wrote: Thanks, that was exactly what we needed. We realize JNI is not supported, but Java code is just too slow to do the things we need... On Aug 25, 2:23 am, Volker Gropp [EMAIL PROTECTED] wrote: On Aug 22, 9:30 pm, Tyler Ernst [EMAIL PROTECTED] wrote: Also since the 0.9 beta has been released I have been unable to copy the .so to the /system/lib directory of the emulator. If anyone has found a way to do this that would be greatly appreciated. Hi, you have to mount the system rw. To do so run `adb remount` before you push your .so. And keep in mindJNIwill not be supported, or did you find a way to deploy your native lib with a .apk? Volker Gropp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: alwaysRetainTaskState - Some questions
The behavior when running from eclipse is different than running it normally. When you run from eclipse it may (perhaps always) install the .apk on to the device, which means uninstalling the current .apk and this clearing all previous app state. On Aug 25, 11:16 am, webmonkey [EMAIL PROTECTED] wrote: I got it to work now, but only when I do the following: 1. I run my app in Eclipse using Run Run History myApp. The app opens up with the home activity 2. I hit the Back button. The Android home screen with the app menu is displayed 3. I start my app from the Android app menu. The app opens up with the home activity 4. From now on, it will work as expected so when I press Home in a 'secondary' activity and then restart my App again from the Android app menu it will go back to the 'secondary' activity. Does this have something to do with the way Eclipse starts the application? Because if I don't run it from Eclipse it works. On Aug 25, 6:58 pm, hackbod [EMAIL PROTECTED] wrote: If you hit back from the new home activity, do you see the previous secondary activity? Could you please post more information about what you are doing? Please note that this behaves correctly in other places, such as ApiDemos, so there must be something different than normal that you are doing. On Aug 25, 1:05 am, code_android_festival_way [EMAIL PROTECTED] wrote: Some information about my application (simplified): startActivty (user can choose which kind of kontent he wants to post in his blog) - some activity to input some data (let me call ist content activity) - service gets started and does some work (posting the blogpost, working with some web apis) What I actually wanted achieve is that when the user clicks on the Home button while he is at the content activity and restarts the application afterwards he should be brought back to the content activity. At the moment the following happens regarding to tasks: Starting the app: The first activty (MAIN) has Task ID 7 Starting another activity from my MAIN screen: The started activity has Task ID 7 Clicking the HOME button and restarting my application: MAIN activity gets started with Task ID 7 So the application remains in the same task but doesn't get back to the last opened activity before leaving the app to the home screen. I have never set any flags like the two you mentioned above. Do I have to control that by myself (monitoring where I am in the chain of activities that the user starts and restart the activity in my initial screen) or is there some flag? I can't find that out from the app model document. Regards! On 25 Aug., 09:16, hackbod [EMAIL PROTECTED] wrote: What are you actually trying to do? I doubt this parameter is what you want -- it is used to defeat the default behavior of resetting an application's task state after the device has been asleep for a certain amount of time. That is, it will have -no- impact on the behavior of your application unless you put the emulator to sleep for that amount of time (I believe 30 minutes) and then launch it from home. If you are -always- returning back the initial screen of your app when returning from home, that indicates some other problem in how you have structure your app. This might be useful information to help understand what is going on:http://code.google.com/android/intro/appmodel.html Some common things to watch out for: - Don't use android:singleTask (unless you understand what that is and really actually do want everything it implies). - Don't use Intent.FLAG_ACTIVITY_NEW_TASK (unless you understand what that is and really actually do want everything it implies). The above referenced doc has information on these as well. On Aug 22, 6:05 am, code_android_festival_way [EMAIL PROTECTED] wrote: I came across the parameter alwaysRetainTaskState athttp://code.google.com/android/reference/android/R.attr.html#alwaysRe... and don't really know how to use it the right way. I've got several activities in my application and want to persist the state of my activity UI so that the user can press the home button and after starting my application again he will come back to the last opened activity. When I understand the parameter in the right way I think that he should do what I want. Now I've added the parameter to all activities in my AndroidManifest but after restarting my application from the home screen (after pressing the home button in my app) I'm always getting back to my initial screen. Here is one sample from my AndroidManifest: activity android:name=.Preferences android:alwaysRetainTaskState=true /activity What am I doing wrong? In addition I'd like to ask what state in detail
[android-developers] Problem with bindService
Hi, I am working on an application and I am trying to migrate it to 0.9 I am trying to use a remote service but when I bind it I get the following error Binding to unknown activity. This is how I am using the service: 1. AndroidManifest.xml activity android:name=.ListMusic/activity service android:name=.MusicService android:process=:remote intent-filter action android:name=com.android.example.IMusicService / action android:name=com.android.example.MUSIC_SERVICE / /intent-filter /service 2. How I am binding the service bindService(new Intent(IMusicService.class.getName()), mConnection, Context.BIND_AUTO_CREATE); Thanks so much, I hope someone can help me. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to get gps.conf file? SDK0.9
The emulator doesn't need that file, its absence won't cause you any real errors. Cheers, Justin Android Team @ Google On Aug 25, 2:21 pm, Zack [EMAIL PROTECTED] wrote: Thanks for any help. SDK 0.9 is apparently missing etc/gps.conf on the emulator. Maybe other things too; I'm getting a couple hundred error messages and my app loads on android. How can I get or create gps.conf and load it onto the emulator? What about other files that may be missing? Thanks again. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: alwaysRetainTaskState - Some questions
Thank you for your answers. I can confirm webmonkeys experience. Installing from eclipse - starting - pressing the back button - starting again From that point on the application saves the last opened activity. So this seems to be a bug caused by the installation through Eclipse right? Regards! On 25 Aug., 23:02, hackbod [EMAIL PROTECTED] wrote: The behavior when running from eclipse is different than running it normally. When you run from eclipse it may (perhaps always) install the .apk on to the device, which means uninstalling the current .apk and this clearing all previous app state. On Aug 25, 11:16 am, webmonkey [EMAIL PROTECTED] wrote: I got it to work now, but only when I do the following: 1. I run my app in Eclipse using Run Run History myApp. The app opens up with the home activity 2. I hit the Back button. The Android home screen with the app menu is displayed 3. I start my app from the Android app menu. The app opens up with the home activity 4. From now on, it will work as expected so when I press Home in a 'secondary' activity and then restart my App again from the Android app menu it will go back to the 'secondary' activity. Does this have something to do with the way Eclipse starts the application? Because if I don't run it from Eclipse it works. On Aug 25, 6:58 pm, hackbod [EMAIL PROTECTED] wrote: If you hit back from the new home activity, do you see the previous secondary activity? Could you please post more information about what you are doing? Please note that this behaves correctly in other places, such as ApiDemos, so there must be something different than normal that you are doing. On Aug 25, 1:05 am, code_android_festival_way [EMAIL PROTECTED] wrote: Some information about my application (simplified): startActivty (user can choose which kind of kontent he wants to post in his blog) - some activity to input some data (let me call ist content activity) - service gets started and does some work (posting the blogpost, working with some web apis) What I actually wanted achieve is that when the user clicks on the Home button while he is at the content activity and restarts the application afterwards he should be brought back to the content activity. At the moment the following happens regarding to tasks: Starting the app: The first activty (MAIN) has Task ID 7 Starting another activity from my MAIN screen: The started activity has Task ID 7 Clicking the HOME button and restarting my application: MAIN activity gets started with Task ID 7 So the application remains in the same task but doesn't get back to the last opened activity before leaving the app to the home screen. I have never set any flags like the two you mentioned above. Do I have to control that by myself (monitoring where I am in the chain of activities that the user starts and restart the activity in my initial screen) or is there some flag? I can't find that out from the app model document. Regards! On 25 Aug., 09:16, hackbod [EMAIL PROTECTED] wrote: What are you actually trying to do? I doubt this parameter is what you want -- it is used to defeat the default behavior of resetting an application's task state after the device has been asleep for a certain amount of time. That is, it will have -no- impact on the behavior of your application unless you put the emulator to sleep for that amount of time (I believe 30 minutes) and then launch it from home. If you are -always- returning back the initial screen of your app when returning from home, that indicates some other problem in how you have structure your app. This might be useful information to help understand what is going on:http://code.google.com/android/intro/appmodel.html Some common things to watch out for: - Don't use android:singleTask (unless you understand what that is and really actually do want everything it implies). - Don't use Intent.FLAG_ACTIVITY_NEW_TASK (unless you understand what that is and really actually do want everything it implies). The above referenced doc has information on these as well. On Aug 22, 6:05 am, code_android_festival_way [EMAIL PROTECTED] wrote: I came across the parameter alwaysRetainTaskState athttp://code.google.com/android/reference/android/R.attr.html#alwaysRe... and don't really know how to use it the right way. I've got several activities in my application and want to persist the state of my activity UI so that the user can press the home button and after starting my application again he will come back to the last opened activity. When I understand the parameter in the right way I think that he should do what I want. Now I've added the parameter to all activities in my
[android-developers] Re: Audio Picking / Video Picking (ACTION_PICK) - Should it work in 0.9?
Thank you for your quick response! On 25 Aug., 22:28, Megha Joshi [EMAIL PROTECTED] wrote: This is a bug in the sdk , it will be fixed in a future release... 2008/8/24 code_android_festival_way [EMAIL PROTECTED] Hello guys! I got a question regarding the picking of audio and video files with the ACTION_PICK in the Media ContentProvider. It is working for images but audio gets me a: 08-24 17:43:52.010: ERROR/AndroidRuntime(19692): android.content.ActivityNotFoundException: No Activity found to handle Intent { action=android.intent.action.PICK data=content://media/ internal/audio/media } For video I can open the picking dialog and I get my videos in a ListView. But after choosing a video file it gets played but the user can't pick it. I'm using the following code to take the action (differs in Video,Audio,Images): Uri uri = Video.Media.INTERNAL_CONTENT_URI; Intent intent = new Intent(Intent.ACTION_PICK,uri); startActivityForResult(intent,0); It would be nice if someone could tell me if I'm doing something wrong (which I don't assume because image picking is working just fine) or if it is just not yet implemented in 0.9. Regards! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: MediaRecord Audio - working example? / raw data stream onPictureTaken()? / Bug in Pictures application?
Something new about this. Audio recording would be very important for me. Best regards! On 25 Aug., 00:20, code_android_festival_way [EMAIL PROTECTED] wrote: I've got two questions. 1) Is there a working example for recording audio with the MediaRecorder? At the moment I'm using the following setup but it doesnt work: http://paste.pocoo.org/show/83242/ Error: 08-24 19:27:18.675: ERROR/Database(178): Error inserting title=Content Creation No.5 date_added=1219598838 _display_name= album_id=2 title_key= - E C O 1 C O - K 1 ) O 9 E C C E „ artist_id=3 using INSERT INTO audio_meta(title, date_added, _display_name, album_id, title_key, artist_id) VALUES(?, ?, ?, ?, ?, ?); I've tried the example provided in the docs (Media API) but that doesn't work at all. It would be nice if someone could provide a working example. 2) Is it normal that the raw data stream returned by onPictureTaken(...) is null? 3) I'm taking pictures as above mentioned. After that I'm saving the available jpeg stream into the image ContentProvider which works fine. Now I'm leaving my app and try to start the Pictures application from the home screen. And now I get the following error message: http://img.skitch.com/20080824-mrbc7yuhfh7an5ynndj9hm6twp.jpg Here is the error from the logs: 08-25 00:15:34.007: ERROR/AndroidRuntime(220): java.lang.RuntimeException: Unable to resume activity {com.android.camera/com.android.camera.GalleryPicker}: java.lang.NullPointerException I can savely say that I'm calling camera.stopPreview() and camera.release() so there shouldn't be a problem with the camera. What else could be wrong? Here is the part where I'm saving my jpeg byte[] into the ContentProvider: http://paste.pocoo.org/show/83246/ Regards! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Image Button?
Is there a way to have the selector code for multiple ImageButtons in one xml file. So, if i have 10 buttons, i want to have all the code in one file and not in 10 xml files to set the background for each button. Is there a way to give each selector tag an ID? and then use different selectors for different buttons but have them all together in one location? Kavik --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Custom Content Provider and Multiple Tables
Since the ContentProvider interface has a single insert, update, query, delete methods, and as far as I can see, you can only include one ContentProvider in your application. ContentProviders are managed by their MIME type/URI patterns. An application should be able to have several providers, or a single provider that handles several sorts of data. If you want a single ContentProvider to handle multiple URI patterns, use a UriMatcher: http://code.google.com/android/reference/android/content/UriMatcher.html -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.1 Published! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: MapView and Zoom Control in 0.9 SDK
Is this a bug? Android can't recognize the difference between the motion of long touch action and the motion of move action. It is different between the long touch action and the move action, isn't it? So, I modified my code without using onInterceptTouchEvent. /*-- ZoomMapView.java ---*/ public class ZoomMapView extends MapView implements OnLongClickListener { private static final int FILL = ViewGroup.LayoutParams.FILL_PARENT; private boolean moving; private ZoomControls zoomControls; public ZoomMapView(Context context, String apiKey) { super(context, apiKey); // long click settings. moving = false; setClickable(true); setLongClickable(true); setOnLongClickListener(this); // ZoomControls settings. zoomControls = (ZoomControls) getZoomControls(); zoomControls.setLayoutParams(new ViewGroup.LayoutParams(FILL, FILL)); zoomControls.setGravity(Gravity.BOTTOM + Gravity.CENTER_HORIZONTAL); addView(zoomControls); } // OnLongClickListener interface method public boolean onLongClick(View arg0) { if (!moving) { displayZoomControls(true); } return true; } @Override public boolean onTouchEvent(MotionEvent me) { switch (me.getAction()) { case MotionEvent.ACTION_MOVE: moving = true; break; case MotionEvent.ACTION_UP: if (moving) { zoomControls.hide(); } moving = false; break; } return super.onTouchEvent(me); } } This code doesn't trigger another behavior like onInterceptTouchEvent. What do you think about my code? On 8月26日, 午前2:32, 6real [EMAIL PROTECTED] wrote: Thanks for your code ! I miss setClickable and I also found setEnabled. My code ran on the previous SDK ... I don't know if it is usefull to indicate this on the migration tips... On 25 août, 19:24, marcel-182 [EMAIL PROTECTED] wrote: Thanks for the code. I have just one remark: onInterceptTouchEvent(MotionEvent ev) has to return true in order to be able to scroll while the ZoomControls are being displayed. But I'm not sure if that triggers another bad behaviour :-). On 25 Aug., 17:36, adamrocker [EMAIL PROTECTED] wrote: Hi. I'm so sorry for my code to confuse all of you. This is the shortest sample. /* BEGIN --*/ /*-- ZoomControlMapSample.java ---*/ public class ZoomControlMapSample extends MapActivity { private static final String API_KEY = mapapikey; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MapView zmv = new ZoomMapView(this, API_KEY); setContentView(zmv); } @Override protected boolean isRouteDisplayed() { return false; } } /*-- ZoomMapView.java ---*/ public class ZoomMapView extends MapView implements OnLongClickListener { private static final int FILL = ViewGroup.LayoutParams.FILL_PARENT; public ZoomMapView(Context context, String apiKey) { super(context, apiKey); // long click settings. setClickable(true); setLongClickable(true); setOnLongClickListener(this); // ZoomControls settings. ZoomControls zoomControls = (ZoomControls) getZoomControls(); zoomControls.setLayoutParams(new ViewGroup.LayoutParams(FILL, FILL)); zoomControls.setGravity(Gravity.BOTTOM + Gravity.CENTER_HORIZONTAL); addView(zoomControls); } // OnLongClickListener interface method public boolean onLongClick(View arg0) { displayZoomControls(true); return false; } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { onTouchEvent(ev); return false; } } /*-- AndroidManifest.java ---*/ ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.adamrocker.android.sample.map.zoom application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.ZoomControlMapSample android:label=@string/app_name intent-filter action
[android-developers] Re: Instrumentation failing with classnotfound on android.test.InstrumentationTestRunner
I have made this work correctly and discuss it on my blog here: http://devtcg.blogspot.com/2008/08/android-instrumentation-example.html On Aug 23, 1:02 am, Carl H. [EMAIL PROTECTED] wrote: Hi Megha, I did not notice that no, was looking at the site. I tried to add the second androidManifest to my project under the acceptance folder which is my test folder. When I try to compile and install the app onto the device, I get the following error: 08-23 07:58:21.129: WARN/PackageParser(54): Unable to read AndroidManifest.xml of /data/app/vmdl31345.tmp 08-23 07:58:21.129: WARN/PackageParser(54): java.io.FileNotFoundException: AndroidManifest.xml I did follow the instruction on changing the package name etc... I have several questions: 1. Do I need to have theinstrumentationin another app - thus installing 2 different apps (signing them correctly I suppose)? 2. Why do you use the permission run_instrumentation? I thought there was no need for it in 0.9? More documentation here would be much appreciated indeed! Thanks, Car aka acsia On Aug 22, 11:05 pm, Megha Joshi [EMAIL PROTECTED] wrote: Did you notice there is one more AndroidManifest.xml file under the /tests folder in ApiDemos...perhaps you are missing that... We will add more information to the docs ... On Fri, Aug 22, 2008 at 4:50 AM, Carl H. [EMAIL PROTECTED] wrote: Note that the cmd line is: adb shell am instrument -e class com.novoda.runbuddy.AllTests -w com.novoda.runbuddy/android.test.InstrumentationTestRunner and not as previously stated: adb shell am instrument -e class com.android.samples.AllTests -w com.novoda.runbuddy/android.test.InstrumentationTestRunner The error is still apparent On Aug 22, 12:18 pm, Carl H. [EMAIL PROTECTED] wrote: Hello, I am trying to follow the post on ApplicationInstrumentation: http://code.google.com/android/samples/ApiDemos/tests/src/com/android .. My setup is very similar then the example. I have the following in my manifest: instrumentationxmlns:android= http://schemas.android.com/apk/res/ android android:targetPackage=com.novoda.runbuddy android:name=android.test.InstrumentationTestRunner android:label=testInst / And I start theinstrumentationlike this: adb shell am instrument -e class com.android.samples.AllTests -w com.novoda.runbuddy/android.test.InstrumentationTestRunner I get the following error message: INSTRUMENTATION_RESULT: shortMsg=Unable to instantiateinstrumentation ComponentInfo{com.novoda.runbuddy/ android.test.InstrumentationTestRunner}: java.lang.ClassNotFoundException: android.test.InstrumentationTestRunner in loader [EMAIL PROTECTED] INSTRUMENTATION_RESULT: longMsg=java.lang.RuntimeException: Unable to instantiateinstrumentationComponentInfo{com.novoda.runbuddy/ android.test.InstrumentationTestRunner}: java.lang.ClassNotFoundException: android.test.InstrumentationTestRunner in loader [EMAIL PROTECTED] INSTRUMENTATION_CODE: 0 I tried different combination and can not make the above work. The documentation is sparse so I am not sure where I am going wrong. Why would I get a class not found on android.test? There is no need for permission from what I take with the new SDK. Any ideas? ./Acsia --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: alwaysRetainTaskState - Some questions
On Aug 25, 2:43 pm, code_android_festival_way [EMAIL PROTECTED] wrote: From that point on the application saves the last opened activity. So this seems to be a bug caused by the installation through Eclipse right? If it's just that after starting from eclipse it starts from its original state then no, it's not a bug, it's working as designed -- when you start from eclipse it re-installs the app, so it should start in its initial state. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] ServiceTestCase instrumentation and remote callbacks
I am trying to add unit tests to a service of mine that utilizes remote callbacks (managed by the service with RemoteCallbackList). I know that this service functions properly already, I am just trying to formalize with a unit test as I have recently discovered how to make instrumentation work. The service otherwise works fine except that it seems that the service callbacks never fire on the observing side. My simple test case looks similar to the following sample: -- begin paste -- public void testMyService() throws RemoteException { IMyService svc = IMyService.Stub.asInterface(bindService(new Intent(this, MyService.class))); svc.registerObserver(new IMyServiceObserver.Stub() { public void onFoo() { Log.d(TAG, Here I am !); synchronized(MyServiceTest.this) { mDone = true; MyServiceTest.this.notify(); } } }); svc.doStuffThatWillEventuallyCallBack(); synchronized(this) { while (mDone == false) { try { wait(); } catch (InterruptException e) {} } } } -- end paste -- Here I am is never logged, in this case and the call to adb shell am never returns. I have verified that doStuffThatWillEventuallyCallback() does actually return, and the test thread enters the synchronized wait loop correctly. My suspicion is that the binder's normal transaction thread loop is somehow not the same in the context of an instrumented test, however I have no way to validate this. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: MapView and Zoom Control in 0.9 SDK
This new code isn't working for me. The first set worked. On Mon, Aug 25, 2008 at 6:48 PM, adamrocker [EMAIL PROTECTED] wrote: Is this a bug? Android can't recognize the difference between the motion of long touch action and the motion of move action. It is different between the long touch action and the move action, isn't it? So, I modified my code without using onInterceptTouchEvent. /*-- ZoomMapView.java ---*/ public class ZoomMapView extends MapView implements OnLongClickListener { private static final int FILL = ViewGroup.LayoutParams.FILL_PARENT; private boolean moving; private ZoomControls zoomControls; public ZoomMapView(Context context, String apiKey) { super(context, apiKey); // long click settings. moving = false; setClickable(true); setLongClickable(true); setOnLongClickListener(this); // ZoomControls settings. zoomControls = (ZoomControls) getZoomControls(); zoomControls.setLayoutParams(new ViewGroup.LayoutParams(FILL, FILL)); zoomControls.setGravity(Gravity.BOTTOM + Gravity.CENTER_HORIZONTAL); addView(zoomControls); } // OnLongClickListener interface method public boolean onLongClick(View arg0) { if (!moving) { displayZoomControls(true); } return true; } @Override public boolean onTouchEvent(MotionEvent me) { switch (me.getAction()) { case MotionEvent.ACTION_MOVE: moving = true; break; case MotionEvent.ACTION_UP: if (moving) { zoomControls.hide(); } moving = false; break; } return super.onTouchEvent(me); } } This code doesn't trigger another behavior like onInterceptTouchEvent. What do you think about my code? On 8月26日, 午前2:32, 6real [EMAIL PROTECTED] wrote: Thanks for your code ! I miss setClickable and I also found setEnabled. My code ran on the previous SDK ... I don't know if it is usefull to indicate this on the migration tips... On 25 août, 19:24, marcel-182 [EMAIL PROTECTED] wrote: Thanks for the code. I have just one remark: onInterceptTouchEvent(MotionEvent ev) has to return true in order to be able to scroll while the ZoomControls are being displayed. But I'm not sure if that triggers another bad behaviour :-). On 25 Aug., 17:36, adamrocker [EMAIL PROTECTED] wrote: Hi. I'm so sorry for my code to confuse all of you. This is the shortest sample. /* BEGIN --*/ /*-- ZoomControlMapSample.java ---*/ public class ZoomControlMapSample extends MapActivity { private static final String API_KEY = mapapikey; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MapView zmv = new ZoomMapView(this, API_KEY); setContentView(zmv); } @Override protected boolean isRouteDisplayed() { return false; } } /*-- ZoomMapView.java ---*/ public class ZoomMapView extends MapView implements OnLongClickListener { private static final int FILL = ViewGroup.LayoutParams.FILL_PARENT; public ZoomMapView(Context context, String apiKey) { super(context, apiKey); // long click settings. setClickable(true); setLongClickable(true); setOnLongClickListener(this); // ZoomControls settings. ZoomControls zoomControls = (ZoomControls) getZoomControls(); zoomControls.setLayoutParams(new ViewGroup.LayoutParams(FILL, FILL)); zoomControls.setGravity(Gravity.BOTTOM + Gravity.CENTER_HORIZONTAL); addView(zoomControls); } // OnLongClickListener interface method public boolean onLongClick(View arg0) { displayZoomControls(true); return false; } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { onTouchEvent(ev); return false; } } /*-- AndroidManifest.java ---*/ ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.adamrocker.android.sample.map.zoom application android:icon=@drawable/icon android:label=@string/ app_name activity
[android-developers] Re: MediaRecord Audio - working example? / raw data stream onPictureTaken()? / Bug in Pictures application?
In the future, please only include one topic per new post/thread. It gets very confusing to handle posts like this that have multiple question in vastly different areas of the platform. (2) - no, the returned data stream should not be null. Are you doing an actual null test or just assuming it to be based on the null pointer error you're getitng in (3)? (3) - The issue appears to be that in your ContentValue bundle you're not including a value for MediatStore.Images.Media.BUCKET_ID. This isn't very well documented and I'm not even sure what BUCKET_ID is using it for, but in my testing, specifying an arbitrary value for it eliminates the NPE in Pictures. I'll also note that somewhat counter- intuitively MediaStore.Images.Media.TITLE is the name of the image in Pictures. I've posted source at http://groups.google.com/group/android-developers/web/CameraApiTest.zip , which is an extension of code that Megha provided before. Cheers, Justin Android Team @ Google On Aug 24, 3:20 pm, code_android_festival_way [EMAIL PROTECTED] wrote: I've got two questions. 1) Is there a working example for recording audio with the MediaRecorder? At the moment I'm using the following setup but it doesnt work: http://paste.pocoo.org/show/83242/ Error: 08-24 19:27:18.675: ERROR/Database(178): Error inserting title=Content Creation No.5 date_added=1219598838 _display_name= album_id=2 title_key= - E C O 1 C O - K 1 ) O 9 E C C E „ artist_id=3 using INSERT INTO audio_meta(title, date_added, _display_name, album_id, title_key, artist_id) VALUES(?, ?, ?, ?, ?, ?); I've tried the example provided in the docs (Media API) but that doesn't work at all. It would be nice if someone could provide a working example. 2) Is it normal that the raw data stream returned by onPictureTaken(...) is null? 3) I'm taking pictures as above mentioned. After that I'm saving the available jpeg stream into the image ContentProvider which works fine. Now I'm leaving my app and try to start the Pictures application from the home screen. And now I get the following error message: http://img.skitch.com/20080824-mrbc7yuhfh7an5ynndj9hm6twp.jpg Here is the error from the logs: 08-25 00:15:34.007: ERROR/AndroidRuntime(220): java.lang.RuntimeException: Unable to resume activity {com.android.camera/com.android.camera.GalleryPicker}: java.lang.NullPointerException I can savely say that I'm calling camera.stopPreview() and camera.release() so there shouldn't be a problem with the camera. What else could be wrong? Here is the part where I'm saving my jpeg byte[] into the ContentProvider: http://paste.pocoo.org/show/83246/ Regards! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] ksoap2, android and cxf
i'm currently write a webservice with cxf and i want to consume it with android. so i decided to use ksoap2 (with se standard extension). my android code : SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); request.addProperty(register, test); // what kind of name may i need to use? SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.setOutputSoapObject(request); Transport androidHttpTransport = new HttpTransportSE (URL); androidHttpTransport.debug = true; try { androidHttpTransport.call(SOAP_ACTION, envelope); Object result = envelope.bodyIn; ... my android client send this xml request : v:Envelope xmlns:i=http://www.w3.org/2001/XMLSchema-instance; xmlns:d=http://www.w3.org/2001/XMLSchema; xmlns:c=http:// schemas.xmlsoap.org/soap/encoding/ xmlns:v=http:// schemas.xmlsoap.org/soap/envelope/v:Header /v:Bodyregister id=o0 c:root=1register i:type=d:stringtest/register/ register/v:Body/v:Envelope but my service throw in exception with this message : INFO LoggerInterceptor - | class : [EMAIL PROTECTED] | method name : register | arguments : | 0 - null | exception : parameter is null | time execution : 0 ms how may i recieve test instead of null from parameter value? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Activity Question
Hi Justin, Any update related to this issue? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Activity Question
No, I would have provided one if there was, :-) . But if your question is if its still be looked at, the answer is yes. Cheers, Justin Android Team @ Google On Aug 25, 5:46 pm, Gil [EMAIL PROTECTED] wrote: Hi Justin, Any update related to this issue? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] change timezone setting for system
I called TimeZone.setDefault() for changing system's timezone, but failed. Is there an API for me to change system's timezone? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Problems Sending SMS Text Messages in 0.9
This is a bug in the current SDK that is already fixed and the fix will be included in a future SDK. The sentIntent is intended to be optional as the documentation indicates. Cheers, Justin Android Team @ Google On Aug 23, 12:07 am, Reto [EMAIL PROTECTED] wrote: Ok, I think I've figured it out. The 4th parameter (PendingIntent sentIntent) is *not* optional. If you pass in null you get the error log I've shown below. Is this designed behavior? If so, it's probably worth rewording the documentation so that it doesn't imply the parameter can be set to null. Caused by: java.lang.NullPointerException at android.os.Parcel.readException(Parcel.java:1066) at android.os.Parcel.readException(Parcel.java:1048) at com.android.internal.telephony.gsm.ISms$Stub $Proxy.sendRawPdu(ISms.java:286) at android.telephony.gsm.SmsManager.sendRawPdu(SmsManager.java: 245) at android.telephony.gsm.SmsManager.sendTextMessage(SmsManager.java:78) at com.paad.ch9test.MyActivity.onCreate(MyActivity.java:34) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1084) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2038) ... 11 more Nice work on the inter-emulatorSMStransmission by the way. Very helpful. Cheers Reto On Aug 22, 10:43 pm, Megha Joshi [EMAIL PROTECTED] wrote: On Fri, Aug 22, 2008 at 3:34 AM, Reto [EMAIL PROTECTED] wrote: Has anyone had successsendingSMStextmessagesin the new 0.9 beta? The following code used to work fine, but now I'm getting a null pointer exception on calling sendTextMessage: SmsManager smsManager = SmsManager.getDefault(); String myMessage = Android supports programmaticSMSmessaging!; String sendTo = 55512345; smsManager.sendTextMessage(sendTo, null, myMessage, null, null); I've added permissions for both SEND_SMS and WRITE_SMS in the manifest. What is the error message in logcat? Android supportssendingSMSbetween two emulators... If you start two emulators and replace the sendTo string with the port number of the second emulator( assuming you are starting this app from first emulator) ...you will seeSMSreceived notification pop up in the second emulator ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] change item layout when selected in a ListView
Hello everyone. I have a question about the ListView. Example: In a ListView, there are many items. If I press up/down key to select one item, what I want is show a button on the selected view, and if the selected item is unselected, the button will be hide. How can I change the layout when the item gets selected? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: change item layout when selected in a ListView
Andrew wrote: I have a question about the ListView. Example: In a ListView, there are many items. If I press up/down key to select one item, what I want is show a button on the selected view, and if the selected item is unselected, the button will be hide. How can I change the layout when the item gets selected? You might not be able to wholesale change the layout, but you can make widgets visible/invisible/gone via setVisibility(). A heavier approach would be to make each row in the list a ViewFlipper, or include a ViewFlipper, so that you can swap out a button-showing and a button-hiding view upon selection. I would think hiding a single button would be less resource-intensive than using a ViewFlipper, but I may be wrong. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.1 Published! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Does 0.9-SDK support Camera feature now??
Thanks for the reply. Will the emulator support camera in the next version or what hardware can I use for testing camera api, real mobile phone? and I find the http://www.tomgibara.com/android/camera-source; for camera capture. But it cpature the image via the http, not from Camera API. It works like this. USB camera device - webcam2000(-run on my pc) - http - (android sdk-)HttpURLConnection - View. Is it passible to link the android.hardware.Camera via http??. So that I can use it by Camera API, not by HttpURLConnection. like this: USB camera device - webcam2000(-run on my pc) - http - (android sdk-)android.hardware.Camera - use Camera API - View. Brad. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: change item layout when selected in a ListView
Thank you very much. It is helpful. And I have another question. I defined the List item in a xml like below: RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=fill_parent android:padding=5px TextView android:id=@+id/reminder_item_text android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignParentRight=true / Button android:id=@+id/reminder_item_btn android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignParentRight=true / /RelativeLayout You know, the listview would hold more than one item. Every item has a button with the same id reminder_item_btn. Then how can i get to know which button is pressed? On Aug 26, 10:03 am, Mark Murphy [EMAIL PROTECTED] wrote: Andrew wrote: I have a question about the ListView. Example: In a ListView, there are many items. If I press up/down key to select one item, what I want is show a button on the selected view, and if the selected item is unselected, the button will be hide. How can I change the layout when the item gets selected? You might not be able to wholesale change the layout, but you can make widgets visible/invisible/gone via setVisibility(). A heavier approach would be to make each row in the list a ViewFlipper, or include a ViewFlipper, so that you can swap out a button-showing and a button-hiding view upon selection. I would think hiding a single button would be less resource-intensive than using a ViewFlipper, but I may be wrong. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.1 Published! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: change item layout when selected in a ListView
I use below code to get the button click event: Button b = (Button)v.findViewById(R.id.reminder_item_btn); b.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Log.d(, timeString); } }); On Aug 26, 10:41 am, Andrew [EMAIL PROTECTED] wrote: Thank you very much. It is helpful. And I have another question. I defined the List item in a xml like below: RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=fill_parent android:padding=5px TextView android:id=@+id/reminder_item_text android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignParentRight=true / Button android:id=@+id/reminder_item_btn android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignParentRight=true / /RelativeLayout You know, the listview would hold more than one item. Every item has a button with the same id reminder_item_btn. Then how can i get to know which button is pressed? On Aug 26, 10:03 am, Mark Murphy [EMAIL PROTECTED] wrote: Andrew wrote: I have a question about the ListView. Example: In a ListView, there are many items. If I press up/down key to select one item, what I want is show a button on the selected view, and if the selected item is unselected, the button will be hide. How can I change the layout when the item gets selected? You might not be able to wholesale change the layout, but you can make widgets visible/invisible/gone via setVisibility(). A heavier approach would be to make each row in the list a ViewFlipper, or include a ViewFlipper, so that you can swap out a button-showing and a button-hiding view upon selection. I would think hiding a single button would be less resource-intensive than using a ViewFlipper, but I may be wrong. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.1 Published! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Problems Sending SMS Text Messages in 0.9
Ok, I think I've figured it out. The 4th parameter (PendingIntent sentIntent) is *not* optional. If you pass in null you get the error log I've shown below. Is this designed behavior? If so, it's probably worth rewording the documentation so that it doesn't imply the parameter can be set to null. Caused by: java.lang.NullPointerException at android.os.Parcel.readException(Parcel.java:1066) at android.os.Parcel.readException(Parcel.java:1048) at com.android.internal.telephony.gsm.ISms$Stub $Proxy.sendRawPdu(ISms.java:286) at android.telephony.gsm.SmsManager.sendRawPdu(SmsManager.java: 245) at android.telephony.gsm.SmsManager.sendTextMessage(SmsManager.java:78) at com.paad.ch9test.MyActivity.onCreate(MyActivity.java:34) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1084) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2038) ... 11 more Nice work on the inter-emulator SMS transmission by the way. Very helpful. Cheers Reto On Aug 22, 10:43 pm, Megha Joshi [EMAIL PROTECTED] wrote: On Fri, Aug 22, 2008 at 3:34 AM, Reto [EMAIL PROTECTED] wrote: Has anyone had success sending SMS text messages in the new 0.9 beta? The following code used to work fine, but now I'm getting a null pointer exception on calling sendTextMessage: SmsManager smsManager = SmsManager.getDefault(); String myMessage = Android supports programmatic SMS messaging!; String sendTo = 55512345; smsManager.sendTextMessage(sendTo, null, myMessage, null, null); I've added permissions for both SEND_SMS and WRITE_SMS in the manifest. What is the error message in logcat? Android supports sending SMS between two emulators... If you start two emulators and replace the sendTo string with the port number of the second emulator( assuming you are starting this app from first emulator) ...you will see SMS received notification pop up in the second emulator ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: maps behind proxy 0.9 beta
Hi Jokochi, I have added exceptions for PHP.exe in the firewall, still does'nt work. Could you please give me the exact steps of how you did it on windows so that i can check where am i messing it. On Aug 22, 7:06 pm, jokochi [EMAIL PROTECTED] wrote: Yes, I am able to see the map. After that I checked the script working on Windows. Have you install PHP5 and run it on command prompt(cmd.exe) ? Windows PHP can be found here.http://www.php.net/get/php-5.2.6-win32-installer.msi/from/a/mirror I installed it with default setting. Please do not forget to turn off the firewall. On 8月22日, 午後6:43, shan [EMAIL PROTECTED] wrote: Thanks Jokochi, still can't get it same problems. Please update if you could. Were you able to display the maps? On Aug 22, 1:10 pm, jokochi [EMAIL PROTECTED] wrote: Hi Shan, I am sorry I did not test with windows so I can not answer you so far. But at least your PC has to be installed PHP5. Regarding port no, only if your site proxy is the same PC which runs emurator, you have to change the port no. In my example mentioned before, it is running the PHP script and emulator on local pc (xxx.yyy.com). The connection is like this emulator (xxx.yyy.com:???) - php script (xxx.yyy.com:8080) - proxy (aaa.bbb.com:8000) - (Google?) Of course you can change the local port and run script on the different PC. Ahh, I found a bug in my code. Please fix this line; wrong: if (isset($argv[2]) (preg_match(^\d+$, $argv[2]))) correct: if (isset($argv[2]) (preg_match(/^\d+$/, $argv[2]))) Thank you. On 8月22日, 午後3:58, shan [EMAIL PROTECTED] wrote: Hi Jokochi I am using a Windows machine, do i need to setup something to execute the script? Also my proxy port no is 8080, i could make out that you were routing to 8080 but mine already runs on the same. I tried to execute it on IE7 but it returned an open-save dialog which keeps looping. I got the browser up but the maps won't respond. Thanks for the script. Any solutions. On Aug 22, 11:04 am, shan [EMAIL PROTECTED] wrote: Hi Justin Now the browser works in the emulator but not the maps. Any suggestions to get the maps going. On Aug 21, 1:34 am, Justin (Google Employee) [EMAIL PROTECTED] wrote: Does the browser work in the emulator for you? The emulator doesn't deal well with being behind a proxy and my guess would be that you aren't able to use any data at all. Cheers, Justin Android Team @ Google On Aug 20, 5:40 am, shan [EMAIL PROTECTED] wrote: Can the maps API work behind proxy in the 0.9 beta?- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- 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 [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: maps behind proxy 0.9 beta
Also, did you see the maps via the maps application or on the browser? On Aug 22, 7:06 pm, jokochi [EMAIL PROTECTED] wrote: Yes, I am able to see the map. After that I checked the script working on Windows. Have you install PHP5 and run it on command prompt(cmd.exe) ? Windows PHP can be found here.http://www.php.net/get/php-5.2.6-win32-installer.msi/from/a/mirror I installed it with default setting. Please do not forget to turn off the firewall. On 8月22日, 午後6:43, shan [EMAIL PROTECTED] wrote: Thanks Jokochi, still can't get it same problems. Please update if you could. Were you able to display the maps? On Aug 22, 1:10 pm, jokochi [EMAIL PROTECTED] wrote: Hi Shan, I am sorry I did not test with windows so I can not answer you so far. But at least your PC has to be installed PHP5. Regarding port no, only if your site proxy is the same PC which runs emurator, you have to change the port no. In my example mentioned before, it is running the PHP script and emulator on local pc (xxx.yyy.com). The connection is like this emulator (xxx.yyy.com:???) - php script (xxx.yyy.com:8080) - proxy (aaa.bbb.com:8000) - (Google?) Of course you can change the local port and run script on the different PC. Ahh, I found a bug in my code. Please fix this line; wrong: if (isset($argv[2]) (preg_match(^\d+$, $argv[2]))) correct: if (isset($argv[2]) (preg_match(/^\d+$/, $argv[2]))) Thank you. On 8月22日, 午後3:58, shan [EMAIL PROTECTED] wrote: Hi Jokochi I am using a Windows machine, do i need to setup something to execute the script? Also my proxy port no is 8080, i could make out that you were routing to 8080 but mine already runs on the same. I tried to execute it on IE7 but it returned an open-save dialog which keeps looping. I got the browser up but the maps won't respond. Thanks for the script. Any solutions. On Aug 22, 11:04 am, shan [EMAIL PROTECTED] wrote: Hi Justin Now the browser works in the emulator but not the maps. Any suggestions to get the maps going. On Aug 21, 1:34 am, Justin (Google Employee) [EMAIL PROTECTED] wrote: Does the browser work in the emulator for you? The emulator doesn't deal well with being behind a proxy and my guess would be that you aren't able to use any data at all. Cheers, Justin Android Team @ Google On Aug 20, 5:40 am, shan [EMAIL PROTECTED] wrote: Can the maps API work behind proxy in the 0.9 beta?- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -- 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 [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: REST + JSON Web Service Client
Hi, thanks for the reply, the thing I was asking was how to send the data as stream...i.e I have this JSON string and I need to send it to a web service in the form of a stream...I already tried using the above method and was fine with that..but the requirement is to send as a serialized stream Any idea bout that Hope to hear from you soon!!! On Aug 25, 11:12 pm, Megha Joshi [EMAIL PROTECTED] wrote: This might help... JSONObject mLocationJSON = createLocationJSON(mLatitude, mLongitude, mDateTime); postLocationJSON(SERVER_URL, mLocationJSON); /** * @param mUrl The URL of location tracking server. * @param mLocationJSON The location data with time in JSON format. */ public void postLocationJSON(String mUrl, JSONObject mLocationJSON) { HttpClient httpClient = new DefaultHttpClient(); HttpPost postMethod = new HttpPost(mUrl); try { // prepare parameters HttpParams params = new BasicHttpParams(); params.setParameter(locationJSON, mLocationJSON.toString()); postMethod.setParams(params); httpClient.execute(postMethod); Log.i(TAG, Post request, data: + mLocationJSON.toString()); } catch (Exception e) { Log.e(Exception, e.getMessage()); } finally { postMethod.abort(); } } /** * @param mLatitude The latitude data received from location update sent by *LocationManager Service. * @param mLongitude The longitude received from location update sent by *LocationManager Service. * @param mDateTime The DateTime at which location update was sent. * @return JSONObject The JSONObject holding latitude,longitude reported by * the LocationManager Service and DateTime in RFC3339 format. */ public JSONObject createLocationJSON(double mLatitude, double mLongitude, String mDateTime) { JSONObject mLocationJSON = new JSONObject(); try { mLocationJSON.put(latitude, mLatitude); mLocationJSON.put(longitude, mLongitude); mLocationJSON.put(date, mDateTime); } catch (JSONException ex) { Log.e(TAG, Error in creating Location JSON object.); } return mLocationJSON; } 2008/8/25 Baran [EMAIL PROTECTED] Hello Jeffrey, I was wondering if you could provide me something about how you appended your JSON string to the web service request. I am trying to communicate with this rest web service via POST method. But I am unable to identify how to append the JSON string as the parameters. Object.setParameter is not working in this scenario... Hope to hear from you soon!! On Aug 21, 10:12 am, Jeffrey Sharkey [EMAIL PROTECTED] wrote: Just a heads up that I've been using simpleJSON with Android, and it's working pretty well. It's somewhat nicer than the defaultJSON included in the SDK because it's iterator-able, making for slick code: for(JSONValue value : (JSONArray)JSONValue.parse(string)) { JSONObject obj = (JSONObject)value; ... } http://www.json.org/java/simple.txt j On Aug 20, 11:00 pm, Baran [EMAIL PROTECTED] wrote: Hi, Thanks for the reply, actually I was confused with how we can use JSON. I suppose this is for manipulating the response we get after a successfulwebservicerequest. Please correct me if I am wrong. Still new to this thing. On Aug 20, 7:00 pm, Mark Murphy [EMAIL PROTECTED] wrote: Baran wrote: Hi, I need to access a .NetwebserviceinRestformat usingJSON. I m pretty new to this concept and very much confused about how this works Any one who can give an overview of the two. I need the steps that I need to follow to useJSON. Right now my doubt is how to useJSONto grab to output. Lets say we create a httpclientand it get the respone now what? How can we use theJSONobject to manipulate the response... There is aJSONparser built into Android: http://code.google.com/android/reference/org/json/package-summary.html And there is an HTTPclientbuilt into Android: http://code.google.com/android/reference/org/apache/http/package-summ... though you may wish to view the HttpClient documentation here: http://hc.apache.org/ Both of these are open source projects with their own documentation, on top of what is in Android. Both are usable in other Java projects outside of Android. If you have specific questions regarding the use of one or the other, particular as it pertains to Android, write back with the details! -- Mark Murphy (a Commons Guy)http://commonsware.com Warescription: All titles, revisions, ebook formats, just $35/year --~--~-~--~~~---~--~~ You received this message because