[android-developers] Re: Application storage data growing
I guess we're talking about /data/data/yourpackagenamesgoeshere Did you check there? You can use adb -d shell to open a shell on your device and the cd there. adb -d shell cd /data/data/yourpackagenamesgoeshere ls -l Btw. Do you use WebView in your app? It caches stuff until you remove it by calling WebView.clearCache() or tell WebView not to cache. On Fri, Feb 6, 2009 at 11:45 PM, Rmac ry...@mac.com wrote: Thanks Dianne. The odd thing is that I am NOT creating any files. And let me make sure we are talking the same thing... when I say data, I don't mean the data directory... I am talking about going to Settings/Applications/Manage applications/myapp/Storage/Data... if that is the data directory then we are talking about the same thing. What else could go there besides files that are explicitly created by the app? Preferences? SQLite databases? Anything else? The data storage value seems to gradually grow over time while using the app... from initial size of 76K to nearly a meg. On Feb 6, 11:51 am, Dianne Hackborn hack...@android.com wrote: Unfortunately it's a little tricky, because only your app (and some very very low-level parts of the system) can touch your data. You can, however, just add some code to your app that iterates through your data directories with the standard Java File APIs and prints out what it finds. On Fri, Feb 6, 2009 at 8:36 AM, Rmac ry...@mac.com wrote: I've had debugging on from the beginning. What I need is something that can tell me exactly what is in the application's data area that Android reports via Settings for managing applications. I am sure my application is adding to it somehow, but I have no handle to tell what content is stored there. On Feb 5, 5:08 am, Chander Pechetty cspeche...@gmail.com wrote: Not sure if you can do this, but check outhttp:// code.google.com/android/intro/develop-and-debug.html#developin... to understand the tools and limitations -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: WebView responding to touch events
Mark, maybe you should post some code? On Thu, Feb 5, 2009 at 4:36 PM, Mark Nuetzmann mark.nuetzm...@gmail.comwrote: I have an Activity that has a WebView that contains some simple html that allows me to display a Terms Conditions link that if touched or clicked calls another activity. My problem is unless the link in the WebView has focus (ie, the text is wrapped with that little orange focus) I cannot touch the link and have it work. If any other view on the activity has focus, touching the WebView with the link does nothing. The other Views that had focus loose focus, but the WebView does not receive focus. I have tried calling setFocusable(true) and setFocusableInTouchMode(true) but that does not do any good... I would really like to know what you have to do to get a WebView to respond to touch events without using the trackball to scroll to the view before touching it. thank you, Mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: WebView starts with a delay
Nice video - love the transitional effect between the screens ;-) How did you implement them? On Sat, Feb 7, 2009 at 2:03 AM, Fred Grott(shareme) fred.gr...@gmail.comwrote: The delay is it is processing these items in your head..loading javascript, css and etc. The way I handled it was setting background color to zero for transparency and using style to load a application logo image that user sees while stuff loads. You will not be able to speed it up however. You can see video examples here: http://www.youtube.com/user/memine44 On Feb 6, 6:48 pm, Inderjeet Singh inder...@gmail.com wrote: I am using WebView in a number of screens in my application, and notice that it takes couple of seconds when starting up for the first time. What can I do to speed it up besides trying to create one in a separate thread beforehand? Thanks Inder --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: access to class not allowed
So from which version, rc1, 1.0 or cupcake, the bug in Dalvik is fixed? Just want to make it easier when communicating with the author of the apk file. Thanks, Johnny On Feb 7, 4:22 am, fadden fad...@android.com wrote: On Feb 6, 7:38 am, johnny johnny...@gmail.com wrote: I get an apk file from somewhere. I tried to install it the emulator successfully. (The emulator is built from the latest code in AOSP which should be cupcake or later). But I can't launch the application from the GUI. It complains The application xxx has stopped unexpectedly. After checking the logcat, I find the message access to class not allowed. It seems that that process is not allowed to instantiate the Activity class. This usually happens when the class that the app framework is trying to instantiate isn't declared public. In some older versions of Dalvik this was mistakenly allowed, so if the APK is old enough it might need to be rebuilt with a corrected class declaration. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to pass arguments to emulator using ADT 0.9
There's a line Additional Emulator command line options and the input box is actually below the line but is invisible. You can move the focus to Disable Boot Animation checkbox and press TAB to focus on the input box,then you can set your option. Although we can set the argument this way,I still can't launch as error Failed to find a VM compatible with target 'Android 1.5'. Launch aborted B.R Tony On Jan 30, 9:29 pm, Breno breno.min...@gmail.com wrote: Hi, After generatingADT0.9, using Cupcake SDk, i need to specify a sdcard to emulator, in eclipse. InADT0.8 there is a field in Run Configuration, but inADT0.9 no. How can i do that? Thanks a lot Breno --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] After install ADT0.9,failed to launch APP as no VM compatible with android 1.5
The error info is: [2009-02-07 18:11:06 - CameraTest] -- [2009-02-07 18:11:06 - CameraTest] Android Launch! [2009-02-07 18:11:06 - CameraTest] adb is running normally. [2009-02-07 18:11:06 - CameraTest] Launching: com.CameraTest [2009-02-07 18:11:06 - CameraTest] Failed to find a VM compatible with target 'Android 1.5'. Launch aborted. Who knows any clue of such problem? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Making ListView stop on a finger press
How can I make the ListView immediately stop scrolling on a finger down event? It keeps scrolling if I give it a big swipe and doesn't stop immediately if my finger is pressed down again. Any idea? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Native code is not supported in the current SDK.
On Fri, Feb 6, 2009 at 2:29 AM, Dave Sparks davidspa...@android.com wrote: We do intend to support native code development in the future. We just want to take time to refine the native API's before we make them public. There is nothing more painful than changing an API because you overlooked something and then having to support the legacy API for years to come. With all respect, there is at least one thing more painful than that, as Microsoft could tell you: not providing sufficient API's in a timely fashion, having app developers work around obvious deficiencies, and then being stuck supporting those applications anyway. IMO, based on the traffic on the various Android lists, you are risking having that happen. The specific scenario would be that a group of developers (probably game developers) get together and agree on a native extension mechanism and work together to use it, and it becomes a de facto standard. As games are probably your most important application group and as they are the most likely to require native speed, you could get yourself into a real pickle unless you release something very, very soon. If it is just a couple of apps that do this, no problem. If it is many, if it is your most popular apps, breaking them may not be an option for you. Something to mull over as Google thinks about scheduling this particular platform change and worry about getting it just right. We all might be better served if you stuck with JNI, and if that's not good enough, some clear guidelines about what underlying APIs should and should not be used by native code would be a very, VERY good idea - and getting those guidelines out very VERY soon an even better one. My two cents. Worth at least what you paid for it, etc, etc. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Sensors: Does orientation depend on acceleration?
I played around with the G1 sensors a bit and my impression was that the orientation and the gravity sensor relate. Maybe the orientation sensor even just uses the acceleration data to calculate the orientation? What led me to this question: when you try keep the device in the same orientation and move/shake it, the orientation values are very much affected. Thanks, Markus -- http://jars.de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Market statistics for apps targeting The Netherlands are not correct
That seems to have been a different problem. As of now, the market statistics have still not been updated. Kind Regards, Ronald On Feb 6, 11:27 pm, blindfold seeingwithso...@gmail.com wrote: Maybe Google fixed things a moment ago? I had a related issue that although I live in The Netherlands, I could not even find the Dutch ING Wegwijzer (for finding local ATMs) today when searching Android Market with my dev phone 1. However, now I suddenly can, and I also find PimPam (did not try it though). Regards On Feb 6, 9:24 pm, Ronald van der Lingen lin...@jsource.nl wrote: Thanks for the update. I hope you can find the cause of the problem and that the download count for the last week can still be recovered. Kind Regards, Ronald On Feb 6, 9:00 pm, Justin (Google Employee) j...@google.com wrote: There does appear to be some problem here. We're looking into it further. 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 android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] SharedPreferences - is it secure?
Hi, i'm implementing a feature that requires a password, is it safe to store using SharedPreferences.Editor? Is there another recommended way for storing passwords? 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 android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Making ListView stop on a finger press
Okay more on this - it seems my custom view for each row inside the list is grabbing the touch event and not passing it through to the list. I have set setItemsCanFocus on the ListView to True (as its required) and now I can't make the listview stop it's scrolling on a tap. It only stops when it stops scrolling eventually. Any idea how I can pass the touch back to its parent? I've tried returning false from a TouchListener as well but no luck On Feb 7, 11:56 am, Gw1921 guidedw...@googlemail.com wrote: How can I make the ListView immediately stop scrolling on a finger down event? It keeps scrolling if I give it a big swipe and doesn't stop immediately if my finger is pressed down again. Any idea? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] SlidingDrawer not working with RC33
It appears that android.internal.widget.SlidingDrawer widget had changed between RC30 and RC33. On RC33 it fails to inflate the layout XML complaining that: The handle attribute is required and must refer to a valid child This is the XML I am trying to inflate: com.android.internal.widget.SlidingDrawer android:id=@+id/drawer android:layout_width=fill_parent android:layout_height=wrap_content android:topOffset=5px android:bottomOffset=7px android:handle=@+id/playlistHeader android:content=@+id/playList ImageView android:id=@id/playlistHeader android:focusable=true android:clickable=true android:scaleType=center android:src=@drawable/ic_mp_current_playlist_btn android:layout_height=56dip android:layout_width=fill_parent / ListView android:id=@+id/playList android:layout_width=fill_parent android:layout_height=fill_parent android:background=@color/grid_dark_background/ /com.android.internal.widget.SlidingDrawer The XML above has both the content and the handle attribute and worked fine in RC30? Does anyone know what has changed and how to fix it? Stefan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Pygame on Android
Hey hi, Does anyone have any guess about, any support for pygame based applications/games on Android. If someone has ported a game made in pygame to Android platform, or knows of any such way. It would be great if you could share it. Thanks in advance!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SlidingDrawer not working with RC33
Can you please report this issue in http://b.android.com/ ? (a plain copy-paste will do). Thanks, JBQ On Sat, Feb 7, 2009 at 6:54 AM, Stefan skyntc...@gmail.com wrote: It appears that android.internal.widget.SlidingDrawer widget had changed between RC30 and RC33. On RC33 it fails to inflate the layout XML complaining that: The handle attribute is required and must refer to a valid child This is the XML I am trying to inflate: com.android.internal.widget.SlidingDrawer android:id=@+id/drawer android:layout_width=fill_parent android:layout_height=wrap_content android:topOffset=5px android:bottomOffset=7px android:handle=@+id/playlistHeader android:content=@+id/playList ImageView android:id=@id/playlistHeader android:focusable=true android:clickable=true android:scaleType=center android:src=@drawable/ic_mp_current_playlist_btn android:layout_height=56dip android:layout_width=fill_parent / ListView android:id=@+id/playList android:layout_width=fill_parent android:layout_height=fill_parent android:background=@color/grid_dark_background/ /com.android.internal.widget.SlidingDrawer The XML above has both the content and the handle attribute and worked fine in RC30? Does anyone know what has changed and how to fix it? Stefan -- Jean-Baptiste M. JBQ Queru Android Engineer, 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 android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] WebView-Security/Privacy
For those developing webview apps.. Recommended Security and Privacy Settings: webVew websettings: savePassword false save form data false Save username password pair allowing multiuser using SQlite set an app username password pair to ask on app start up. This avoids the concerns complained about with Loopt and Google Latitude. This way you prepare app for being borrowed among device owner's friends and other privacuy/security concerns. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SharedPreferences - is it secure?
SQLite stores user data by the app package name. if you did a db scehma that allowed for more than one user than it would be a safe way to go assuming that your popular app is borrowed along with device among friends.. On Feb 7, 8:31 am, Teo teomina...@gmail.com wrote: Hi, i'm implementing a feature that requires a password, is it safe to store using SharedPreferences.Editor? Is there another recommended way for storing passwords? 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 android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SharedPreferences - is it secure?
Thanks for the reply. I'll only have one password per device - as for the device borrowing (if i understood correctly what you said) i'm not sure i can do anything about that :) The thing is, i asked this question becase it's called 'Shared'Preferences. But i've seen that it also has a MODE_PRIVATE parameter, and according to the docs: the created file can only be accessed by the calling application (or all applications sharing the same user ID). And again, according to the docs: Each Android package (.apk) file installed on the device is given its own unique Linux user ID, creating a sandbox for it and preventing it from touching other applications (or other applications from touching it). This user ID is assigned to it when the application is installed on the device, and remains constant for the duration of its life on that device. So i guess this should be enough, unless i'm missing something... (SQLite would be a nice solution but it doesn't seem natural to me for individual settings) Thanks, Teo On Sat, Feb 7, 2009 at 5:29 PM, Fred Grott(shareme) fred.gr...@gmail.comwrote: SQLite stores user data by the app package name. if you did a db scehma that allowed for more than one user than it would be a safe way to go assuming that your popular app is borrowed along with device among friends.. On Feb 7, 8:31 am, Teo teomina...@gmail.com wrote: Hi, i'm implementing a feature that requires a password, is it safe to store using SharedPreferences.Editor? Is there another recommended way for storing passwords? Thanks, Teo -- Teo (a.k.a. Teominator a.k.a. Teodor Filimon) site www.teodorfilimon.com | blog www.teodorfilimon.blogspot.com GMT +2 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Writing files to SD card failing
Hi there, I'm writing an podcast playing application. The application has pre- defined feeds but I want to cache the image of the feed for 30 days. However, on the initial creation of the podcast I am downloading the image, and trying to save it to the SD card using the code below: public long createPodcast(RssFeed feed, String feedUrl) { ContentValues insertValues = new ContentValues(); insertValues.put(KEY_FEED_TITLE, feed.title); insertValues.put(KEY_FEED_FEED_URL, feedUrl); insertValues.put(KEY_FEED_LINK, feed.link); insertValues.put(KEY_FEED_DESCRIPTION, feed.description); insertValues.put(KEY_FEED_PUBDATE, feed.pubDate); insertValues.put(KEY_FEED_IMAGE_URL, feed.imageUrl); insertValues.put(KEY_FEED_IMAGE_WIDTH, feed.imageWidth); insertValues.put(KEY_FEED_IMAGE_HEIGHT, feed.imageHeight); insertValues.put(KEY_FEED_SUBSCRIBED, false); long rowId = mDb.insert(TABLE_PODCAST_LIST, null, insertValues); String storage_state = Environment.getExternalStorageState (); if (storage_state.contains(mounted)) { File f = Environment.getExternalStorageDirectory(); File j = new File(f, twitcast); try { URL users_avatar = new URL(feed.imageUrl); HttpURLConnection conn = (HttpURLConnection) users_avatar.openConnection(); conn.setDoInput(true); conn.connect(); InputStream is = conn.getInputStream(); Bitmap bmImg = BitmapFactory.decodeStream(is); File k = new File(j, rowId + .jpg); k.mkdirs(); k.createNewFile(); FileOutputStream fos = new FileOutputStream(k); bmImg.compress(Bitmap.CompressFormat.JPEG, 100, fos); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return rowId; } However, it keeps failing on the line k.createNewFile(); with the error: WARN/System.err(10727): java.io.IOException: Parent of file is not a directory: /sdcard/twitcast/1.jpg I've checked and I have write permission and the SD card is mounted, and I have android.permission.MOUNT_UNMOUNT_FILESYSTEMS included in my manifest. Does anyone have any ideas why this keeps failing? Thanks, Tane Piper --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Writing files to SD card failing
Tane Piper wrote: [...] File k = new File(j, rowId + .jpg); k.mkdirs(); k.createNewFile(); [...] However, it keeps failing on the line k.createNewFile(); with the error: WARN/System.err(10727): java.io.IOException: Parent of file is not a directory: /sdcard/twitcast/1.jpg It looks like there's a file on your SD card called '/sdcard/twitcast' that's preventing the directory from being created. Is File.mkdirs() returning non-zero? (Remember that it doesn't throw an IOException on error.) Also, in the interests of pedantry, it's a good idea to close your FileOutputStream after use --- while the garbage collector will take care of it *eventually*, leaving the file open may cause you problems later if you need to open the file again. -- ┌─── dg@cowlark.com ─ http://www.cowlark.com ─ │ A line dancer near a graduated cylinder, the blithe spirit inside │ some wheelbarrow, and a tomato are what made America great! --- │ received via spam signature.asc Description: OpenPGP digital signature
[android-developers] debugging integrated Java and native code
Hi, I am trying to figure out what is the best way to debug a mix of Java and native code? Please notice, that I am NOT trying to develop a native app. The app will be written entirely in Java, using Android SDK. However, I noticed that some pieces of the SDK use native methods (e.g. AssetManager, WebKit, etc). I wonder which tools Google developers use if/when they need to debug a mix of Java and C/C++ code? Eclipse/gdb or there are commercial tools which make the debugging experience less painful? I googled on this topic and the results returned do not look very encouraging. Thanks, Sergey --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Writing files to SD card failing
Yea, I checked the SD card and there was a file there, I remove it and also moved the mkdirs up to the second File, now works fine. Thanks for the tip on closing the file too. On Feb 7, 5:10 pm, David Given d...@cowlark.com wrote: Tane Piper wrote: [...] File k = new File(j, rowId + .jpg); k.mkdirs(); k.createNewFile(); [...] However, it keeps failing on the line k.createNewFile(); with the error: WARN/System.err(10727): java.io.IOException: Parent of file is not a directory: /sdcard/twitcast/1.jpg It looks like there's a file on your SD card called '/sdcard/twitcast' that's preventing the directory from being created. Is File.mkdirs() returning non-zero? (Remember that it doesn't throw an IOException on error.) Also, in the interests of pedantry, it's a good idea to close your FileOutputStream after use --- while the garbage collector will take care of it *eventually*, leaving the file open may cause you problems later if you need to open the file again. -- ┌─── dg@cowlark.com ─http://www.cowlark.com─ │ A line dancer near a graduated cylinder, the blithe spirit inside │ some wheelbarrow, and a tomato are what made America great! --- │ received via spam signature.asc 1KViewDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: WebView responding to touch events
Mark, I think I had this problem myself and could solve it by using the following code: webView.setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_UP: if (!v.hasFocus()) { v.requestFocus(); } break; } return false; } }); Hope this would help, Sergey On Sat, Feb 7, 2009 at 12:07 AM, Mariano Kamp mariano.k...@gmail.comwrote: Mark, maybe you should post some code? On Thu, Feb 5, 2009 at 4:36 PM, Mark Nuetzmann mark.nuetzm...@gmail.comwrote: I have an Activity that has a WebView that contains some simple html that allows me to display a Terms Conditions link that if touched or clicked calls another activity. My problem is unless the link in the WebView has focus (ie, the text is wrapped with that little orange focus) I cannot touch the link and have it work. If any other view on the activity has focus, touching the WebView with the link does nothing. The other Views that had focus loose focus, but the WebView does not receive focus. I have tried calling setFocusable(true) and setFocusableInTouchMode(true) but that does not do any good... I would really like to know what you have to do to get a WebView to respond to touch events without using the trackball to scroll to the view before touching it. thank you, Mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Android Developers Needed in Singapore
Dear fellow developers, I am working on a mobile application that relates to media content delivery that I am building on the Android platform. Now I am trying to look for Android developers in Singapore who is interested in taking on this project. If you are from Singapore and is interested, please contact me via my email (chu...@gmail.com) and we can meet up to discuss about the details. Thank you. Cheers Zi Yong --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SharedPreferences - is it secure?
Teo, using SharedPreferences with MODE_PRIVATE should be safe in the sense that other application cannot snoop in there. Using an SQLite database is not more or less secure than SharedPreferences. Both are stored in the data folder of your application, the security of which is provided by the underlying linux system. (Note that rooted devices do not provide this security, because any application can possibly become root and do whatever it wants on the phone, AFAIK. But that's the user's risk when rooting a device.) Also, there's currently no central password store provided by the Android SDK. There's a project called CryptoIntents that you could make use of to store the password encrypted. This requires the user to enter a master password whenever you want to access the unencrypted password (with some timeout). http://code.google.com/p/openintents/wiki/CryptoIntents For authentication at Google services, I think there's a plan to allow apps to obtain an auth token for the Google account associated with the device. See this discussion: http://groups.google.com/group/android-developers/browse_thread/thread/f63f19acb691c980/ddc37cd8e23d56c8?lnk=raot Christoph On Sat, Feb 7, 2009 at 4:54 PM, Teo teomina...@gmail.com wrote: Thanks for the reply. I'll only have one password per device - as for the device borrowing (if i understood correctly what you said) i'm not sure i can do anything about that :) The thing is, i asked this question becase it's called 'Shared'Preferences. But i've seen that it also has a MODE_PRIVATE parameter, and according to the docs: the created file can only be accessed by the calling application (or all applications sharing the same user ID). And again, according to the docs: Each Android package (.apk) file installed on the device is given its own unique Linux user ID, creating a sandbox for it and preventing it from touching other applications (or other applications from touching it). This user ID is assigned to it when the application is installed on the device, and remains constant for the duration of its life on that device. So i guess this should be enough, unless i'm missing something... (SQLite would be a nice solution but it doesn't seem natural to me for individual settings) Thanks, Teo On Sat, Feb 7, 2009 at 5:29 PM, Fred Grott(shareme) fred.gr...@gmail.com wrote: SQLite stores user data by the app package name. if you did a db scehma that allowed for more than one user than it would be a safe way to go assuming that your popular app is borrowed along with device among friends.. On Feb 7, 8:31 am, Teo teomina...@gmail.com wrote: Hi, i'm implementing a feature that requires a password, is it safe to store using SharedPreferences.Editor? Is there another recommended way for storing passwords? Thanks, Teo -- Teo (a.k.a. Teominator a.k.a. Teodor Filimon) site www.teodorfilimon.com | blog www.teodorfilimon.blogspot.com GMT +2 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Help debugging frequent garbage collection
I am having an issue with my latest game (available in the market as BreakTheBlocks Lite) This is a simple arcade style game, It started with a thread controlling the game loop but now I just have a runnable that performs the game loop functions and then posts back to itself. In its original release there was a noticeable stutter in the game every other second or so. After a great deal of time debugging I finally realized that every time the stutter happened LogCat showed that garbage collection was taking place. I went through my code and got rid of creating as many temporary objects as possible. After that the stutter went from happening every 1.5 seconds to happening every 13-16 seconds. This is much better, but I can't seem to reduce the time any further. According to LogCat the garbage collector is still running on my game thread every 15 seconds I see the message GC freed 19833 objects / 878848 bytes in 131ms... and since my game runs at about 30 frames a second a 131 millisecond stutter causes about 4 frames to be dropped which is an annoyance for me and the users of my game. So my question is What can I do to further debug this problem? I have always known garbage collection existed but I have never bothered to care about it until now because it is finally affecting the performance of my app (and I am a C++ programmer by day so I usually forget about the GC) Is there any way to see what the garbage collector is collecting? Is there any way that I can tweak the behavior of the GC for my app? Sorry for the long winded question and thank you in advance for any responses --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Using bindView to Customize ListView
In all the examples I've found to manipulate each view in a ListView, the method always seems to be getView(). But these were never Adapters backed by a cursor. I decided to try bindView() within a SimpleCursorAdapter, and so far it works very nicely, especially with the cursor all set up for my use. My question is, is this usage good practice, and could I run into a problem in future? My question may be dumb but I just couldn't find a good example code snippet that uses a cursor. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SharedPreferences - is it secure?
On Feb 7, 9:43 am, Christoph Studer chstu...@gmail.com wrote: (Note that rooted devices do not provide this security, because any application can possibly become root and do whatever it wants on the phone, AFAIK. But that's the user's risk when rooting a device.) Suppose user loses phone. Finder then roots it and uses adb to pull the database and preferences files - Damage done. I consider it good practice to assume *anything* that's stored on the device is up for grabs. Even with encryption things may be dicey. Finder may have success retrieving the original password through a reverse lookup. Just by what Google does (crawling the web), they've indexed a sizeable number of MD5 passwords for a reverse lookup. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Central service scheduler
Would it make sense to create a central scheduler for services that need to run periodically? There are a lot of application that want to run at periodic intervals, require network access and need to keep the device awake during their work. Instead of each app having to use an AlarmManager, a WakeLock and its own network availability checking / auto-retry, wouldn't it make sense to provide an API that would do that work? Also, if you have a lot of apps on your device with background checks, they run on different schedules and wake the device up more frequently than if they'd run on a synchronized schedule. Ideally, I'd imagine this service scheduler to provide the following: * Application can register and unregister service intents for a certain schedule. * Provide schedules an app can register for. These could be constant such as a frequent schedule (every 10mins) and a less frequent one (every 60mins), or maybe user configurable. * Apps can specify a network filter, i.e. only run when connected via wifi, 3g, 2g... * Services would signal to the scheduler when they're done, possibly with an error code such that the scheduler could retry automatically out of the ordinary schedule. * Provide a UI for users to change schedules, unregister services, etc. * Define and require permissions for schedules such that users could see how much battery drainage an app is causing. I really think this would be quite useful for developers and users likewise. This central service scheduler could be part of the platform/SDK or it could be a user APK, much like some of the OI components already available. Any thoughts? Christoph P.S.: Not sure whether android-developers is the right mailinglist, but it does not quite fit into any of the others, either. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: debugging integrated Java and native code
A few of our developers use Eclipse as a front-end for gdb. I recall that the setup is a bit tricky. Maybe someone can post the magic formula. I use gdb myself, but then I still use vi and makefiles. IDE's are for wimps. :) On Feb 7, 9:22 am, Sergey Ten sergeyte...@gmail.com wrote: Hi, I am trying to figure out what is the best way to debug a mix of Java and native code? Please notice, that I am NOT trying to develop a native app. The app will be written entirely in Java, using Android SDK. However, I noticed that some pieces of the SDK use native methods (e.g. AssetManager, WebKit, etc). I wonder which tools Google developers use if/when they need to debug a mix of Java and C/C++ code? Eclipse/gdb or there are commercial tools which make the debugging experience less painful? I googled on this topic and the results returned do not look very encouraging. Thanks, Sergey --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SharedPreferences - is it secure?
An auth token would be great, coincidentally it's a Google service i need a password for. @JP: Wouldn't a finder of a lost phone have access to the user's Google account in the first place? From what i know, the signing in is done automatically after setup. On Sat, Feb 7, 2009 at 8:18 PM, JP joachim.pfeif...@gmail.com wrote: On Feb 7, 9:43 am, Christoph Studer chstu...@gmail.com wrote: (Note that rooted devices do not provide this security, because any application can possibly become root and do whatever it wants on the phone, AFAIK. But that's the user's risk when rooting a device.) Suppose user loses phone. Finder then roots it and uses adb to pull the database and preferences files - Damage done. I consider it good practice to assume *anything* that's stored on the device is up for grabs. Even with encryption things may be dicey. Finder may have success retrieving the original password through a reverse lookup. Just by what Google does (crawling the web), they've indexed a sizeable number of MD5 passwords for a reverse lookup. -- Teo (a.k.a. Teominator a.k.a. Teodor Filimon) site www.teodorfilimon.com | blog www.teodorfilimon.blogspot.com GMT +2 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SharedPreferences - is it secure?
That's right. It's unfortunately a trade-off between convenience and security. Somewhere on your device, there's also your Gmail password or some sort of ling-living token that can be used to authenticate against Google services. Is it worth the risk of having others read your Gmail messages and chat with your friends (and do other things with your Google account), but in turn not having to frequently enter your Google password? That's something everybody should ask himself when storing passwords, even more so with mobile devices. (I for one think it's worth it, otherwise I'd not use my G1.) The only way to provide real security (or shall I say better security) would be in hardware, i.e. having some sort of TC chip that would provide encryption/decryption to properly signed code only. And even though there are bad uses of TC, I surely think techniques like this should be used to provide better security to users. Christoph On Sat, Feb 7, 2009 at 7:18 PM, JP joachim.pfeif...@gmail.com wrote: On Feb 7, 9:43 am, Christoph Studer chstu...@gmail.com wrote: (Note that rooted devices do not provide this security, because any application can possibly become root and do whatever it wants on the phone, AFAIK. But that's the user's risk when rooting a device.) Suppose user loses phone. Finder then roots it and uses adb to pull the database and preferences files - Damage done. I consider it good practice to assume *anything* that's stored on the device is up for grabs. Even with encryption things may be dicey. Finder may have success retrieving the original password through a reverse lookup. Just by what Google does (crawling the web), they've indexed a sizeable number of MD5 passwords for a reverse lookup. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SharedPreferences - is it secure?
If you're interested in Google auth tokens, you might want to take a look at this: http://www.cyrket.com/asset/-2921053538409761500 I have not tried this out myself and do not know whether they store a password or just cache the token and ask the user for the password each time it expired. Christoph On Sat, Feb 7, 2009 at 7:42 PM, Teo teomina...@gmail.com wrote: An auth token would be great, coincidentally it's a Google service i need a password for. @JP: Wouldn't a finder of a lost phone have access to the user's Google account in the first place? From what i know, the signing in is done automatically after setup. On Sat, Feb 7, 2009 at 8:18 PM, JP joachim.pfeif...@gmail.com wrote: On Feb 7, 9:43 am, Christoph Studer chstu...@gmail.com wrote: (Note that rooted devices do not provide this security, because any application can possibly become root and do whatever it wants on the phone, AFAIK. But that's the user's risk when rooting a device.) Suppose user loses phone. Finder then roots it and uses adb to pull the database and preferences files - Damage done. I consider it good practice to assume *anything* that's stored on the device is up for grabs. Even with encryption things may be dicey. Finder may have success retrieving the original password through a reverse lookup. Just by what Google does (crawling the web), they've indexed a sizeable number of MD5 passwords for a reverse lookup. -- Teo (a.k.a. Teominator a.k.a. Teodor Filimon) site www.teodorfilimon.com | blog www.teodorfilimon.blogspot.com GMT +2 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Central service scheduler
On Sat, Feb 7, 2009 at 1:19 PM, Christoph Studer chstu...@gmail.com wrote: Would it make sense to create a central scheduler for services that need to run periodically? There are a lot of application that want to run at periodic intervals, require network access and need to keep the device awake during their work. Instead of each app having to use an AlarmManager, a WakeLock and its own network availability checking / auto-retry, wouldn't it make sense to provide an API that would do that work? I think this is a great idea and something that could be of great value, but all I want is something much simpler. I think that a flag to AlarmManager.setRepeating specifying that the alarm can be adjusted in order to synchronize multiple background tasks would be entirely sufficient. Alternatively, a note that background tasks should adjust their alarms to fire on the minute (or on five minute boundaries) would serve a similar purpose. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Central service scheduler
That's a good suggestion, and might actually work for a lot of cases. It just came to my mind that scheduling them at the exact same time might actually cause performance and memory problems. Maybe one would've to start them a bit more sequentially. On Sat, Feb 7, 2009 at 7:56 PM, Greg White debauchedsl...@gmail.com wrote: On Sat, Feb 7, 2009 at 1:19 PM, Christoph Studer chstu...@gmail.com wrote: Would it make sense to create a central scheduler for services that need to run periodically? There are a lot of application that want to run at periodic intervals, require network access and need to keep the device awake during their work. Instead of each app having to use an AlarmManager, a WakeLock and its own network availability checking / auto-retry, wouldn't it make sense to provide an API that would do that work? I think this is a great idea and something that could be of great value, but all I want is something much simpler. I think that a flag to AlarmManager.setRepeating specifying that the alarm can be adjusted in order to synchronize multiple background tasks would be entirely sufficient. Alternatively, a note that background tasks should adjust their alarms to fire on the minute (or on five minute boundaries) would serve a similar purpose. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Help debugging frequent garbage collection
Hi, It's pretty easy. Launch the tool called DDMS (the standalone one, not the one that comes with the Eclipse plugin.) Inside the tool, go to the Allocations Tracker tab. Click Start Tracking, use your app a little, then click Get Allocations. You will get a list of all allocations with, for each one of them, the stack trace to the allocation. On Sat, Feb 7, 2009 at 9:48 AM, snctln catlin.s...@gmail.com wrote: I am having an issue with my latest game (available in the market as BreakTheBlocks Lite) This is a simple arcade style game, It started with a thread controlling the game loop but now I just have a runnable that performs the game loop functions and then posts back to itself. In its original release there was a noticeable stutter in the game every other second or so. After a great deal of time debugging I finally realized that every time the stutter happened LogCat showed that garbage collection was taking place. I went through my code and got rid of creating as many temporary objects as possible. After that the stutter went from happening every 1.5 seconds to happening every 13-16 seconds. This is much better, but I can't seem to reduce the time any further. According to LogCat the garbage collector is still running on my game thread every 15 seconds I see the message GC freed 19833 objects / 878848 bytes in 131ms... and since my game runs at about 30 frames a second a 131 millisecond stutter causes about 4 frames to be dropped which is an annoyance for me and the users of my game. So my question is What can I do to further debug this problem? I have always known garbage collection existed but I have never bothered to care about it until now because it is finally affecting the performance of my app (and I am a C++ programmer by day so I usually forget about the GC) Is there any way to see what the garbage collector is collecting? Is there any way that I can tweak the behavior of the GC for my app? Sorry for the long winded question and thank you in advance for any responses -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SlidingDrawer not working with RC33
No, SlidingDrawer is a private widget. It is not supported. On Sat, Feb 7, 2009 at 7:18 AM, Jean-Baptiste Queru j...@android.com wrote: Can you please report this issue in http://b.android.com/ ? (a plain copy-paste will do). Thanks, JBQ On Sat, Feb 7, 2009 at 6:54 AM, Stefan skyntc...@gmail.com wrote: It appears that android.internal.widget.SlidingDrawer widget had changed between RC30 and RC33. On RC33 it fails to inflate the layout XML complaining that: The handle attribute is required and must refer to a valid child This is the XML I am trying to inflate: com.android.internal.widget.SlidingDrawer android:id=@+id/drawer android:layout_width=fill_parent android:layout_height=wrap_content android:topOffset=5px android:bottomOffset=7px android:handle=@+id/playlistHeader android:content=@+id/playList ImageView android:id=@id/playlistHeader android:focusable=true android:clickable=true android:scaleType=center android:src=@drawable/ic_mp_current_playlist_btn android:layout_height=56dip android:layout_width=fill_parent / ListView android:id=@+id/playList android:layout_width=fill_parent android:layout_height=fill_parent android:background=@color/grid_dark_background/ /com.android.internal.widget.SlidingDrawer The XML above has both the content and the handle attribute and worked fine in RC30? Does anyone know what has changed and how to fix it? Stefan -- Jean-Baptiste M. JBQ Queru Android Engineer, Google. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: RC33 for Dev Phone
On Fri, Feb 6, 2009 at 6:16 PM, Disconnect dc.disconn...@gmail.com wrote: Install jf's 1.41-rc33. http://andblogs.net/tag/jf It is signed with test keys -and- its a full install instead of a patch, so no perquisites. Has anyone tried this on their devphone? I only have one devphone so I'm reluctant to try. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Central service scheduler
There is something like that in cupcake. I forgot the exact API name, sorry. JBQ On Sat, Feb 7, 2009 at 10:19 AM, Christoph Studer chstu...@gmail.com wrote: Would it make sense to create a central scheduler for services that need to run periodically? There are a lot of application that want to run at periodic intervals, require network access and need to keep the device awake during their work. Instead of each app having to use an AlarmManager, a WakeLock and its own network availability checking / auto-retry, wouldn't it make sense to provide an API that would do that work? Also, if you have a lot of apps on your device with background checks, they run on different schedules and wake the device up more frequently than if they'd run on a synchronized schedule. Ideally, I'd imagine this service scheduler to provide the following: * Application can register and unregister service intents for a certain schedule. * Provide schedules an app can register for. These could be constant such as a frequent schedule (every 10mins) and a less frequent one (every 60mins), or maybe user configurable. * Apps can specify a network filter, i.e. only run when connected via wifi, 3g, 2g... * Services would signal to the scheduler when they're done, possibly with an error code such that the scheduler could retry automatically out of the ordinary schedule. * Provide a UI for users to change schedules, unregister services, etc. * Define and require permissions for schedules such that users could see how much battery drainage an app is causing. I really think this would be quite useful for developers and users likewise. This central service scheduler could be part of the platform/SDK or it could be a user APK, much like some of the OI components already available. Any thoughts? Christoph P.S.: Not sure whether android-developers is the right mailinglist, but it does not quite fit into any of the others, either. -- Jean-Baptiste M. JBQ Queru Android Engineer, 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 android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Using bindView to Customize ListView
Nmix wrote: In all the examples I've found to manipulate each view in a ListView, the method always seems to be getView(). But these were never Adapters backed by a cursor. I decided to try bindView() within a SimpleCursorAdapter, and so far it works very nicely, especially with the cursor all set up for my use. My question is, is this usage good practice, and could I run into a problem in future? My question may be dumb but I just couldn't find a good example code snippet that uses a cursor. Cursors are a bit of a pain to set up, if you're trying to show a complete example -- you need a database, etc. But using newView()/bindView() should be just fine. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 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 android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: multiple tables in sqlite
intbt wrote: Hopefully some one will nmotice my 'obvious' mistake. I have created 2 tables in the database (below). When I access table c, no problem. But when I attempt to access table s I get an error message that column name x (all names give the same error) does not exist. How can 1 table get created but not the other? Have you looked at the actual database and seen what is in it? Perhaps use sqlite3's .dump command to dump the schema and contents out, and maybe that will help determine the source of the discrepancy. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 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 android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SlidingDrawer not working with RC33
Oh, ah, I hadn't seen that it was android.INTERNAL.SlidingDrawer (emphasis mine). There's no guarantee of compatibility of private APIs between versions. JBQ On Sat, Feb 7, 2009 at 11:28 AM, Romain Guy romain...@google.com wrote: No, SlidingDrawer is a private widget. It is not supported. On Sat, Feb 7, 2009 at 7:18 AM, Jean-Baptiste Queru j...@android.com wrote: Can you please report this issue in http://b.android.com/ ? (a plain copy-paste will do). Thanks, JBQ On Sat, Feb 7, 2009 at 6:54 AM, Stefan skyntc...@gmail.com wrote: It appears that android.internal.widget.SlidingDrawer widget had changed between RC30 and RC33. On RC33 it fails to inflate the layout XML complaining that: The handle attribute is required and must refer to a valid child This is the XML I am trying to inflate: com.android.internal.widget.SlidingDrawer android:id=@+id/drawer android:layout_width=fill_parent android:layout_height=wrap_content android:topOffset=5px android:bottomOffset=7px android:handle=@+id/playlistHeader android:content=@+id/playList ImageView android:id=@id/playlistHeader android:focusable=true android:clickable=true android:scaleType=center android:src=@drawable/ic_mp_current_playlist_btn android:layout_height=56dip android:layout_width=fill_parent / ListView android:id=@+id/playList android:layout_width=fill_parent android:layout_height=fill_parent android:background=@color/grid_dark_background/ /com.android.internal.widget.SlidingDrawer The XML above has both the content and the handle attribute and worked fine in RC30? Does anyone know what has changed and how to fix it? Stefan -- Jean-Baptiste M. JBQ Queru Android Engineer, Google. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- Jean-Baptiste M. JBQ Queru Android Engineer, 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 android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: WebView responding to touch events
Sergey, I ended up doing basically what you posted but only for the ACTION_DOWN as that seemed to handle it. Fred, I tried adding an OnClickListener but never got any callbacks. I assume that the WebView is designed to handle this internally and expects you to use the WebViewClient.shouldOverrideUrlLoading() to respond to the clicks. As to whether it happens in the emulator I am not sure. I learned a long time ago with WM not to trust emulators so I only debug on-device... Thanks for the comments guys! Mark On Feb 7, 11:28 am, Sergey Ten sergeyte...@gmail.com wrote: Mark, I think I had this problem myself and could solve it by using the following code: webView.setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_UP: if (!v.hasFocus()) { v.requestFocus(); } break; } return false; } }); Hope this would help, Sergey On Sat, Feb 7, 2009 at 12:07 AM, Mariano Kamp mariano.k...@gmail.comwrote: Mark, maybe you should post some code? On Thu, Feb 5, 2009 at 4:36 PM, Mark Nuetzmann mark.nuetzm...@gmail.comwrote: I have an Activity that has a WebView that contains some simple html that allows me to display a Terms Conditions link that if touched or clicked calls another activity. My problem is unless the link in the WebView has focus (ie, the text is wrapped with that little orange focus) I cannot touch the link and have it work. If any other view on the activity has focus, touching the WebView with the link does nothing. The other Views that had focus loose focus, but the WebView does not receive focus. I have tried calling setFocusable(true) and setFocusableInTouchMode(true) but that does not do any good... I would really like to know what you have to do to get a WebView to respond to touch events without using the trackball to scroll to the view before touching it. thank you, Mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Loading Partial Subset of a Bitmap
So I have a huge image (2000 x 2000) that is way too big for the Android VM to load in (there's a 16 MB limit per application). That's fine with me, as I only want to load in one screen size (320 x 480) at a time, which Android should more than be able to handle. The problem is, how do you load in just one piece of a bitmap? I've tried the following: Bitmap bmp1 = BitmapFactory.decodeResource(res, R.drawable.image); Bitmap bmp2 = Bitmap.createBitmap(bmp1, 0, 0, 320, 480); But of course the loading is really done in that first line, so the VM crashes. I also tried using BitmapFactory.Options and specifying an outWidth and outHeight, but those just scale the image rather than translate/ crop it. Something along the lines of those options would be really nice though. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] WPA2 Enterprise Support
Hello Guys, is there a way to alter the wpa_supplicant on an non rooted G1 with the actual firmware RC33 which is installed on the german devices, I will need to have access to WPA2 Enterprise Networks with my G1 , and i actually could not get root access with the current release of Android on the Phone. So my question is , is it possible to write a Programm which can build in the possibility to connect to WPA2 Enterpise networks on a G1 without root access, and when there is one how could this be done? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Please Help! Service seems to sleep when phone is inactive
Hi everybody, I'm new to android, but I am picking up speed quickly. I've spent the last several years writing Windows services. So I am not a complete newbie in this area. I've written a test service to understand how android implements a service. I believe I understand the difference between Context.startService and Context.bindService. If I am not mistaken, Context.startService will tell android to keep this service running, even after the Activity that started it has ended. While testing the service, I have come across something interesting. My problem is that the service appears to sleep or pause for a few hours, run a short time, and then sleep for a few more hours, then run a short time, etc when the phone has become inactive. In other words, when I am doing things on the phone the service is doing what is is supposed to. But after I have finished doing things on the phone and the screen goes blank the service appears to sleep or pause. I don't know if I have implemented the service wrong or if this is how Android services work. The test service I have written simply sets a postDelayed handler to increment++ a variable in the Runnable every minute, and then write the value of that variable and a timestamp to a file (log.txt) on the sd card. This how I know that the service appears to sleep. Because there are gaps in the timestamp that correspond to when the phone was inactive. If the service were truly active the whole time, there should be a line item in the log.txt file every minute. From the log.txt file below you can see that over an eleven hour period there are only 36 line items with time stamps ranging from 10:27 PM through 9:23 AM. If the service was running and active the whole time there should be over 600 lines in the text file. The phone was on AC power the whole time so Android should not have tried to stop services due to power issues. The phone was not used or touched from about midnight to 9 the next morning, so there should not have been a low resource clean up. I have spent several days looking for an answer and everything I can find seems to validate that when a service is started and not bound, it will stay running (http://code.google.com/android/reference/android/ app/Service.html). However, it appears it does not. Unless I have completely missed the ball on this. I have included the service.java and activity.java as well as the log file. Any help/ideas would be greatly appreciated. I am truly stumped... Here is a sample log.txt 02/05/2009 10:27:02 PM: Service Created. 02/05/2009 10:27:02 PM: Service Started. 02/05/2009 10:27:07 PM: iCount = 1 02/05/2009 10:28:07 PM: iCount = 2 02/05/2009 10:29:07 PM: iCount = 3 02/05/2009 11:20:49 PM: iCount = 4 02/05/2009 11:31:11 PM: iCount = 5 02/05/2009 11:32:11 PM: iCount = 6 02/05/2009 11:33:16 PM: iCount = 7 02/05/2009 11:34:16 PM: iCount = 8 02/05/2009 11:35:16 PM: iCount = 9 02/05/2009 11:36:16 PM: iCount = 10 02/05/2009 11:37:16 PM: iCount = 11 02/05/2009 11:38:16 PM: iCount = 12 02/05/2009 11:39:16 PM: iCount = 13 02/05/2009 11:40:16 PM: iCount = 14 02/05/2009 11:41:16 PM: iCount = 15 02/05/2009 11:42:16 PM: iCount = 16 02/05/2009 11:43:17 PM: iCount = 17 02/05/2009 11:44:17 PM: iCount = 18 02/05/2009 11:45:17 PM: iCount = 19 02/05/2009 11:46:17 PM: iCount = 20 02/05/2009 11:47:17 PM: iCount = 21 02/05/2009 11:48:17 PM: iCount = 22 02/05/2009 11:55:58 PM: iCount = 23 02/06/2009 01:06:56 AM: iCount = 24 02/06/2009 03:07:41 AM: iCount = 25 02/06/2009 04:38:32 AM: iCount = 26 02/06/2009 06:54:49 AM: iCount = 27 02/06/2009 08:03:14 AM: iCount = 28 02/06/2009 08:57:50 AM: iCount = 29 02/06/2009 08:58:50 AM: iCount = 30 02/06/2009 08:59:50 AM: iCount = 31 02/06/2009 09:05:24 AM: iCount = 32 02/06/2009 09:06:24 AM: iCount = 33 02/06/2009 09:07:24 AM: iCount = 34 02/06/2009 09:08:24 AM: iCount = 35 02/06/2009 09:23:09 AM: iCount = 36 02/06/2009 09:23:17 AM: Service Destroyed. Here is the service java file: Java: package bSoft.bService; import java.io.FileWriter; import java.text.SimpleDateFormat; import java.util.Calendar; import android.app.Service; import android.content.Intent; import android.os.Binder; import android.os.Handler; import android.os.IBinder; public class bService extends Service { private long _iCount = 0; private Handler objHandler = new Handler(); @Override public void onCreate() { super.onCreate(); SaveStatusData(Service Created.\n\n); } @Override public void onDestroy() { super.onDestroy(); objHandler.removeCallbacks(doMonitoringTasks); SaveStatusData(Service Destroyed.\n\n); } @Override public void onStart(Intent intent, int startId) { SaveStatusData(Service Started.\n\n); objHandler.postDelayed(doMonitoringTasks, 5000); } @Override public IBinder onBind(Intent intent) { return binder; } private final IBinder binder = new
[android-developers] Local communication with a service from another APK that runs in the same process
Hello, In my application I have a need to separate components into two different APKs. One component (the first APK) needs to communicate with a service provided by the other component (the second APK). I was hoping I could use the shared-user-id mechanism, have both applications run in the same process and by so avoid AIDL using the same scheme as presented in the LocalService example in the ApiDemos. The idea was to declare the following two classesin APK #1: LocalService interface: would represent the service LocalServiceBinder: would have a getService() method that would return a LocalService object The two classes would be exported into a JAR and added to APK #2's build path. The actual service in the APK #2 would implement LocalService and it's onBind() method would return an instance of LocalServiceBinder whereas getService() would be overriden to return a reference to the service itself. I tried implementing it but failed due to a class-cast exception being thrown in onServiceConnected when attempting to cast the Binder returned by the Service to LocalServiceBinder. I gave up on the idea and implemented the communication using AIDL. As a result my application took quite a performance hit, primarily due to the serialization and deserialization of the data being sent to Service. So now I'm again trying to implement the local-communication scheme. However, when I tried to reconstruct the aforementioned implementation the Binder received in onServiceConnected is null (even though I'm definitely not returning null in the service's onBind method). Bottom line is I would like to know if whether I'm attempting to do is even possible using the Android framework, and if so how to do it. If not, any suggestions on how to minimize the performance hit. Thanks in advance! Best regards, Uri Kanonov --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] XML parsing problem (stops at non-utf characters)
I am having difficulty while parsing some Turkish sites.Here is the part of the code. The problem is when the title contains some non-UTF characters like ç,ü,ı,ö,ğ it stops parsing and doesnt read the rest. For example if the title is Ebru Gündeş askere gitti it only reads until ş which is Ebru G. Or when reading Serdar Ortaç sünnet oldu it only read Serdar Or How can I fix the problem? Any suggestions??? NodeList nl=docEle.getElementsByTagName(item); if(nl!=null nl.getLength()0){ for(int i=0;inl.getLength();i++){ Element entry = (Element)nl.item(i); Element _title = (Element)entry.getElementsByTagName (title).item(0); Element _link = (Element)entry.getElementsByTagName(link).item (0); Element _date = (Element)entry.getElementsByTagName (pubDate).item(0); String title = _title.getFirstChild().getNodeValue(); String link = _link.getFirstChild().getNodeValue(); haber yeniHaber = new haber(link,title); haberEkle(yeniHaber); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] android.app.Service question
The android.content.Context api exposes two methods for starting a service. startService and bindService. The api docs state that when a service is started with Context.startService, that requires the service to remain running until stopService(Intent) is called, regardless of whether any clients are connected to it. I have made a test service that uses a postDelayed event. The Runnable for the postDelayed increments++ a counter and writes that counter and a timestamp to a text file every minute. However, when the phone becomes inactive (screen times out) the service seems to pause for a few hours, run a short while, then pause for a few hours, then run a short while, and on and on... Here is the log file. The service ran intermittently for 11 hours. I can post the Service.java and Activity.java if requested. I am leaving it out for berevity. 02/05/2009 10:27:07 PM: iCount = 1 02/05/2009 10:28:07 PM: iCount = 2 02/05/2009 10:29:07 PM: iCount = 3 02/05/2009 11:20:49 PM: iCount = 4 02/05/2009 11:31:11 PM: iCount = 5 02/05/2009 11:32:11 PM: iCount = 6 02/05/2009 11:33:16 PM: iCount = 7 02/05/2009 11:34:16 PM: iCount = 8 02/05/2009 11:35:16 PM: iCount = 9 02/05/2009 11:36:16 PM: iCount = 10 02/05/2009 11:37:16 PM: iCount = 11 02/05/2009 11:38:16 PM: iCount = 12 02/05/2009 11:39:16 PM: iCount = 13 02/05/2009 11:40:16 PM: iCount = 14 02/05/2009 11:41:16 PM: iCount = 15 02/05/2009 11:42:16 PM: iCount = 16 02/05/2009 11:43:17 PM: iCount = 17 02/05/2009 11:44:17 PM: iCount = 18 02/05/2009 11:45:17 PM: iCount = 19 02/05/2009 11:46:17 PM: iCount = 20 02/05/2009 11:47:17 PM: iCount = 21 02/05/2009 11:48:17 PM: iCount = 22 02/05/2009 11:55:58 PM: iCount = 23 02/06/2009 01:06:56 AM: iCount = 24 02/06/2009 03:07:41 AM: iCount = 25 02/06/2009 04:38:32 AM: iCount = 26 02/06/2009 06:54:49 AM: iCount = 27 02/06/2009 08:03:14 AM: iCount = 28 02/06/2009 08:57:50 AM: iCount = 29 02/06/2009 08:58:50 AM: iCount = 30 02/06/2009 08:59:50 AM: iCount = 31 02/06/2009 09:05:24 AM: iCount = 32 02/06/2009 09:06:24 AM: iCount = 33 02/06/2009 09:07:24 AM: iCount = 34 02/06/2009 09:08:24 AM: iCount = 35 02/06/2009 09:23:09 AM: iCount = 36 02/06/2009 09:23:17 AM: Service Destroyed. My questions are: 1) Is this what is supposed to happen for an Android service? 2) If so, What should one do to get an application to run a specific task at user-specified intervals in the background. Like retrieving data from a web service... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] access to internal telephony
Hello, are there plans to make com.android.internal.telephony available public? As far as I understand it is currently not possible to write e.g. an answering machine within the current framework (standard sdk), because direct access to acceptCall and hangup methods is missing. Best G. Mudersbach --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Problem with sound on Notifications on Emulator
Hi Everyone, The reason Im posting this question is because I cannot make a notification to reproduce a sound or a vibration sequence. For the case of the vibration I have permissions properly set and logcat do not show log message indicating a problem. For the case of sound, I have an mp3 saved in the res/raw folder and I always got an error saying: error loading sound in logcat. I add an snipplet with the code I´m using. Probably anyone can let me know if I am making a newbie mistake. Notification note=new Notification(R.drawable.red_ball, Status message!, System.currentTimeMillis()); note.vibrate = new long[] {100,200,150}; Uri uri = Uri.parse(android.resource://com.pp/ + R.raw.test_cbr); note.sound = uri; PendingIntent i=PendingIntent.getActivity(this, 0, new Intent(this, NotifyMessage.class), 0); note.setLatestEventInfo(this, Notification Title, This is the notification message, i); mgr.notify(NOTIFY_ME_ID, note); Where com.pp is the package of my application. I will be more than glad if someone can be me a hint or a working snipplet about reproducing sound, vibration and lights. There is actually very few documentation about how to make notifications work properly. Thanks in advance, Pablo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: native C++ SIP stack on Android
i port a sip stack,and use jni,it can work now,but,how can i let phone use the stack,just like gsm? On Jan 9, 1:08 am, David Turner di...@android.com wrote: first, you cannot have C++ code in the kernel. however, depending on how your stack is designed, you may be able to use it from Java through JNI given that you give absolutely no information about your stack's interface, it's really difficult to answer your question On Thu, Jan 8, 2009 at 5:57 PM, pinguin e...@vinacom.de wrote: Can i port SIP stack written in C++ to android and let it running as service in kernel ? and the GUI will communicate with SIP stack through JNI ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Central service scheduler
Sweet! Thanks for the reply and looking forward to that API. Christoph On Sat, Feb 7, 2009 at 8:57 PM, Jean-Baptiste Queru j...@android.com wrote: There is something like that in cupcake. I forgot the exact API name, sorry. JBQ On Sat, Feb 7, 2009 at 10:19 AM, Christoph Studer chstu...@gmail.com wrote: Would it make sense to create a central scheduler for services that need to run periodically? There are a lot of application that want to run at periodic intervals, require network access and need to keep the device awake during their work. Instead of each app having to use an AlarmManager, a WakeLock and its own network availability checking / auto-retry, wouldn't it make sense to provide an API that would do that work? Also, if you have a lot of apps on your device with background checks, they run on different schedules and wake the device up more frequently than if they'd run on a synchronized schedule. Ideally, I'd imagine this service scheduler to provide the following: * Application can register and unregister service intents for a certain schedule. * Provide schedules an app can register for. These could be constant such as a frequent schedule (every 10mins) and a less frequent one (every 60mins), or maybe user configurable. * Apps can specify a network filter, i.e. only run when connected via wifi, 3g, 2g... * Services would signal to the scheduler when they're done, possibly with an error code such that the scheduler could retry automatically out of the ordinary schedule. * Provide a UI for users to change schedules, unregister services, etc. * Define and require permissions for schedules such that users could see how much battery drainage an app is causing. I really think this would be quite useful for developers and users likewise. This central service scheduler could be part of the platform/SDK or it could be a user APK, much like some of the OI components already available. Any thoughts? Christoph P.S.: Not sure whether android-developers is the right mailinglist, but it does not quite fit into any of the others, either. -- Jean-Baptiste M. JBQ Queru Android Engineer, 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 android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Reusing the +/- number spinner from TimePickerDialog?
setCurrent to set values works: --- try { Method m = c.getMethod(setCurrent, int.class); m.invoke(o, mDauer%60); } catch (Exception e) { Log.e(, e.getMessage()); } --- But how to get values? Any idea? On 4 Feb., 18:43, solomonk denis.solone...@gmail.com wrote: No need to clone it if you really don't want to. You can use it in XML layot like com.android.internal.widget.NumberPicker android:id=@+id/picker android:layout_width=wrap_content android:layout_height=wrap_content/ and then use reflection to set settings: Object o = findViewById(R.id.picker); Class c = o.getClass(); try { Method m = c.getMethod(setRange, int.class, int.class); m.invoke(o, 0, 9); } catch (Exception e) { Log.e(, e.getMessage()); } It sucks but it works :) On 28 янв, 20:17, Mark Murphy mmur...@commonsware.com wrote: Will wrote: Setting a breakpoint when a DatePickerDialog is open on the emulator's screen shows a com.android.internal.widget.NumberPicker for month, year, and date (1numberpickereach for a total of three NumberPickers). It looks like the same widget used for a timepicker; based on the name I'm sure it is. Importing android.internal.widget doesn't work. It was worth a shot. The source to it is probably available on source.android.com. Clone your own until they open that one up in the SDK. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Local communication with a service from another APK that runs in the same process
Hello, In my application I have a need to separate components into two different APKs. One component (the first APK) needs to communicate with a service provided by the other component (the second APK). I was hoping I could use the shared-user-id mechanism, have both applications run in the same process and by so avoid AIDL using the same scheme as presented in the LocalService example in the ApiDemos. The idea was to declare the following two classesin APK #1: LocalService interface: would represent the service LocalServiceBinder: would have a getService() method that would return a LocalService object The two classes would be exported into a JAR and added to APK #2's build path. The actual service in the APK #2 would implement LocalService and it's onBind() method would return an instance of LocalServiceBinder whereas getService() would be overriden to return a reference to the service itself. I tried implementing it but failed due to a class-cast exception being thrown in onServiceConnected when attempting to cast the Binder returned by the Service to LocalServiceBinder. I gave up on the idea and implemented the communication using AIDL. As a result my application took quite a performance hit, primarily due to the serialization and deserialization of the data being sent to Service. So now I'm again trying to implement the local-communication scheme. However, when I tried to reconstruct the aforementioned implementation the Binder received in onServiceConnected is null (even though I'm definitely not returning null in the service's onBind method). Bottom line is I would like to know if whether I'm attempting to do is even possible using the Android framework, and if so how to do it. If not, any suggestions on how to minimize the performance hit. Thanks in advance! Best regards, Uri Kanonov --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Can we start a new activity or at least display a Toast in TimerTask.run()?
From my experience, timers are a finicky thing in android. I have always had much better luck using a postDelayed to a handler. public class MyClass extends Activity { private Handler objHandler = new Handler(); public void MyFunction() { //Or put this in your onCreate() objHandler.postDelayed(doTasks, 6); } private Runnable doTasks = new Runnable() { public void run() { Context context = getApplicationContext(); Toast toast = Toast.makeText(context, strMsg, 100); toast.show(); //And if you want it to fire again do this, otherwise delete this line objHandler.postDelayed(doTasks, 6); } }; //And you can destroy the call back with a user interaction if you want private void SomeUserFunction() { objHandler.removeCallbacks(doTasks); } } On Feb 6, 8:38 pm, Xin Zhao uszhao...@gmail.com wrote: I tried to deploy a timer and switch the user to another dialog for setting if times out. But the dialog just cannot display. No error/exception reported. Vibration works fine though. What's wrong? Code: private void setAutoPhonecardSelector(int interval) { Date timeToRun = new Date(System.currentTimeMillis() + interval); Timer timer = new Timer(); mAutoPhonecardSelector = new TimerTask() { @Override public void run() { mVibrator.vibrate(100); Toast.makeText(PhoneCardSelector.this, test, Toast.LENGTH_LONG).show(); } }; timer.schedule(mAutoPhonecardSelector, timeToRun); } Please help! Thanks in advance! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android Developers in Atlanta, GA
Hi there, I'm in Marietta and would be interested. Alton On Jan 30, 9:10 am, BarbieDahl sr9...@gmail.com wrote: Are there any developers inAtlanta, GA that would like to meet and discuss android app ideas as well as learn new and advanced android topics? I would like to network with some other developers in and aroundAtlanta, GA for help, mentoring and support. Please reply if you are interested. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Context.startService - The service does not stay running...
I rarely post to groups, because I can usually find the answer somewhere on the web. So I apologize in advance if I have violated any ettiquette. But this time I am truly stumped, and would appreciate any help, insight, or suggestion from a more experienced Android developer. I've written a test service to understand how android implements a service. I believe I understand the difference between Context.startService and Context.bindService. If I am not mistaken, Context.startService will tell android to keep the service running, even after the Activity that started it has ended. While testing the service, I have come across something unexpected. The service appears to sleep or pause for a few hours, run a short time, and then sleep for a few more hours, then run a short time, etc when the phone has become inactive. In other words, when I am doing things on the phone the service is doing what it is supposed to. But after I have finished doing things on the phone and the screen goes blank the service appears to sleep or pause. I don't know if I have implemented the service wrong or if this is how Android services work. The test service I have written simply sets a postDelayed handler to increment++ a variable in the Runnable every minute, and then write the value of that variable and a timestamp to a file (log.txt) on the sd card. This how I know that the service appears to sleep. Because there are gaps in the timstamp that correspond to when the phone was inactive. If the service were truly active the whole time, there should be a line item in the log.txt file every minute. From the log.txt file below you can see that over an eleven hour period there are only 36 line items with time stamps ranging from 10:27 PM through 9:23 AM. If the service was running and active the whole time there should be over 600 lines in the text file. The phone was on AC power the whole time so Android should not have tried to stop services due to power issues. The phone was not used or touched from about midnight to 9 the next morning, so there should not have been a low resource clean up. I have spent several days looking for an answer and everything I can find seems to validate that when a service is started and not bound, it will stay running (http://code.google.com/android/reference/android/ app/Service.html). However, it appears it does not. Unless I have completely missed the ball on this. I have included the service.java and activity.java as well as the log file. Any help/ideas would be greatly appreciated. I am truly stumped... Here is the log.txt file 02/05/2009 10:27:02 PM: Service Created. 02/05/2009 10:27:02 PM: Service Started. 02/05/2009 10:27:07 PM: iCount = 1 02/05/2009 10:28:07 PM: iCount = 2 02/05/2009 10:29:07 PM: iCount = 3 02/05/2009 11:20:49 PM: iCount = 4 02/05/2009 11:31:11 PM: iCount = 5 02/05/2009 11:32:11 PM: iCount = 6 02/05/2009 11:33:16 PM: iCount = 7 02/05/2009 11:34:16 PM: iCount = 8 02/05/2009 11:35:16 PM: iCount = 9 02/05/2009 11:36:16 PM: iCount = 10 02/05/2009 11:37:16 PM: iCount = 11 02/05/2009 11:38:16 PM: iCount = 12 02/05/2009 11:39:16 PM: iCount = 13 02/05/2009 11:40:16 PM: iCount = 14 02/05/2009 11:41:16 PM: iCount = 15 02/05/2009 11:42:16 PM: iCount = 16 02/05/2009 11:43:17 PM: iCount = 17 02/05/2009 11:44:17 PM: iCount = 18 02/05/2009 11:45:17 PM: iCount = 19 02/05/2009 11:46:17 PM: iCount = 20 02/05/2009 11:47:17 PM: iCount = 21 02/05/2009 11:48:17 PM: iCount = 22 02/05/2009 11:55:58 PM: iCount = 23 02/06/2009 01:06:56 AM: iCount = 24 02/06/2009 03:07:41 AM: iCount = 25 02/06/2009 04:38:32 AM: iCount = 26 02/06/2009 06:54:49 AM: iCount = 27 02/06/2009 08:03:14 AM: iCount = 28 02/06/2009 08:57:50 AM: iCount = 29 02/06/2009 08:58:50 AM: iCount = 30 02/06/2009 08:59:50 AM: iCount = 31 02/06/2009 09:05:24 AM: iCount = 32 02/06/2009 09:06:24 AM: iCount = 33 02/06/2009 09:07:24 AM: iCount = 34 02/06/2009 09:08:24 AM: iCount = 35 02/06/2009 09:23:09 AM: iCount = 36 02/06/2009 09:23:17 AM: Service Destroyed. Here is the service java file: Java: package bSoft.bService; import java.io.FileWriter; import java.text.SimpleDateFormat; import java.util.Calendar; import android.app.Service; import android.content.Intent; import android.os.Binder; import android.os.Handler; import android.os.IBinder; public class bService extends Service { private long _iCount = 0; private Handler objHandler = new Handler(); @Override public void onCreate() { super.onCreate(); SaveStatusData(Service Created.\n\n); } @Override public void onDestroy() { super.onDestroy(); objHandler.removeCallbacks(doMonitoringTasks); SaveStatusData(Service Destroyed.\n\n); } @Override public void onStart(Intent intent, int startId) { SaveStatusData(Service Started.\n\n); objHandler.postDelayed(doMonitoringTasks, 5000); } @Override public IBinder onBind(Intent intent) {
[android-developers] sip ua in android
i port a sip ua(osip) for android,it can work in android,but,how can i warp this as a part of android phone,jast like gsm? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Making ListView stop on a finger press
Any one? It's just that the List View isn't receiving the touch events for some reason (being consumed by the Button/TextView above), although it still scrolls if I flick the finger. On a tap I need the listview to receive the touch events so that the scroll is controlled. Any ideas? On Feb 7, 2:35 pm, Gw1921 guidedw...@googlemail.com wrote: Okay more on this - it seems my custom view for each row inside the list is grabbing the touch event and not passing it through to the list. I have set setItemsCanFocus on the ListView to True (as its required) and now I can't make the listview stop it's scrolling on a tap. It only stops when it stops scrolling eventually. Any idea how I can pass the touch back to its parent? I've tried returning false from a TouchListener as well but no luck On Feb 7, 11:56 am, Gw1921 guidedw...@googlemail.com wrote: How can I make the ListView immediately stop scrolling on a finger down event? It keeps scrolling if I give it a big swipe and doesn't stop immediately if my finger is pressed down again. Any idea? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Please Help! Service seems to sleep when phone is inactive
On Sat, Feb 7, 2009 at 11:50 AM, Brian clarkbrianc...@gmail.com wrote: While testing the service, I have come across something interesting. My problem is that the service appears to sleep or pause for a few hours, run a short time, and then sleep for a few more hours, then run a short time, etc when the phone has become inactive. I'm interested to hear what others say. My experience mirrors yours. I believe the phone is going to sleep and freezing the service. What I did was to use the AlarmManager to wake the service to do its work. While it was working, I used a wake lock to keep the phone from sleeping. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SlidingDrawer not working with RC33
Even worse, SlidingDrawer will move to android.widget in Cupcake :)) (And thus become public API.) On Sat, Feb 7, 2009 at 12:14 PM, Jean-Baptiste Queru j...@android.com wrote: Oh, ah, I hadn't seen that it was android.INTERNAL.SlidingDrawer (emphasis mine). There's no guarantee of compatibility of private APIs between versions. JBQ On Sat, Feb 7, 2009 at 11:28 AM, Romain Guy romain...@google.com wrote: No, SlidingDrawer is a private widget. It is not supported. On Sat, Feb 7, 2009 at 7:18 AM, Jean-Baptiste Queru j...@android.com wrote: Can you please report this issue in http://b.android.com/ ? (a plain copy-paste will do). Thanks, JBQ On Sat, Feb 7, 2009 at 6:54 AM, Stefan skyntc...@gmail.com wrote: It appears that android.internal.widget.SlidingDrawer widget had changed between RC30 and RC33. On RC33 it fails to inflate the layout XML complaining that: The handle attribute is required and must refer to a valid child This is the XML I am trying to inflate: com.android.internal.widget.SlidingDrawer android:id=@+id/drawer android:layout_width=fill_parent android:layout_height=wrap_content android:topOffset=5px android:bottomOffset=7px android:handle=@+id/playlistHeader android:content=@+id/playList ImageView android:id=@id/playlistHeader android:focusable=true android:clickable=true android:scaleType=center android:src=@drawable/ic_mp_current_playlist_btn android:layout_height=56dip android:layout_width=fill_parent / ListView android:id=@+id/playList android:layout_width=fill_parent android:layout_height=fill_parent android:background=@color/grid_dark_background/ /com.android.internal.widget.SlidingDrawer The XML above has both the content and the handle attribute and worked fine in RC30? Does anyone know what has changed and how to fix it? Stefan -- Jean-Baptiste M. JBQ Queru Android Engineer, Google. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- Jean-Baptiste M. JBQ Queru Android Engineer, Google. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SlidingDrawer not working with RC33
After digging a bit around in the source code, it looks like the namespace used for the attributes of the internal widgets has changed in RC33 from xmlns:android=http://schemas.android.com/apk/res/ android to some other namespace (probably something like http://schemas.android.com/apk/res/android.intenral ??) and that caused the SlidingDrawer to not find its attributes. Well... one should never rely on internal classes, but... the SlidingDrawer is actually so useful... I am glad it will make it as an officially supported class. On Feb 7, 4:34 pm, Romain Guy romain...@google.com wrote: Even worse, SlidingDrawer will move to android.widget in Cupcake :)) (And thus become public API.) On Sat, Feb 7, 2009 at 12:14 PM, Jean-Baptiste Queru j...@android.com wrote: Oh, ah, I hadn't seen that it was android.INTERNAL.SlidingDrawer (emphasis mine). There's no guarantee of compatibility of private APIs between versions. JBQ On Sat, Feb 7, 2009 at 11:28 AM, Romain Guy romain...@google.com wrote: No, SlidingDrawer is a private widget. It is not supported. On Sat, Feb 7, 2009 at 7:18 AM, Jean-Baptiste Queru j...@android.com wrote: Can you please report this issue inhttp://b.android.com/? (a plain copy-paste will do). Thanks, JBQ On Sat, Feb 7, 2009 at 6:54 AM, Stefan skyntc...@gmail.com wrote: It appears that android.internal.widget.SlidingDrawer widget had changed between RC30 and RC33. On RC33 it fails to inflate the layout XML complaining that: The handle attribute is required and must refer to a valid child This is the XML I am trying to inflate: com.android.internal.widget.SlidingDrawer android:id=@+id/drawer android:layout_width=fill_parent android:layout_height=wrap_content android:topOffset=5px android:bottomOffset=7px android:handle=@+id/playlistHeader android:content=@+id/playList ImageView android:id=@id/playlistHeader android:focusable=true android:clickable=true android:scaleType=center android:src=@drawable/ic_mp_current_playlist_btn android:layout_height=56dip android:layout_width=fill_parent / ListView android:id=@+id/playList android:layout_width=fill_parent android:layout_height=fill_parent android:background=@color/grid_dark_background/ /com.android.internal.widget.SlidingDrawer The XML above has both the content and the handle attribute and worked fine in RC30? Does anyone know what has changed and how to fix it? Stefan -- Jean-Baptiste M. JBQ Queru Android Engineer, Google. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- Jean-Baptiste M. JBQ Queru Android Engineer, Google. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Help debugging frequent garbage collection
Thank you very much, that was exactly what I was looking for... I had always just used the eclipse plugin and never thought to try the stand alone tool. DDMS was very helpful and I was pleasantly surprised to see that it even gave me the line number of my code where the allocations were happening. It turns out that I was building the top message string (Level # Lives # Score #) every time the onDraw was called and that was doing a lot of allocating char buffers. Now I just build the string whenever the data has changed, so once ever few seconds rather than 30+ times a second. I have not had a single garbage collection related stutter since then probably because I am calling System.gc() whenever the state of the game has changed (lost a life, end of game, advancing level) Thanks again, I am sure the users of my game will greatly appreciate this bug fix ---Sean Catlin www.snctln.com On Feb 7, 1:27 pm, Romain Guy romain...@google.com wrote: Hi, It's pretty easy. Launch the tool called DDMS (the standalone one, not the one that comes with the Eclipse plugin.) Inside the tool, go to the Allocations Tracker tab. Click Start Tracking, use your app a little, then click Get Allocations. You will get a list of all allocations with, for each one of them, the stack trace to the allocation. On Sat, Feb 7, 2009 at 9:48 AM, snctln catlin.s...@gmail.com wrote: I am having an issue with my latest game (available in the market as BreakTheBlocks Lite) This is a simple arcade style game, It started with a thread controlling the game loop but now I just have a runnable that performs the game loop functions and then posts back to itself. In its original release there was a noticeable stutter in the game every other second or so. After a great deal of time debugging I finally realized that every time the stutter happened LogCat showed that garbage collection was taking place. I went through my code and got rid of creating as many temporary objects as possible. After that the stutter went from happening every 1.5 seconds to happening every 13-16 seconds. This is much better, but I can't seem to reduce the time any further. According to LogCat the garbage collector is still running on my game thread every 15 seconds I see the message GC freed 19833 objects / 878848 bytes in 131ms... and since my game runs at about 30 frames a second a 131 millisecond stutter causes about 4 frames to be dropped which is an annoyance for me and the users of my game. So my question is What can I do to further debug this problem? I have always known garbage collection existed but I have never bothered to care about it until now because it is finally affecting the performance of my app (and I am a C++ programmer by day so I usually forget about the GC) Is there any way to see what the garbage collector is collecting? Is there any way that I can tweak the behavior of the GC for my app? Sorry for the long winded question and thank you in advance for any responses -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] App source from Git not compatible with current SDK?
I loaded up the Alarm Clock app from the current git (http:// android.git.kernel.org/?p=platform/packages/apps/ AlarmClock.git;a=snapshot;h=c8208f9f6ff76479da3b1eb0cedbd5500b8be1f4;sf=tgz) into eclipse, and there are a lot of errors, unfound imports and things like that. Are the 'cupcake' versions of the /apps/ incompatible with the current SDK? Should I bother trying to fix them? Thanks! Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Please Help! Service seems to sleep when phone is inactive
Thanks for the reply. I've been reading and tweaking for over a week trying to figure this out. Thats a good idea to use the Alarm Manager. I think I will give that a try. I would still like to hear from a more experienced devloper or a google engineer if this is the way an Android service is supposed to behave. On Feb 7, 3:29 pm, Greg White debauchedsl...@gmail.com wrote: On Sat, Feb 7, 2009 at 11:50 AM, Brian clarkbrianc...@gmail.com wrote: While testing the service, I have come across something interesting. My problem is that the service appears to sleep or pause for a few hours, run a short time, and then sleep for a few more hours, then run a short time, etc when the phone has become inactive. I'm interested to hear what others say. My experience mirrors yours. I believe the phone is going to sleep and freezing the service. What I did was to use the AlarmManager to wake the service to do its work. While it was working, I used a wake lock to keep the phone from sleeping. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Local communication with a service from another APK that runs in the same process
In case it would help, here is the relevant code: The two classes (LocalServiceBinder and LocalService) used to bind to the service and obtain a reference to it: - package localservice; import android.os.Binder; public abstract class LocalServiceBinder extends Binder{ public abstract LocalService getLocalService(); } - package localservice; public interface LocalService{ public String getPid(); } - A sample activity in APK #1 that binds with the service and also implements the ServiceConnection interface - package kanonov.t1; import localservice.LocalService; import localservice.LocalServiceBinder; import android.app.Activity; import android.content.ComponentName; import android.content.Intent; import android.content.ServiceConnection; import android.os.Bundle; import android.os.IBinder; import android.util.Log; public class T1 extends Activity implements ServiceConnection{ public static final String TAG = Test; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.main); Log.d(TAG, T1 onCreate); bindService(new Intent(kanonov.localservice), this, BIND_AUTO_CREATE); } @Override public void onServiceConnected(ComponentName name, IBinder service){ Log.d(TAG, T1 onServiceConnected + android.os.Process.myPid()); if (service == null){ try{ LocalServiceBinder lsb = (LocalServiceBinder)service; LocalService ls = lsb.getLocalService(); Log.i(TAG, My PID is: + android.os.Process.myPid()); Log.i(TAG, LocalService Process' PID is: + ls.getPid()); }catch(Exception e){ Log.e(TAG, Error in connection: + e.getMessage(), e); } unbindService(this); }else{ Log.e(TAG, Binder is null!); } } @Override public void onServiceDisconnected(ComponentName name){} } The actual service in APK #2 - package kanonov.t2; import localservice.LocalService; import localservice.LocalServiceBinder; import android.app.Service; import android.content.Intent; import android.util.Log; public class LS extends Service implements LocalService{ public static final String TAG = Test; @Override public LocalServiceBinder onBind(Intent intent){ Log.d(TAG, LocalService onBind + android.os.Process.myPid()); return new LocalServiceBinder(){ @Override public LocalService getLocalService(){ Log.d(TAG, T2LS getLocalService); return LS.this; } }; } @Override public String getPid(){ Log.d(TAG, LocalService getPid); return + android.os.Process.myPid(); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Solved Preferences Reset Problem
A while ago, I posted (see links below) about a problem with my app. Whenever the app was killed by the OS, either memory cleanup or device restart, all the preferences were reset. Since my app worked entirely from those preferences, it made it pretty much useless. I found out that persistent for SharedPreferences is not turned on by default. If you add the following attribute to the root element, PreferenceScreen, of your preferences xml file, then it will turn persistence on and your preferences will not get reset any more. android:persistent=true I hope this helps some of you out there, as it was very frustrating for me. Thanks, Eric http://groups.google.com/group/android-developers/browse_frm/thread/a1f4cb597689374e http://groups.google.com/group/android-developers/browse_frm/thread/afdecee0355fb700 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SlidingDrawer not working with RC33
That means your app will break in cupcake though. Please, please don't use private APIs, it only hurts the users :( On Feb 7, 2009 1:43 PM, Stefan skyntc...@gmail.com wrote: After digging a bit around in the source code, it looks like the namespace used for the attributes of the internal widgets has changed in RC33 from xmlns:android=http://schemas.android.com/apk/res/ android to some other namespace (probably something like http://schemas.android.com/apk/res/android.intenral ??) and that caused the SlidingDrawer to not find its attributes. Well... one should never rely on internal classes, but... the SlidingDrawer is actually so useful... I am glad it will make it as an officially supported class. On Feb 7, 4:34 pm, Romain Guy romain...@google.com wrote: Even worse, SlidingDrawer will move ... On Sat, Feb 7, 2009 at 12:14 PM, Jean-Baptiste Queru j...@android.com wrote:Oh, ah, I had... On Sat, Feb 7, 2009 at 11:28 AM, Romain Guy romain...@google.com wrote:No, SlidingDraw... On Sat, Feb 7, 2009 at 7:18 AM, Jean-Baptiste Queru j...@android.com wrote: Can you please report this issue inhttp://b.android.com/? (a plain copy-paste will do).Thanks, JBQ On Sat, Feb 7, 2009 at 6:54 AM, Stefan skyntc...@gmail.com wrote: It appears that ... romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private... Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private suppo... --~--~-~--~~~---~--~~ You received this message because you are subs... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: App source from Git not compatible with current SDK?
The system apps are not SDK compliant yet. We'd like to fix them but no eta yet. On Feb 7, 2009 2:07 PM, Rich miser...@gmail.com wrote: I loaded up the Alarm Clock app from the current git (http:// android.git.kernel.org/?p=platform/packages/apps/ AlarmClock.git;a=snapshot;h=c8208f9f6ff76479da3b1eb0cedbd5500b8be1f4;sf=tgz) into eclipse, and there are a lot of errors, unfound imports and things like that. Are the 'cupcake' versions of the /apps/ incompatible with the current SDK? Should I bother trying to fix them? Thanks! Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SlidingDrawer not working with RC33
Even worse, it hurts the entire ecosystem, by making users believe that plaftorm upgrades have bugs when in fact the applications are broken to start with. JBQ On Sat, Feb 7, 2009 at 3:18 PM, Romain Guy romain...@google.com wrote: That means your app will break in cupcake though. Please, please don't use private APIs, it only hurts the users :( On Feb 7, 2009 1:43 PM, Stefan skyntc...@gmail.com wrote: After digging a bit around in the source code, it looks like the namespace used for the attributes of the internal widgets has changed in RC33 from xmlns:android=http://schemas.android.com/apk/res/ android to some other namespace (probably something like http://schemas.android.com/apk/res/android.intenral ??) and that caused the SlidingDrawer to not find its attributes. Well... one should never rely on internal classes, but... the SlidingDrawer is actually so useful... I am glad it will make it as an officially supported class. On Feb 7, 4:34 pm, Romain Guy romain...@google.com wrote: Even worse, SlidingDrawer will move ... On Sat, Feb 7, 2009 at 12:14 PM, Jean-Baptiste Queru j...@android.com wrote:Oh, ah, I had... On Sat, Feb 7, 2009 at 11:28 AM, Romain Guy romain...@google.com wrote:No, SlidingDraw... On Sat, Feb 7, 2009 at 7:18 AM, Jean-Baptiste Queru j...@android.com wrote: Can you please report this issue inhttp://b.android.com/? (a plain copy-paste will do).Thanks, JBQ On Sat, Feb 7, 2009 at 6:54 AM, Stefan skyntc...@gmail.com wrote: It appears that ... romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private... Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private suppo... -- Jean-Baptiste M. JBQ Queru Android Engineer, 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 android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android Developers in Atlanta, GA
Hey Alton, I saw that you already joined Droidlanta, great to have you. We are planning a meetup to discuss various things to get this group going. We would love to have you attend. We tentatively have the 4th Tuesday of the month setup to meet. Check the meetup post in Droidlanta for more information. Again, Welcome! On Feb 7, 3:12 pm, Alton uwodino...@gmail.com wrote: Hi there, I'm in Marietta and would be interested. Alton On Jan 30, 9:10 am, BarbieDahl sr9...@gmail.com wrote: Are there any developers inAtlanta, GA that would like to meet and discuss android app ideas as well as learn new and advanced android topics? I would like to network with some other developers in and aroundAtlanta, GA for help, mentoring and support. Please reply if you are interested. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android Developers in Atlanta, GA
Hello mission4u, We would love to checkout your app. You can join our group if you want, we want to do some meetups since the group so far is made up of Atlanta area folks but we will post some stuff to our group website as well. The group is called Droidlanta, you can join the group and check out our posts. Welcome aboard, we would love to have you. Thanks, Barbara On Feb 5, 7:32 pm, mission4u missio...@gmail.com wrote: I am in Charlotte, NC and have designed app named iTubeStatus... it wont be available in US Android market but you can search its description online. Let me know if you guys wanna see the app. I can change a setting for a while I can join your team too...Thanks On Jan 30, 9:10 am, BarbieDahl sr9...@gmail.com wrote: Are there any developers in Atlanta, GA that would like to meet and discuss android app ideas as well as learn new and advanced android topics? I would like to network with some other developers in and around Atlanta, GA for help, mentoring and support. Please reply if you are interested. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SlidingDrawer not working with RC33
Yes, I do agree that relying on private APIs is dangerous and should be avoided for all the reasons you mention. (The only reason I posted my findings is to save somebody the debugging time as it was not obvious what was the reason at first) This brings another related question. Is there a single place where we as developers can see what has changed between the public releases of the API's for example from RC30 = RC33? - (preferably both internal and external changes)? The only thing I could find is that RC33 has fixed several bugs and added several features, but nothing specific about what has changed and what bugs have been fixed. Stefan On Feb 7, 6:21 pm, Jean-Baptiste Queru j...@android.com wrote: Even worse, it hurts the entire ecosystem, by making users believe that plaftorm upgrades have bugs when in fact the applications are broken to start with. JBQ On Sat, Feb 7, 2009 at 3:18 PM, Romain Guy romain...@google.com wrote: That means your app will break in cupcake though. Please, please don't use private APIs, it only hurts the users :( On Feb 7, 2009 1:43 PM, Stefan skyntc...@gmail.com wrote: After digging a bit around in the source code, it looks like the namespace used for the attributes of the internal widgets has changed in RC33 from xmlns:android=http://schemas.android.com/apk/res/ android to some other namespace (probably something likehttp://schemas.android.com/apk/res/android.intenral ??) and that caused the SlidingDrawer to not find its attributes. Well... one should never rely on internal classes, but... the SlidingDrawer is actually so useful... I am glad it will make it as an officially supported class. On Feb 7, 4:34 pm, Romain Guy romain...@google.com wrote: Even worse, SlidingDrawer will move ... On Sat, Feb 7, 2009 at 12:14 PM, Jean-Baptiste Queru j...@android.com wrote:Oh, ah, I had... On Sat, Feb 7, 2009 at 11:28 AM, Romain Guy romain...@google.com wrote:No, SlidingDraw... On Sat, Feb 7, 2009 at 7:18 AM, Jean-Baptiste Queru j...@android.com wrote: Can you please report this issue inhttp://b.android.com/?(a plain copy-paste will do).Thanks, JBQ On Sat, Feb 7, 2009 at 6:54 AM, Stefan skyntc...@gmail.com wrote: It appears that ... romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private... Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private suppo... -- Jean-Baptiste M. JBQ Queru Android Engineer, 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 android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Please Help! Service seems to sleep when phone is inactive
Android uses a very proactive power management approach. Basically, the policy is to go to sleep if not told otherwise. The way to signal to the system that it should stay awake are wakelocks. As soon as there's at least one app holding a wakelock, the system won't go to sleep and all the running processes can do their work (even those that are not holding a wakelock at that moment). Any application with the according permission can acquire a wakelock and thus prevent the system from sleeping. There are several wakelock levels, you can read all the details here: http://code.google.com/android/reference/android/os/PowerManager.html In your case, as a background service, you probably want to hold a PARTIAL_WAKE_LOCK which will keep the CPU running as long as it's acquired. Please be very careful with using the wakelock, as this affects battery life a lot and it is hard for users to determine which application is causing the drainage and uninstall it. For every acquire(), make sure you have a matching release() call that is guaranteed to be executed* and only hold the lock for the minimal amount of time. Also ask yourself whether it's crucial that your service is preventing the system to go to sleep or whether it would be enough to do work only when the system is awake anyway (e.g. because the user is interacting with the phone). The AlarmManager can be used to get an intent delivered to you at a certain time, regardless of the sleep-state of the system. The AlarmManager will wake the system up if necessary and hold a wakelock until the intent has been delivered to you. As you should not do long-lasting work on the main thread of your service (which is receiving the intent), you should spawn a thread and manually acquire a wakelock. Sorry for the long post and I hope this information is helpful (and accurate :-)). Christoph * One has to pay special attention to the control flow in the case of exceptions. Make sure that a thrown exception won't prevent release() from being called: void doSomeWork() throws SomeException { ... } void barWrong() { try { wakelock.acquire(); doSomeWork(); wakelock.release(); // - Won't be called on exception } catch (SomeException e) { Log.w(...); } } void barRight() { try { wakelock.acquire(); doSomeWork(); } catch (SomeException e) { Log.w(...); } finally { wakelock.release(); } } On Sat, Feb 7, 2009 at 11:19 PM, clarkbriancarl clarkbrianc...@gmail.com wrote: Thanks for the reply. I've been reading and tweaking for over a week trying to figure this out. Thats a good idea to use the Alarm Manager. I think I will give that a try. I would still like to hear from a more experienced devloper or a google engineer if this is the way an Android service is supposed to behave. On Feb 7, 3:29 pm, Greg White debauchedsl...@gmail.com wrote: On Sat, Feb 7, 2009 at 11:50 AM, Brian clarkbrianc...@gmail.com wrote: While testing the service, I have come across something interesting. My problem is that the service appears to sleep or pause for a few hours, run a short time, and then sleep for a few more hours, then run a short time, etc when the phone has become inactive. I'm interested to hear what others say. My experience mirrors yours. I believe the phone is going to sleep and freezing the service. What I did was to use the AlarmManager to wake the service to do its work. While it was working, I used a wake lock to keep the phone from sleeping. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: RC33 for Dev Phone
On Sat, Feb 7, 2009 at 11:42 AM, Brad Fuller bradallenful...@gmail.com wrote: On Fri, Feb 6, 2009 at 6:16 PM, Disconnect dc.disconn...@gmail.com wrote: Install jf's 1.41-rc33. http://andblogs.net/tag/jf It is signed with test keys -and- its a full install instead of a patch, so no perquisites. Has anyone tried this on their devphone? I only have one devphone so I'm reluctant to try. I did it and it seems to work. I commented on the site on the procedure I used: Ok, I found out why I couldn't load the update package, I didn't have the right sequence. It is: 1. Rename file that you would like to update to update.zip 2. Copy to SD card. Make sure you unmount from your PC so it'll copy completely over. 3. Turn off G1 5. Power back on holding down END_CALL+Home+Back keys. You'll have to hold it down until it responds. 6. When icon screen appears, Hold down Alt-L. You will get a list of operations to perform. 7 - You might have to delete your User Data by selecting Alt-W. I had to do this to prevent the Android icon from hanging when rebooting. Unfortunatley, all user data is gone. If you are using ATT, you'll have to add your APN again. 8. Hold down Alt-S to load update. This will take a minute. A list of operations will be shown. WAIT until it says to Press Home+Back to reboot. 9. After loading, Hold down Home+Back keys. It'll reboot a couple of times. That should be it. -- Brad Fuller --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: WebView responding to touch events
Mark, I'm not sure it would work, but have you tried to just setFocusableInTouchMode(true) on the WebView object? Seems a lot easier than messing with the touch handler. Michael On Feb 7, 3:45 pm, Mark Nuetzmann mark.nuetzm...@gmail.com wrote: Sergey, I ended up doing basically what you posted but only for the ACTION_DOWN as that seemed to handle it. Fred, I tried adding an OnClickListener but never got any callbacks. I assume that the WebView is designed to handle this internally and expects you to use the WebViewClient.shouldOverrideUrlLoading() to respond to the clicks. As to whether it happens in the emulator I am not sure. I learned a long time ago with WM not to trust emulators so I only debug on-device... Thanks for the comments guys! Mark On Feb 7, 11:28 am, Sergey Ten sergeyte...@gmail.com wrote: Mark, I think I had this problem myself and could solve it by using the following code: webView.setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_UP: if (!v.hasFocus()) { v.requestFocus(); } break; } return false; } }); Hope this would help, Sergey On Sat, Feb 7, 2009 at 12:07 AM, Mariano Kamp mariano.k...@gmail.comwrote: Mark, maybe you should post some code? On Thu, Feb 5, 2009 at 4:36 PM, Mark Nuetzmann mark.nuetzm...@gmail.comwrote: I have an Activity that has a WebView that contains some simple html that allows me to display a Terms Conditions link that if touched or clicked calls another activity. My problem is unless the link in the WebView has focus (ie, the text is wrapped with that little orange focus) I cannot touch the link and have it work. If any other view on the activity has focus, touching the WebView with the link does nothing. The other Views that had focus loose focus, but the WebView does not receive focus. I have tried calling setFocusable(true) and setFocusableInTouchMode(true) but that does not do any good... I would really like to know what you have to do to get a WebView to respond to touch events without using the trackball to scroll to the view before touching it. thank you, Mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: WebView responding to touch events
Sorry, obviously you have. Nevermind. Michael On Feb 7, 8:48 pm, kolby kolbys...@gmail.com wrote: Mark, I'm not sure it would work, but have you tried to just setFocusableInTouchMode(true) on the WebView object? Seems a lot easier than messing with the touch handler. Michael On Feb 7, 3:45 pm, Mark Nuetzmann mark.nuetzm...@gmail.com wrote: Sergey, I ended up doing basically what you posted but only for the ACTION_DOWN as that seemed to handle it. Fred, I tried adding an OnClickListener but never got any callbacks. I assume that the WebView is designed to handle this internally and expects you to use the WebViewClient.shouldOverrideUrlLoading() to respond to the clicks. As to whether it happens in the emulator I am not sure. I learned a long time ago with WM not to trust emulators so I only debug on-device... Thanks for the comments guys! Mark On Feb 7, 11:28 am, Sergey Ten sergeyte...@gmail.com wrote: Mark, I think I had this problem myself and could solve it by using the following code: webView.setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_UP: if (!v.hasFocus()) { v.requestFocus(); } break; } return false; } }); Hope this would help, Sergey On Sat, Feb 7, 2009 at 12:07 AM, Mariano Kamp mariano.k...@gmail.comwrote: Mark, maybe you should post some code? On Thu, Feb 5, 2009 at 4:36 PM, Mark Nuetzmann mark.nuetzm...@gmail.comwrote: I have an Activity that has a WebView that contains some simple html that allows me to display a Terms Conditions link that if touched or clicked calls another activity. My problem is unless the link in the WebView has focus (ie, the text is wrapped with that little orange focus) I cannot touch the link and have it work. If any other view on the activity has focus, touching the WebView with the link does nothing. The other Views that had focus loose focus, but the WebView does not receive focus. I have tried calling setFocusable(true) and setFocusableInTouchMode(true) but that does not do any good... I would really like to know what you have to do to get a WebView to respond to touch events without using the trackball to scroll to the view before touching it. thank you, Mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Please Help! Service seems to sleep when phone is inactive
Wow, some great information here. Thanks for taking the time! On Feb 7, 6:38 pm, Christoph Studer chstu...@gmail.com wrote: Android uses a very proactive power management approach. Basically, the policy is to go to sleep if not told otherwise. The way to signal to the system that it should stay awake are wakelocks. As soon as there's at least one app holding a wakelock, the system won't go to sleep and all the running processes can do their work (even those that are not holding a wakelock at that moment). Any application with the according permission can acquire a wakelock and thus prevent the system from sleeping. There are several wakelock levels, you can read all the details here:http://code.google.com/android/reference/android/os/PowerManager.html In your case, as a background service, you probably want to hold a PARTIAL_WAKE_LOCK which will keep the CPU running as long as it's acquired. Please be very careful with using the wakelock, as this affects battery life a lot and it is hard for users to determine which application is causing the drainage and uninstall it. For every acquire(), make sure you have a matching release() call that is guaranteed to be executed* and only hold the lock for the minimal amount of time. Also ask yourself whether it's crucial that your service is preventing the system to go to sleep or whether it would be enough to do work only when the system is awake anyway (e.g. because the user is interacting with the phone). The AlarmManager can be used to get an intent delivered to you at a certain time, regardless of the sleep-state of the system. The AlarmManager will wake the system up if necessary and hold a wakelock until the intent has been delivered to you. As you should not do long-lasting work on the main thread of your service (which is receiving the intent), you should spawn a thread and manually acquire a wakelock. Sorry for the long post and I hope this information is helpful (and accurate :-)). Christoph * One has to pay special attention to the control flow in the case of exceptions. Make sure that a thrown exception won't prevent release() from being called: void doSomeWork() throws SomeException { ... } void barWrong() { try { wakelock.acquire(); doSomeWork(); wakelock.release(); // - Won't be called on exception } catch (SomeException e) { Log.w(...); } } void barRight() { try { wakelock.acquire(); doSomeWork(); } catch (SomeException e) { Log.w(...); } finally { wakelock.release(); } } On Sat, Feb 7, 2009 at 11:19 PM, clarkbriancarl clarkbrianc...@gmail.com wrote: Thanks for the reply. I've been reading and tweaking for over a week trying to figure this out. Thats a good idea to use the Alarm Manager. I think I will give that a try. I would still like to hear from a more experienced devloper or a google engineer if this is the way an Android service is supposed to behave. On Feb 7, 3:29 pm, Greg White debauchedsl...@gmail.com wrote: On Sat, Feb 7, 2009 at 11:50 AM, Brian clarkbrianc...@gmail.com wrote: While testing the service, I have come across something interesting. My problem is that the service appears to sleep or pause for a few hours, run a short time, and then sleep for a few more hours, then run a short time, etc when the phone has become inactive. I'm interested to hear what others say. My experience mirrors yours. I believe the phone is going to sleep and freezing the service. What I did was to use the AlarmManager to wake the service to do its work. While it was working, I used a wake lock to keep the phone from sleeping. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Context.startService - The service does not stay running...
Look into the PowerManager: http://code.google.com/android/reference/android/os/PowerManager.html -- Jon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: App source from Git not compatible with current SDK?
I see.. If that's the case, how were they compiled? Do you have a private SDK different from our SDK? Is there anyway I would be able to get this code to compile? As far as I can tell, the only two unresolvable problems seem to be a missing intent, Intent.FLAG_ACTIVITY_NO_USER_ACTION and reference to a Vibrator() class (heh). The Intent seems like a possibly unsolvable part. So what should I do.. Will I be able to clean this code up and use it, or should I just wait for the GPowers to be release a full SDK? I'm fairly miffed about this quite honestly, as what is the point of having this as an open source project if we can't even compile the code to be working on. Rich On Feb 7, 6:20 pm, Romain Guy romain...@google.com wrote: The system apps are not SDK compliant yet. We'd like to fix them but no eta yet. On Feb 7, 2009 2:07 PM, Rich miser...@gmail.com wrote: I loaded up the Alarm Clock app from the current git (http:// android.git.kernel.org/?p=platform/packages/apps/ AlarmClock.git;a=snapshot;h=c8208f9f6ff76479da3b1eb0cedbd5500b8be1f4;sf=tgz) into eclipse, and there are a lot of errors, unfound imports and things like that. Are the 'cupcake' versions of the /apps/ incompatible with the current SDK? Should I bother trying to fix them? Thanks! Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: App source from Git not compatible with current SDK?
They are compiled against the framework library, before the non-SDK symbols have been stripped from it. The platform build system -can- build against the SDK version, but that feature didn't exist until very late in to the 1.0 platform, so many of the apps don't use it, and so as much as one tries to avoid it they will end up unintentionally using non-SDK methods. Also there was a lot of cleanup of the SDK that happened late in 1.0, when there wasn't time to update all of the existing apps to use new official SDK APIs. As for the Intent flag, that is actually a new feature in Cupcake (which is in the SDK), so it just means you are trying to build a post-1.0 application against the 1.0 SDK. There is a very good chance this won't work, like here. If you want to build against the 1.0 SDK, you really should do this from the 1.0 version of the app. I don't know about the Vibrator thing; there is certaily a public API for controlling the vibrator. Some specific answers: On Sat, Feb 7, 2009 at 6:39 PM, Rich miser...@gmail.com wrote: If that's the case, how were they compiled? Do you have a private SDK different from our SDK? Build it with the platform build system, as everyone else who currently works on the app does. There is nothing hidden about this. So what should I do.. Will I be able to clean this code up and use it, or should I just wait for the GPowers to be release a full SDK? There is nothing being kept from you. The full complete source to the platform is right up there in git for you to do whatever you want with it. I'm fairly miffed about this quite honestly, as what is the point of having this as an open source project if we can't even compile the code to be working on. Before publicly getting miffed at people (about stuff they gave you for free no less), it is good to have an idea of what you are getting miffed about. :} -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SlidingDrawer not working with RC33
When a new SDK is posted, there is a complete API diff and overview of the changes. However, there is very little change to the platform APIs in 1.1, so there isn't much to say about this one. I'm not sure when an SDK for it will be available. Also, out of curiosity, how did you go about using the private class? If you are actually using the SDK, you shouldn't be able to use any of the private classes, just to protect people from accidentally using things that will break on them. Finally, if there is a class like this in the internal implementation that you really want to use, just copy it out and build the copy in to your own code. That way your code won't break when the system changes. On Sat, Feb 7, 2009 at 4:10 PM, Stefan skyntc...@gmail.com wrote: Yes, I do agree that relying on private APIs is dangerous and should be avoided for all the reasons you mention. (The only reason I posted my findings is to save somebody the debugging time as it was not obvious what was the reason at first) This brings another related question. Is there a single place where we as developers can see what has changed between the public releases of the API's for example from RC30 = RC33? - (preferably both internal and external changes)? The only thing I could find is that RC33 has fixed several bugs and added several features, but nothing specific about what has changed and what bugs have been fixed. Stefan On Feb 7, 6:21 pm, Jean-Baptiste Queru j...@android.com wrote: Even worse, it hurts the entire ecosystem, by making users believe that plaftorm upgrades have bugs when in fact the applications are broken to start with. JBQ On Sat, Feb 7, 2009 at 3:18 PM, Romain Guy romain...@google.com wrote: That means your app will break in cupcake though. Please, please don't use private APIs, it only hurts the users :( On Feb 7, 2009 1:43 PM, Stefan skyntc...@gmail.com wrote: After digging a bit around in the source code, it looks like the namespace used for the attributes of the internal widgets has changed in RC33 from xmlns:android= http://schemas.android.com/apk/res/ android to some other namespace (probably something likehttp:// schemas.android.com/apk/res/android.intenral ??) and that caused the SlidingDrawer to not find its attributes. Well... one should never rely on internal classes, but... the SlidingDrawer is actually so useful... I am glad it will make it as an officially supported class. On Feb 7, 4:34 pm, Romain Guy romain...@google.com wrote: Even worse, SlidingDrawer will move ... On Sat, Feb 7, 2009 at 12:14 PM, Jean-Baptiste Queru j...@android.com wrote:Oh, ah, I had... On Sat, Feb 7, 2009 at 11:28 AM, Romain Guy romain...@google.com wrote:No, SlidingDraw... On Sat, Feb 7, 2009 at 7:18 AM, Jean-Baptiste Queru j...@android.com wrote: Can you please report this issue inhttp://b.android.com/?(ahttp://b.android.com/?%28aplain copy-paste will do).Thanks, JBQ On Sat, Feb 7, 2009 at 6:54 AM, Stefan skyntc...@gmail.com wrote: It appears that ... romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private... Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private suppo... -- Jean-Baptiste M. JBQ Queru Android Engineer, Google. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] can not see the files after yaffs2 image mounted
Dear all, I created img.yaffs2 using mkyaffs2image and then mounted it into Ubuntu MTD NAND flash simulator. so if I use 'cat /proc/filesystems' I can see yaffs and yaffs2 and by 'cat /proc/mtd' I can see /dev/mtd0에 Nand simulator partition 0. (block size is 0x4000) after that using mtd-utils, I did 'flash_eraseall /dev/mtd0' 'nandwrite -a -o /dev/mtd0 img.yaffs2 so I can see the image is writing as writeing data to block 0 writeing data to block 4000 writeing data to block 8000 after that to see the files I mounted mount -t yaffs2 /dev/mtdblock0 /mnt/yaffs2 but when I type the command 'ls -l /mnt/yaffs2' there is only 'lost+found' directory What's wrong with me? 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 android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: can not see the files after yaffs2 image mounted
Hi, Can u mention the steps which u have used to create yaffs2 image from u android file system? Did u do u yaffs2 file system image for both data.img and system.img? In android SDK1.0 data.img is read only, u should not create yaffs2 image for it, rather u need to create RAMFS or CRAMFS image for it. only system.img needs to be yaffs2 formated and mounted on system! How r u burning yaffs2 image? from boot loader or from kernel? Please elaborate steps u did from creating an image to mounting the file system, it will rather give clear picture on what mistake u could have done in installing yaffs2 image! Best Regards, Rajesh N 2009/2/8 ebmajor ebma...@hanmail.net Dear all, I created img.yaffs2 using mkyaffs2image and then mounted it into Ubuntu MTD NAND flash simulator. so if I use 'cat /proc/filesystems' I can see yaffs and yaffs2 and by 'cat /proc/mtd' I can see /dev/mtd0에 Nand simulator partition 0. (block size is 0x4000) after that using mtd-utils, I did 'flash_eraseall /dev/mtd0' 'nandwrite -a -o /dev/mtd0 img.yaffs2 so I can see the image is writing as writeing data to block 0 writeing data to block 4000 writeing data to block 8000 after that to see the files I mounted mount -t yaffs2 /dev/mtdblock0 /mnt/yaffs2 but when I type the command 'ls -l /mnt/yaffs2' there is only 'lost+found' directory What's wrong with me? 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 android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: native C++ SIP stack on Android
You are posting to android-developers, for talking about writing applications using the SDK, which does not currently support native code, so you can't use JNI at all. If you post on android-platform or android-framework, however, about adding code to the platform itself, the answer may be very different. ;) On Fri, Jan 9, 2009 at 1:37 AM, pinguin e...@vinacom.de wrote: Ok, thanks. So it would be able when i have a SIP stack written in C. Is there any restrictions using JNI in adroid. Can i load all libs of my sip stack ? On 8 Jan., 18:08, David Turner di...@android.com wrote: first, you cannot have C++ code in the kernel. however, depending on how your stack is designed, you may be able to use it from Java through JNI given that you give absolutely no information about your stack's interface, it's really difficult to answer your question On Thu, Jan 8, 2009 at 5:57 PM, pinguin e...@vinacom.de wrote: Can i port SIP stack written in C++ to android and let it running as service in kernel ? and the GUI will communicate with SIP stack through JNI ? -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Graphics question: bilinear interpolation
Is there an Android API for performing bilinear interpolation? I discovered that my own interpolation implementation is extremely slow running on the G1 so it's pretty useless. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Reusing the +/- number spinner from TimePickerDialog?
DO NOT DO THIS. See the word internal in there? That means internal. Do not touch. Your code will break in the future. In fact some platform engineer just may go rename that class for no reason at all and break your code. 2009/2/4 solomonk denis.solone...@gmail.com No need to clone it if you really don't want to. You can use it in XML layot like com.android.internal.widget.NumberPicker android:id=@+id/picker android:layout_width=wrap_content android:layout_height=wrap_content/ and then use reflection to set settings: Object o = findViewById(R.id.picker); Class c = o.getClass(); try { Method m = c.getMethod(setRange, int.class, int.class); m.invoke(o, 0, 9); } catch (Exception e) { Log.e(, e.getMessage()); } It sucks but it works :) On 28 янв, 20:17, Mark Murphy mmur...@commonsware.com wrote: Will wrote: Setting a breakpoint when a DatePickerDialog is open on the emulator's screen shows a com.android.internal.widget.NumberPicker for month, year, and date (1numberpickereach for a total of three NumberPickers). It looks like the same widget used for a timepicker; based on the name I'm sure it is. Importing android.internal.widget doesn't work. It was worth a shot. The source to it is probably available on source.android.com. Clone your own until they open that one up in the SDK. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 Available! -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: access to internal telephony
Not any time soon. Most of the classes there will only work when running code in the phone process, and making them work in other process would be significant work. Also on the G1 I don't believe that anything in the application processor even has access the voice data stream, so it just wouldn't be able to do what you want even if you were modifying the platform itself. On Sat, Feb 7, 2009 at 11:04 AM, Gero Mudersbach ger...@web.de wrote: Hello, are there plans to make com.android.internal.telephony available public? As far as I understand it is currently not possible to write e.g. an answering machine within the current framework (standard sdk), because direct access to acceptCall and hangup methods is missing. Best G. Mudersbach -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Possible Bug in Dialog-Persistence (onCreateDialog / onPrepareDialog)
Hi all, I'm not 100% sure whether this is a bugs, so I'm asking on here. Issue #1: In my Acticity the user is passing trough some dialogs: D/OPENSTREETMAP( 1468): Creating dialog: 1 D/OPENSTREETMAP( 1468): Preparing dialog: 1 D/OPENSTREETMAP( 1468): Creating dialog: 0 D/OPENSTREETMAP( 1468): Preparing dialog: 0 D/OPENSTREETMAP( 1468): Creating dialog: 5 D/OPENSTREETMAP( 1468): Preparing dialog: 5 While a dialog is open, the screenorientation is changed manually. // Change in ScreenOrientation D/OPENSTREETMAP( 1468): Creating dialog: 0 D/OPENSTREETMAP( 1468): Creating dialog: 1 D/OPENSTREETMAP( 1468): Creating dialog: 5 The Bug is in my opinion that onPrepareDialog is not called after the change of the Screenorientation. I assume it would happen to the currently opened Dialog. Any suggestion is welcomed. Best Regards, plusminus --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Graphics question: bilinear interpolation
How about this: http://code.google.com/android/reference/android/graphics/Paint.html#FILTER_BITMAP_FLAG On Sat, Feb 7, 2009 at 8:06 PM, j jac...@gmail.com wrote: Is there an Android API for performing bilinear interpolation? I discovered that my own interpolation implementation is extremely slow running on the G1 so it's pretty useless. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Read/write JPEG metadata (e.g. in EXIF format)
Hi Mike, The standard staff - creation date and location, original rotation etc. The thing is, and correct me if you see otherwise, that while an imported jpeg get added to the MediaStore, all this info stored in its metadata is not converted to MediaStore metadata, hence the need for direct jpeg acces. GiladH --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: can not see the files after yaffs2 image mounted
Hi Rajesh, thank you for your reply. Here are the details. First of all, I try to create my own yaffs2 image so I don't use system.img and userdata.img. My test environment is 'x86 desktop Ubuntu + MTD Nand flash simulator' since I want to verify only if my yaffs2 image works well I downloaded yaffs2 source code and compiled on my desktop Ubuntu to generate mkyaffs2image. and downloaded also MTD-Utils for flash tools and nandwrite. After that, I created 'test' directory and copied several files in it and then did the commands as steps 1. 'mkyaffs2image ./test img.yaffs2' 2. flash_eraseall /dev/mtd0 3. nandwrite -a -o /dev/mtd0 img.yaffs2 4. mount -t yaffs2 /dev/mtdblock0 /mnt/yaffs2 I've done all the steps without errors. However when I typed 'ls -l /mnt/yaffs2', it shows only 'lost+found' directory I've googled about the trouble so saw some of people have the same error but there is no solution on the web I searched. Regards. On 2월8일, 오후12시59분, Rajesh N rajesh.andr...@gmail.com wrote: Hi, Can u mention the steps which u have used to create yaffs2 image from u android file system? Did u do u yaffs2 file system image for both data.img and system.img? In android SDK1.0 data.img is read only, u should not create yaffs2 image for it, rather u need to create RAMFS or CRAMFS image for it. only system.img needs to be yaffs2 formated and mounted on system! How r u burning yaffs2 image? from boot loader or from kernel? Please elaborate steps u did from creating an image to mounting the file system, it will rather give clear picture on what mistake u could have done in installing yaffs2 image! Best Regards, Rajesh N 2009/2/8 ebmajor ebma...@hanmail.net Dear all, I created img.yaffs2 using mkyaffs2image and then mounted it into Ubuntu MTD NAND flash simulator. so if I use 'cat /proc/filesystems' I can see yaffs and yaffs2 and by 'cat /proc/mtd' I can see /dev/mtd0에 Nand simulator partition 0. (block size is 0x4000) after that using mtd-utils, I did 'flash_eraseall /dev/mtd0' 'nandwrite -a -o /dev/mtd0 img.yaffs2 so I can see the image is writing as writeing data to block 0 writeing data to block 4000 writeing data to block 8000 after that to see the files I mounted mount -t yaffs2 /dev/mtdblock0 /mnt/yaffs2 but when I type the command 'ls -l /mnt/yaffs2' there is only 'lost+found' directory What's wrong with me? 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 android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---