[android-developers] Re: Orientation : onStop onDestroy called from BACK key or not ?
That is a very bad way of doing it. What if the user presses the HOME button? What if the user goes to a different activity using the notification bar? The camera button? What if it's a device that allows switching activities using a custom button? Relying on a button press to detect the lifetime of your application is a major hack and bound to break in many ways. You might want to read the documentation for the Activity class to see how the lifetime of an application works. It goes in detail about what each stage does: onPause wants you to suspend your threads. onDestroy means your app will be gone for good if isFinishing() is set. If you want to handle the specific case of an orientation change, you can respond to onConfigurationChanged(). I would strongly advise against any kind of hacks circumventing those methods. What are you trying to do in your back button code? -Mike On Sep 17, 2:28 pm, Nanard bsegon...@free.fr wrote: I have founded ! Thanks I should not rely on onStop() nor onDestroy() to know when I quit my Activity. The only safe way is : @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { ... do some cleaning here } return super.onKeyDown(keyCode, event); } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] xml unescape
Any tools in java/android sdk to unescape a escaped xml string? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: SensorEvent value array ownership
That sounds dangerous to me (depending on such implementation details). If you need to keep the data around, just copy it into another array you have to hold it. On Fri, Sep 18, 2009 at 8:56 PM, Rud rudmerr...@gmail.com wrote: I can understand the reasoning. My Galactic Guardian game breaks a lot of OO rules with many more static fields and no get/set methods than I would ever use normally. Another area I really want to revisit to see how these impact performance. But I followed the guidelines in the developers web site. One the sensor data issue, would it be safe to assume that the values arrays always contain valid data for all 3 sensors? At least after each sensor has been received once? In order to use the rotation routines you need the magnetic and accelerometer data. This requires keeping one of them locally while waiting for the other to be updated. But if it is valid to use the reference to the underlying array making a copy would not be necessary. I suspect the real answer is not to depend on the behavior since it might change in the future. Rud http://mysticlakesoftware.com/ On Sep 18, 5:21 pm, Dianne Hackborn hack...@android.com wrote: This is actually an anti-Java way of doing things, but useful for performance. :} On Fri, Sep 18, 2009 at 2:21 PM, Rud rudmerr...@gmail.com wrote: Hi, I found the same thing working with the sensors. My comments are at http://mysticlakesoftware.blogspot.com/. Its something I need to revisit because I am not sure I have retained a copy or references to the underlying value. Still adjusting to some of the Java way of doing things. Rud http://mysticlakesoftware.com/ On Sep 18, 1:06 pm, Daber m.a.dabrow...@gmail.com wrote: Hi, I've been experimenting with gsensors on dev phone and I think i found something that needs explanation. The appliaction was comparing g readings with previously read values in following manner float[] mPrevious; float[] v = event.values; // .. compare // mPrevious = v; but after while all comparisions were equal. It seems that event reuses float array object to provide new data in the old array after some time (mPrevious and event.values is the same object). Now here is The question: Who has object ownership -the gsensor framework and i have to make a copy Me - and this is a bug BR, Michał Dąbrowski -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them.- Hide quoted text - - Show quoted text - -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Get dimension from R.attr in Java code
Resources.getDimensionPixelSize (android.R.attr.listPreferredItemHeight) does not work. So how to? And any other way to specify resolution independent dimension values in Java code? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: ADC2 entries so far...
Under Games: Arcade/Action submitted for ADC2 World of Bombs (http://www.zeugame.com/wob2) This Game offers the first Clounding Multiplayer game available on Android and computers It allows you to play easy and fast battles to up 4 players. with any kind configuration whatever you use Android or your Computer eg : players are mixed between Android Devices and Web Browsers in an homogeneous game whatever you are in the bus or in your living room. World of Bombs currently has the following features - A public chat, - Capability to create your own game - World wide ranking - Buddy List It's updated regularly, currently the version is freezed for keeping the Android version compatible with the cloud server version. Thank you and have a good challenge Croco - Show quoted On Sep 18, 6:31 pm, kabir kab...@gmail.com wrote: Education/Reference --- mobilematics -http://www.mobilematics.co.uk On Sep 13, 6:12 pm, Mobidev android.mobi...@gmail.com wrote: Its mid September and ADC team will soon launch the ADC 2 judging application. So far its been a great job by the ADC team with sticking to the submission deadline and swift uploads(leaving aside package name confusion among the participants). Meanwhile, below are about 105 ADC2 entries posted on forum. In case of new additions or corrections please reply to this discussion with category app name links. ADC1 saw about 1788 apps and my guess is ADC2 will see a tleast 2500 apps considering the tight deadline (could have been much higher(4K+) otherwise). From the trend it seems that the Miscellaneous category has far less entries than Prod/Tools and Games(both) categories. Possibly, 21st ranking entry under Prod/Tools could be much better than 3rd ranking entry under Misc category. Unlike ADC1, this time Category will be a key factor in winning; along with Originality, Effective Platform Use, Polish and Indispensability. --- -- Education/Reference Librarium IIhttp://steveoliverc.squarespace.com/ Math Jungle Mystic Maggiehttp://www.phdgaming.com/general_media/mm/ Vivify picture: mathhttp://vivifypicture.com/ Entertainment Daisy Gardenhttp://www.tomgibara.com/android/daisy/garden/ Taps Of Firehttp://code.google.com/p/tapsoffire Games: Arcade/Action CowPotato 3Dhttp://www.froogloid.com/cowpotato FRGhttp://www.woogames.com/ Galactic Guardian: Zap GPShttp://sites.google.com/site/mysticlakesoftware/ Graviturnhttp://www.cyrket.com/package/com.fheft.graviturn Head To Head Racinghttp://headtoheadracing.appspot.com/ Light Racer 3D Trial ProjectINFhttp://www.chickenbrickstudios.com/ UrbanGolf X-Dischttp://www.youtube.com/watch?v=3EkH-b15fPY Zepto Wars - RTS Games: Casual/Puzzle Furdiburbhttp://www.sheado.net/ Goobers Vs. Boogershttp://goobersvsboogers.blogspot.com/ ongPayhttp://www.yakloingames.com/ Relativiahttp://www.polyclefsoftware.com/relativia.html Splat!: Bugs IIhttp://dkdroid.com What the Doodle!? Lifestyle Beer Cloudhttp://greatbrewers.com/story/beercloud-mobile-app Bottle Buzz DoIthttp://curvefish.com/apps/doit.htm FoxyRing http://www.levelupstudio.fr/foxyring Gigboxhttp://www.mygigbox.com/ NetDroid NotiMe!http://www.youtube.com/watch?v=wFjoZmrj40k ReaderScopehttp://www.altcanvas.com/android/readerscope Rhythmatics Alphahttp://www.twitter.com/brownbaggames SpecTrek Media Gallery Map geoPastehttp://www.geopaste.com/ Mediafly Mobile Audio Podcast Client MicroJam MicroJam MyPODhttp://www.my-pod.org/ PackRathttp://packrat.unwesen.de/ Time-Lapsehttp://www.sheado.net/ Uloopshttp://www.uloops.net/ Misc Local Agentshttp://local-agents.appspot.com/ picjiggles litehttp://www.yakloingames.com/ Productivity/Tools Alarmoidhttp://www.youtube.com/watch?v=yNcVkP_vK08 aListhttp://androidalist.blogspot.com AppManagerhttp://curvefish.com/apps/appmanager.htm GeoAlerthttp://sites.google.com/site/appyoursmobile/geoalert Hoccerhttp://www.hoccer.com/ MobileWrite Mobisle Noteshttp://www.facebook.com/pages/MobisleApps/127994296229 MyPageshttp://www.youtube.com/watch?v=75lR4zLy_LQ OpenLoopzhttp://sites.iode.co.uk/openloopz/ Personalyticshttp://personalytics.net/ Skiba PDF Readerhttp://www.anddev.org/skiba_pdf_reader-t6122.html Smart Lockhttp://www.youtube.com/watch?v=ipue9Yhi5VA Talking Calendarhttp://www.pwnwithyourphone.com/
[android-developers] Re: BaseAdapter.getV iew()’s convertView parameter
Carmen Delessio wrote: Watch this video: http://code.google.com/events/io/sessions/TurboChargeUiAndroidFast.html Check Mark Murphy's book http://commonsware.com/Android/index.html Read several posts here: http://www.androidguys.com/2008/07/14/fancy-listviews-part-one/ Short answer: ConvertView is a previously returned view. You can reuse it without having to make a view from scratch. So you can avoid costly operations. So you are correct about optimization. See the holder pattern. Thanks for the shout-out! Since those blog posts are as old as the hills (in Android years), I make the chapter in my original book that covers this topic available as a free excerpt: http://commonsware.com/Android/excerpt.pdf For short lists, convertView is not a big deal. For long lists, it's rather important to avoid creating ten tons of (memory) garbage. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 1.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] taking picture / use camera in android sdk 1.6
Hello, i tried an old(er) example / tutorial to capture a picture from the camera. But android.hardware.CameraDevice; cannot be resolved. Has the name changed or have somebody a good tutorial for android 1.6 and the camera?? Thanks, Stefan PS: If I press a button, I want to open the Camera and make a picture. After that i want to save the picture on a sdcard and go back to my activity. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: taking picture / use camera in android sdk 1.6
Stefan wrote: Hello, i tried an old(er) example / tutorial to capture a picture from the camera. But android.hardware.CameraDevice; cannot be resolved. Has the name changed or have somebody a good tutorial for android 1.6 and the camera?? Thanks, Stefan PS: If I press a button, I want to open the Camera and make a picture. After that i want to save the picture on a sdcard and go back to my activity. The camera is now called Camera, if you want to take still pictures. Video recording is handled through MediaRecorder. Here are a couple of sample projects that demonstrate the use of the Camera: http://github.com/commonsguy/cw-advandroid/tree/master/Camera/ There is also this sample activity from the API Demos that accompany the SDK: http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.1 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: ADC2 entries so far...
Entertainment. What's Shakin' http://whatsshakin.codejanitor.us/ What's Shakin' is a percussion instrument that feels sounds like an acoustic shaker (shake your phone!) - so good, you can play to LIVE music or songs on your phone. Settings include: sensitivity, number of beads, visualization, vibration. Latin salsa dance sampler performance mopimp beats hiphop rap sing. By MoPimp. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] DisplayMetrics issue on Android1.6 SDK
I got a issue with DisplayMetrics. DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); Log.d(TEST, dm.widthPixels + x + dm.heightPixels); If I do not specify the uses-sdk android:minSdkVersion=4 / or supports-screens android:anyDensity=true/supports-screens, then the value of dm.widthPixels and heightPixels is wrong on QVGA and WVGA screen. e.g. on QVGA, the return value is 320x427. If this is a bug on Android1.6 SDK? For chinese users, please see http://easyandroid.com/bbs/viewthread.php?tid=19 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] A bug with android 1.5 when deleting a phone using delete()
Test on HTC GPhone, android sdk version is 1.5 Uri uri = Uri.withAppendedPath(Phones.CONTENT_URI, 25); // 25 is known as id of one phone this.getContentResolver().delete(uri, null, null); with exception: 09-19 17:48:35.543: ERROR/JavaBinder(117): *** Uncaught remote exception! (Exceptions are not yet supported across processes.) 09-19 17:48:35.543: ERROR/JavaBinder(117): android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0 09-19 17:48:35.543: ERROR/JavaBinder(117): at android.database.AbstractCursor.checkPosition(AbstractCursor.java:580) 09-19 17:48:35.543: ERROR/JavaBinder(117): at android.database.AbstractWindowedCursor.checkPosition (AbstractWindowedCursor.java:172) 09-19 17:48:35.543: ERROR/JavaBinder(117): at android.database.AbstractWindowedCursor.getLong (AbstractWindowedCursor.java:99) 09-19 17:48:35.543: ERROR/JavaBinder(117): at com.android.providers.contacts.ContactsProvider.fixNumberIndicator (ContactsProvider.java:2718) 09-19 17:48:35.543: ERROR/JavaBinder(117): at com.android.providers.contacts.ContactsProvider.deleteInternal (ContactsProvider.java:3139) 09-19 17:48:35.543: ERROR/JavaBinder(117): at android.content.AbstractSyncableContentProvider.delete (AbstractSyncableContentProvider.java:276) 09-19 17:48:35.543: ERROR/JavaBinder(117): at android.content.ContentProvider$Transport.delete(ContentProvider.java: 150) 09-19 17:48:35.543: ERROR/JavaBinder(117): at android.content.ContentProviderNative.onTransact (ContentProviderNative.java:150) 09-19 17:48:35.543: ERROR/JavaBinder(117): at android.os.Binder.execTransact(Binder.java:287) 09-19 17:48:35.543: ERROR/JavaBinder(117): at dalvik.system.NativeStart.run(Native Method) but this problem never appers in emulator, my emulatro sdk version is 1.5_r3. Does anyone meet this problem and have solution? 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: YouTube in the emulator?
Thanks, your Activity is great and I might just use it (I have to speak with a manager - the reason why I used quotes is because he's actually my brother :P). Still, I think an application would be more 'polished' if it was able to launch the standard YouTube application (I'm all for standardization). In your blog post you mention one of the reasons for using this custom Activity as not losing the user to a foreign Activity. That shouldn't be a problem with Android (as opposed to the iPhone), thanks to the Activity stack (correct me if I'm wrong, I'm still a newbie with Android). I have a proposal for this. If we somehow knew the Intents that the YouTube application puts out (maybe Google should publish them? or if someone has an Android-powered device, maybe he/she can somehow inspect it?), we could make a simple yet incredibly useful application that responds to those same intents, but doesn't actually do anything -- just display something like If I were the YouTube app, I'd play the video with ID asd876gs. I have another question: on an actual device (I don't have one), if you open a YouTube video page in the browser, does the YouTube app automatically launch and play that video? On Sep 19, 4:36 am, dadical keyes...@gmail.com wrote: If you just want to be able to play YouTube videos, you're welcome to use my free Activity that I wrote. Just drop the source in your project and change the package and you should be pretty close to ready to play YouTube videos. It's barebones, but it takes care of all of the hard stuff with respect to YouTube, and you have the source so you can do whatever you want with it. Find it here: http://keyeslabs.com/joomla/index.php/blogs/i-think-im-becoming-an-an... Hope that helps! On Sep 18, 7:39 pm, Felix Oghina felix.ogh...@gmail.com wrote: How can I get the YouTube application in the emulator? I want to create an application that launches YouTube clips and I need to test my Intents. I can't find anything related to this in the docs. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: YouTube in the emulator?
But it's still made by Google, isn't it? So it's standard across all devices? On Sep 19, 2:43 am, Mark Murphy mmur...@commonsware.com wrote: Felix Oghina wrote: How can I get the YouTube application in the emulator? I want to create an application that launches YouTube clips and I need to test my Intents. I can't find anything related to this in the docs. You can't, legally. That application is licensed to handset manufacturers and is not part of the Android open source project. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android App Developer Books:http://commonsware.com/books.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: ADC2 entries so far...
This ADC2 entries list is updated and moved to 'Android Discuss' group at: http://groups.google.com/group/android-discuss/browse_thread/thread/b0111088236fb0a3# --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: taking picture / use camera in android sdk 1.6
thanks a lot, the example work fine!! Greets, Stefan On Sep 19, 11:31 am, Mark Murphy mmur...@commonsware.com wrote: Stefan wrote: Hello, i tried an old(er) example / tutorial to capture a picture from the camera. But android.hardware.CameraDevice; cannot be resolved. Has the name changed or have somebody a good tutorial for android 1.6 and the camera?? Thanks, Stefan PS: If I press a button, I want to open the Camera and make a picture. After that i want to save the picture on a sdcard and go back to my activity. The camera is now called Camera, if you want to take still pictures. Video recording is handled through MediaRecorder. Here are a couple of sample projects that demonstrate the use of the Camera: http://github.com/commonsguy/cw-advandroid/tree/master/Camera/ There is also this sample activity from the API Demos that accompany the SDK: http://developer.android.com/guide/samples/ApiDemos/src/com/example/a... -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.1 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Hero technical question
I would imagine they have to follow the GSM spec for GSM networks.. Fred Grott http://mobilebytes.wordpress.com On Sep 17, 6:43 pm, AndroidKing rbasso...@gmail.com wrote: can you tell me if the MEID which is the device ID on the Hero phone is going to be 15 digits is it hex or decimal??? I am developing Hero applications and this is very important. Is it going to be unique from other IMEA (GSM) phones that have Android??? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: YouTube in the emulator?
Felix Oghina wrote: But it's still made by Google, isn't it? So it's standard across all devices? Only those devices that license it. For example, it is unclear if the Archos 5 Android devices have YouTube. I rather doubt they do, as Al Sutton has indicated they do not have the Android Market, and I think those get licensed together. It is not safe to assume that all Android devices will have all of the commercially-licensed Android bits, like Android Market, YouTube, and Google Maps. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 1.0 In Print! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] store data in registory
Hello, i need to store data securely. So can some one tell me what should be the best way to store it on device. Is there something like registory in android. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Is Zoom in out possible in Gallary View
HI all Is Zoom in out possible in Gallary View to do if yes any body give me some 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] EditText default action
Sorry about the naming of this topic, I couldn't think of something more suited. I have a simple EditText View (single line) and want to perform a certain action when the user presses Enter while it is focused. Also, I would like to make it so that the virtual keyboard says Go instead of Done and performs the same action when that button is clicked. Is there a way to do this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: sending sms
Thanks.. this is really helpful article. can i send a sms from my own application and receive it by the same emulator in its existing messaging application? In that case shall I need to do any kind of settings external to my application? currently my sms sending application sends it fine. But I am not able to trace if it is actually sent. Even if I am using the port no of emulator as sender number, the sms is not received. Please suggest. I have another query. Can I view my posts directly or everytime I have to search with my subject and then have to get my post? On Sep 18, 2:14 am, Yusuf Saib (T-Mobile USA) yusuf.s...@t- Mobile.com wrote: http://www.google.com/search?client=safarirls=enq=android+send+sms;... yields http://mobiforge.com/developing/story/sms-messaging-android Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Sep 16, 9:46 pm, Saikat saikat0...@gmail.com wrote: Please let me know how can I cansendsmsfrom my application. Which api I need to use. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How do I start a new activity inside a tab? TabSpec.setContent(Intent) doesn't appear to work
Hmm this is not working.. Got error, probably problem with tabonchangelistener.. Can you post an example of that? On 18 sep, 22:44, nEx.Software email.nex.softw...@gmail.com wrote: Well, I'm not sure why you would get the TabSpec there, but I personally would replace: return; with something like: invokeOnTabChangeListener(); return; Of course, this is not ideal because it is not a change... You could modify the interface to include an onTabReselected() method to keep the logic separate. On Sep 18, 1:16 pm, Wouter wouterg...@gmail.com wrote: Trying your second option now, but does not work.. if (index == mCurrentTab) { mTabSpecs.get(mCurrentTab); } Not correct right? :s On 18 sep, 22:06, nEx.Software email.nex.softw...@gmail.com wrote: Well, you could put a button in the MovieDetail to go back to Cinema list, or you could modify the setCurrentTab in TabHost to not bail out when clicking the already active tab. See lines 324-326. On Sep 18, 1:01 pm, Wouter wouterg...@gmail.com wrote: Ok this works when i go to other tab and go back to original tab. So if i open MovieDetail in CinemaActivity (cinema tab), cinema got replaces by MovieDetail. if i open Video tab and go back to Cinema, it shows cinemaActivity again, this is good! But when i open MovieDetail in CInemaActivity (cinema tab) and click on cinema tab again, it doesnt change.. It has to load cinemaActivity again.. Code: mTabHost.setOnTabChangedListener(new my.android.widget.TabHost.OnTabChangeListener() { �...@override public void onTabChanged(String arg0) { int selectedTab = mTabHost.getCurrentTab(); System.out.println(TAB: + selectedTab); if (selectedTab == 0) { refreshCinemaTab(); } } }); } public void refreshCinemaTab() { cinema.replaceContent(new android.content.Intent(this, CinemaActivity.class)); } And cinema -- tab 0 How can i do this? On 18 sep, 19:28, nEx.Software email.nex.softw...@gmail.com wrote: Register an OnTabChangeListener in your tab activity and handle it in there. On Sep 18, 10:10 am, Wouter wouterg...@gmail.com wrote: How can i do that? It initates the tabs on create but when happens when i click on tab again.. where do i have to place the replaceContent code? On 18 sep, 19:01, nEx.Software email.nex.softw...@gmail.com wrote: You'll have to replace the content again. :) On Sep 18, 9:58 am, Wouter wouterg...@gmail.com wrote: Nice works great! But when i switch to other tab and go back to cinema tab my MovieDetail is still open and when i click on Cinema in tabs it doest change to my cinema activity.. How can i go back now? On 18 sep, 18:49, nEx.Software email.nex.softw...@gmail.com wrote: Well, you could do it a couple ways... One way, for example: In CinemaActivity: Home parentActivity = ((Home) this.getParent()); parentActivity.cinema.replaceContent(new android.content.Intent(this, MovieDetail.class)) On Sep 18, 9:30 am, Wouter wouterg...@gmail.com wrote: Hey, Thank you! But I have some questions.. I now declarate my tabs in Home.java (my tabs are now at bottom). I have 4 tabs: Cinema, Video,TV and search. These 4 tabs are 4 different activities with lists. When i click on a list item in cinema activity I have to open MovieDetail.java (now it opens in new activity without tabs) and the tabs have to stay at the bottom. But how can i reach my custom tabspec cinema in CInemaActivity so i can do replaceContent -- cinema.replaceContent(new android.content.Intent(this, MovieDetail.class)); Wouter On 18 sep, 17:51, nEx.Software email.nex.softw...@gmail.com wrote: I was planning on writing a full blown tutorial but since I can tell you are anxious to see it... This is a 1.5 compatible version that uses modified versions of the TabActivity, TabHost, and TabWidget (and related resources) from Android 1.6. There are obvious things that could be done better but the idea is there and should at least get you headed in the right direction. http://nexsoftware.net/Android/Tutorials/CustomTabActivity.zip On Sep 18, 6:36 am, Wouter wouterg...@gmail.com wrote: Thank you so much! On Sep 18, 3:03
[android-developers] Re: You must supply a resource ID for a TextView
Do you know a solution? On 18 sep, 19:00, Wouter wouterg...@gmail.com wrote: This is the function: public View getView(int position, View convertView, ViewGroup parent) { int sectionnum = 0; for(Object section : this.sections.keySet()) { Adapter adapter = sections.get(section); int size = adapter.getCount() + 1; // check if position inside this section if(position == 0) return headers.getView(sectionnum, convertView, parent); if(position size) return adapter.getView(position - 1, convertView, parent); // otherwise jump into next section position -= size; sectionnum++; } return null; } 93: -- if(position == 0) return headers.getView(sectionnum, convertView, parent); resource file: ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=horizontal android:layout_width=fill_parent android:layout_height=fill_parent ImageView android:id=@+id/imgCinema android:layout_width=60px android:layout_margin=5px android:src=@drawable/icon android:layout_height=80px /ImageView LinearLayout android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent TextView android:id=@+id/text1 android:layout_width=fill_parent android:layout_height=wrap_content android:textSize=16px android:textStyle=bold android:text=FilmTitle/ LinearLayout android:orientation=horizontal android:layout_width=wrap_content android:layout_height=wrap_content RatingBar android:id=@+id/cinemarating style=?android:attr/ratingBarStyleSmall android:layout_width=wrap_content android:layout_height=wrap_content android:layout_gravity=center_vertical / TextView android:id=@+id/votes android:layout_width=fill_parent android:layout_height=wrap_content android:textSize=12px android:text=votes/ /LinearLayout TextView android:id=@+id/genre android:layout_width=fill_parent android:layout_height=wrap_content android:textSize=12px android:text=genre/ TextView android:id=@+id/regisseur android:layout_width=fill_parent android:layout_height=wrap_content android:textSize=12px android:text=regisseur/ TextView android:id=@+id/acteurs android:layout_width=fill_parent android:layout_height=wrap_content android:textSize=12px android:text=acteurs/ /LinearLayout /LinearLayout But without this seperatedlistadapter it is working (was working before with it too). So don't know what problem is.. hope you can help me! Wouter On 18 sep, 18:41, Yusuf Saib (T-Mobile USA) yusuf.s...@t- Mobile.com wrote: Where in your code is SeparatedListAdapter.java:93? And can you post the resource xml as well? Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Sep 18, 7:16 am, Wouter wouterg...@gmail.com wrote: I removed my seperatedlistadapter and now it worked.. :s But it was working before with my seperatedlistadapter :( On 18 sep, 14:47, Wouter wouterg...@gmail.com wrote: Really dont find what the problem is, the weird is it worked and i havent changed anything :( On 18 sep, 12:02, Wouter wouterg...@gmail.com wrote: Hey, I have a weird problem. For days i have a working list with movie details i get from an xml rpc source. It loads the list very well and I tried it again today and when i scroll down, always at the same list item it gives me this error. I don't know what the problem is. It shows my list items very good and now not anymore. If you want i can give you my source code too! And it worked a few days ago and now suddenty not :( 09-18 11:50:00.940: ERROR/ArrayAdapter(1561): You must supply a resource ID for a TextView 09-18 11:50:00.950: DEBUG/AndroidRuntime(1561): Shutting down VM 09-18 11:50:00.950: WARN/dalvikvm(1561): threadid=3: thread exiting with uncaught exception (group=0x4001aa28) 09-18 11:50:00.950: ERROR/AndroidRuntime(1561): Uncaught handler: thread main exiting due to uncaught exception 09-18 11:50:00.990: ERROR/AndroidRuntime(1561): java.lang.IllegalStateException: ArrayAdapter requires the resource ID to be a TextView 09-18 11:50:00.990:
[android-developers] problem in checkbox....
I am new to Android Development. can u tell anybody. how can i retrieve data from mysql database and display in Checkbox. Thanks in Advance. With regards, Raghav.S --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android 1.6 SDK is here!
Good work.. Its also nice to see my first contributions starting to show up in the SDK versions..:) I look forward to making more contributions.. Fred Grott http://mobilebytes.wordpress.com On Sep 15, 5:22 pm, Xavier Ducrohet x...@android.com wrote: http://android-developers.blogspot.com/2009/09/android-16-sdk-is-here... Enjoy! -- Xavier Ducrohet Android Developer Tools Engineer Google Inc. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android Positions - Northern Virginia
You have been posting this since December.. Soome better details might help get the position filled.. On Sep 18, 10:15 am, J Kral jdk@gmail.com wrote: A startup company with a proven management team in the Northern Virginia area is seeking Java/Android senior and mid-level developers for immediate full time positions. The company is engaged in the development of a unique mobile device for the consumer and professional marketplace. The successful candidate must be able to work in small teams, be self-motivated, and thrive in a fast-paced environment. Reward for success is considerable, both professionally and financially. *Job Description* Responsibilities include the design/development of innovative applications, intelligent network connectivity, database management, inter-task communications, and device management. These individuals will be a part of the entire life-cycle of the product and will work closely with internal (SW/HW development, test, marketing, sales) and external groups (focus groups, customers, partners). *Skills/Experience* · Programming experience 5+ years experience in programming JAVA, J2EE/J2ME, C++ for senior position 2+ years experience in programming JAVA, J2EE/J2ME, C++ for mid-level position · Android experience is a must, Framework experience is a strong desire · Experience/Familiarity with mobile device development, wireless communications is a strong desire · Experience with SQLite is a plus · Experience with XML, SOAP is a plus · Knowledge of development life-cycle management (version control, documentation, test/support) *Education Requirements* · Bachelors of Computer Engineering, Computer Science, Electrical Engineering or equivalent experience *Benefits* · Competitive salary commensurate to experience · Comprehensive benefits (health, dental, life, 401K) · Stock options Email Resumes to: jdk@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: BaseAdapter.getView()’s c onvertView parameter
Thank you Carmen Delessio for replying. This is helpful! On Sat, Sep 19, 2009 at 4:34 AM, Mark Murphy mmur...@commonsware.comwrote: Carmen Delessio wrote: Watch this video: http://code.google.com/events/io/sessions/TurboChargeUiAndroidFast.html Check Mark Murphy's book http://commonsware.com/Android/index.html Read several posts here: http://www.androidguys.com/2008/07/14/fancy-listviews-part-one/ Short answer: ConvertView is a previously returned view. You can reuse it without having to make a view from scratch. So you can avoid costly operations. So you are correct about optimization. See the holder pattern. Thanks for the shout-out! Since those blog posts are as old as the hills (in Android years), I make the chapter in my original book that covers this topic available as a free excerpt: http://commonsware.com/Android/excerpt.pdf For short lists, convertView is not a big deal. For long lists, it's rather important to avoid creating ten tons of (memory) garbage. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 1.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] Emulator dd command
Hi guys I'm working on android emulator, how can i execute dd command? I try with: dd if=/dev/block/mtdblock1 of=/sdcard but i have thìs error: I/O error...why? Thanks, Francesco --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: 1.6 SDK Arrow keys (dpad/trackball) dir not changing with orientation?
Yep, I noticed this too. Very annoying when you're working on an app primarily in landscape mode and using trackball/pad input. On Sep 16, 12:13 pm, Robert Green rbgrn@gmail.com wrote: Oh I'm certainly crazy. :) On Sep 16, 12:07 pm, Mark Murphy mmur...@commonsware.com wrote: Xavier Ducrohet wrote: That's a really stupid bug... *sigh* On the plus side, it means Mr. Green and I aren't crazy. Well, OK, it means Mr. Green isn't crazy, and this incident is insufficient proof that I am crazy. ;-) -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Need Android talent? Ask on HADO!http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and scrolling
Hey, I am working on a new project now and I want to use a method as above. But I hadn't used this anymore, because it doesnt worked for me.. I have this: http://snapplr.com/tp7p So i have different widgets (TextView, ImageView) and this all in a scrollview (because otherwise window doesnt scroll down when text goes under page). And then i have placed my listview in the scrollview? Don't know how else i could do it. My view has to scroll and my listview has to be under my other widgets as you can see on the image.. What is the best way i can do this? My activity is just extending Activity and not ListActivity! Wouter On Aug 13, 5:03 pm, Wouter wouterg...@gmail.com wrote: Ok did a small test and that works. But now the other widgets also have a listselector (background) when going over it. How can i disable that? On 13 aug, 15:19, 王开发 android.fan...@gmail.com wrote: Hi In your ListActivity : View v = LayoutInflater.from(this).inflate(your_layout_xml,..); getListView().addHeaderView(v,); 2009/8/13 Wouter wouterg...@gmail.com How can i use addHeaverView with widgets i have setup in the layout xml file? On 13 aug, 14:48, Wouter wouterg...@gmail.com wrote: Is the use of your MergeAdapter a good idea for me? On 13 aug, 14:30, Mark Murphy mmur...@commonsware.com wrote: Wouter wrote: Now the problem is. I have a scrollview and all the other views and widgets are placed inside of it. One of those other widgets is a ListView. Do not put widgets that do their own scrolling (e.g., ListView) in a ScrollView. How can I fix this? Come up with some other approach to your UI that does not require a ScrollView to wrap the ListView. For example, perhaps you can put them all as rows in the ListView (e.g., addHeaderView()/addFooterView()). -- Mark Murphy (a Commons Guy)http://commonsware.com| http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Trying to get Javascript on Android
Thank you everyone for the helpful information. What I have learned so far: * Android devices are limited in speed and power, so don't expect all the same functionality of a computer.* I understand this concept, and my initial suspicion is that this is not the issue. I have one (1) slider on the page, and nothing else. *setJavaScriptEnabled is relevant to webkit widgets, not web pages* Okay, good to know I can remove that as a potential source of the problem. * http://www.nanaze.com/2009/01/debugging-javascript-on-android.html * Thank you for the link, however, that article went way, way over my head, at commercial airliner altitudes. *If you can run a Google Map API on the phone, you should be able to handle most JavaScript applications.* I tested with the supplied URL, and it works fine on my phone. If this elaborate map thing works on my phone, surely my slider should. *It is a high enough probability that I am in Tokyo that Shawn is willing to make wagers about that fact.* That would be a safe bet. *Testing can be done on the emulator* ... Which is nifty, but setting up the debugger part was, again, way over the head of a web page making guy like me. In the end, thank you all for the information. I've learned a little more. But I don't know if I'm much closer to a solution yet. Maybe if I get this debugger thing worked out... but I'd rather be making web pages. Is there no reference that outlines any special considerations for how JavaScript runs on Android? Is Android *supposed* to run JavaScript like any other JavaScript capable browser? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and scrolling
Wouter wrote: Hey, I am working on a new project now and I want to use a method as above. But I hadn't used this anymore, because it doesnt worked for me.. I have this: http://snapplr.com/tp7p So i have different widgets (TextView, ImageView) and this all in a scrollview (because otherwise window doesnt scroll down when text goes under page). And then i have placed my listview in the scrollview? Don't know how else i could do it. My view has to scroll and my listview has to be under my other widgets as you can see on the image.. What is the best way i can do this? My activity is just extending Activity and not ListActivity! Remember that a ListView does not have to have all of the same sort of row. So, I would put it all in a ListView. For similar sorts of UIs, I created the SackOfViewsAdapter and MergeAdapter: https://www.google.com/accounts/o8/id?id=AItOawnQNC70ZHdz9I0RXR03e97k1RmZBhWBANQ They are open source and are available off of my github page: http://github.com/commonsguy -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Looking for Android opportunities? http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Resuming a Large File Download
I found how to resume the download without reading the previous data using an HTTP Range request. For others that need to do this, the modified code is: URL url = new URL(mInternetUrl); HttpURLConnection connection = (HttpURLConnection)url.openConnection (); if (mLocalFileSize 0) { connection.addRequestProperty(Range, bytes= + mLocalFileSize + -); } connection.connect(); int responseCode = connection.getResponseCode(); switch (responseCode) { case HttpURLConnection.HTTP_OK: mLocalFileSize = 0; mInternetFileSize = connection.getContentLength(); break; case HttpURLConnection.HTTP_PARTIAL: // The server supports resume mInternetFileSize = connection.getContentLength() + mLocalFileSize; break; --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 Programmatically Turn On/Off WIFI?
good point!!! On 9月19日, 上午1时50分, Marco Nelissen marc...@android.com wrote: Sure you can, you just need a phone. On Fri, Sep 18, 2009 at 9:21 PM, !oEL runzhou...@gmail.com wrote: So there is no way I can really test it? On 9月18日, 下午1时07分, Roman ( T-Mobile USA) roman.baumgaert...@t- mobile.com wrote: You don't have Wifi support on the emulator -- Roman Baumgaertner Sr. SW Engineer-OSDC ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Sep 17, 9:48 pm, !oEL runzhou...@gmail.com wrote: Thank you guys. I got rid of the Security Exceptions by adding a couple of permissions, including WAKE_LOCK, which appears to be the exception I got after adding the two WIFI ones. However, now I've managed to actually access the state, but in Emulator it tells me: Failed to load WIFI driver. The same thing happens when I use the built-in power control widget. On Sep 17, 12:48 am, Raphael r...@android.com wrote: On Tue, Sep 15, 2009 at 8:36 PM, !oEL runzhou...@gmail.com wrote: Hi, Second question of the day, how do Iprogrammaticallyturn on/off WIFI? There's an example at line 226 here: http://code.google.com/p/autosettings/source/browse/trunk/AutoSetting... R/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Trying to get Javascript on Android
ebisudave wrote: Is there no reference that outlines any special considerations for how JavaScript runs on Android? Not that I have seen. Is Android *supposed* to run JavaScript like any other JavaScript capable browser? On the whole, yes. Bear in mind that Android uses WebKit, so where you see browser-specific instructions for Javascript libraries, follow those for iPhone, Safari, or perhaps Chrome. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need help for your Android OSS project? http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android Toast Duration
On Thu, Jul 23, 2009 at 6:34 PM, Dianne Hackborn hack...@android.com wrote: It sounds like you are abusing toasts. How about just showing your own dialog that is set up to not get focus or be touchable? You can use this background to make it look like a toast: http://developer.android.com/reference/android/R.drawable.html#toast_frame And this animation style for the same fade effect: http://developer.android.com/reference/android/R.style.html#Animation_Toast I am trying to do this and confused about the syntax for accessing the toast_frame via theme xml. Would appreciate example. Thank You, Jason On Thu, Jul 23, 2009 at 8:17 AM, Mohamed Amir mohamed.a...@gmail.com wrote: Is there a way to make the Toast last for longer time? I have tried this code Toast t = new Toast(this); View v = View.inflate(this, R.toast_layout, null); t.setView(v); t.setDuration(Toast.LENGTH_LONG); t.show(); t.show(); t.show(); By calling show() method more than once, I hoped this would give a similar effect to lasting for longer time with some flickering, but I didn't see any difference. Is there some limit to the number of times that show() method can be called on the same Toast? e.g. just once per toast instance and further calling has no effect? Any ideas to increase that duration? Thank you. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and scrolling
Hey Mark, The Demo from SackOfViewsAdapter looks really nice and i think this is it what i am looking for. But i have a layout xml file where i declarate all the widgets (yes its a lot). Do i have to put this layout file in seperate file (so for all that has to come above the review list) and then do like this: View v = LayoutInflater.from(this).inflate(your_layout_xml,..); and then add this view to the arraylist of views? (like in the SackOfViewsDemo). I also have a custom adapter for my listview (list of rows) Or how can i do this the best and easiest? :) On 19 sep, 17:57, Mark Murphy mmur...@commonsware.com wrote: Wouter wrote: Hey, I am working on a new project now and I want to use a method as above. But I hadn't used this anymore, because it doesnt worked for me.. I have this:http://snapplr.com/tp7p So i have different widgets (TextView, ImageView) and this all in a scrollview (because otherwise window doesnt scroll down when text goes under page). And then i have placed my listview in the scrollview? Don't know how else i could do it. My view has to scroll and my listview has to be under my other widgets as you can see on the image.. What is the best way i can do this? My activity is just extending Activity and not ListActivity! Remember that a ListView does not have to have all of the same sort of row. So, I would put it all in a ListView. For similar sorts of UIs, I created the SackOfViewsAdapter and MergeAdapter: https://www.google.com/accounts/o8/id?id=AItOawnQNC70ZHdz9I0RXR03e97k... They are open source and are available off of my github page: http://github.com/commonsguy -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Looking for Android opportunities?http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] A question about rtsp Streaming
Hi,all. I met a very strange problem.And I can not understand the reason of this happening.Recently I just create an app(that is using mediaplayer ) to play the rtsp Streaming.At the beginning,I use the sim card to connect to the internet.I try to let the app play for many times .But it was only success once.Many times the app could not play and the buffer always shows 0%.While I use the WIFI to connect the internet ,the rtsp could be played,but when I use the another WIFI to connect to the internet,to my surprise it failed.Both the sim card and WIFI ,it all could play the http Streaming.The rtsp Streaming is very strange, I can not understand.I guess there is maybe something wrong with Wireless. Thanks . --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and scrolling
Wouter wrote: But i have a layout xml file where i declarate all the widgets (yes its a lot). Do i have to put this layout file in seperate file (so for all that has to come above the review list) and then do like this: View v = LayoutInflater.from(this).inflate(your_layout_xml,..); and then add this view to the arraylist of views? (like in the SackOfViewsDemo). I also have a custom adapter for my listview (list of rows) Or how can i do this the best and easiest? :) Either: -- Put all of your widgets (outside of the custom adapter) in separate layout files, or -- Construct them in Java rather than use layout XML It's conceivable to add support for loading a single layout file and pouring all the root's children into the list, but I don't have that in there right now. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need help for your Android OSS project? http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and scrolling
Ok thank you i will try putting them in seperate layout files now! Will let you know if this all worked ;) On 19 sep, 18:28, Mark Murphy mmur...@commonsware.com wrote: Wouter wrote: But i have a layout xml file where i declarate all the widgets (yes its a lot). Do i have to put this layout file in seperate file (so for all that has to come above the review list) and then do like this: View v = LayoutInflater.from(this).inflate(your_layout_xml,..); and then add this view to the arraylist of views? (like in the SackOfViewsDemo). I also have a custom adapter for my listview (list of rows) Or how can i do this the best and easiest? :) Either: -- Put all of your widgets (outside of the custom adapter) in separate layout files, or -- Construct them in Java rather than use layout XML It's conceivable to add support for loading a single layout file and pouring all the root's children into the list, but I don't have that in there right now. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Need help for your Android OSS project?http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android Toast Duration
I am close to sorting this out ... I will post my code when I know I got it. There are a few threads on this topic that offer advice where an example would be more useful (IMHO). j On Sat, Sep 19, 2009 at 12:11 PM, Jason Van Anden jason.van.an...@gmail.com wrote: On Thu, Jul 23, 2009 at 6:34 PM, Dianne Hackborn hack...@android.com wrote: It sounds like you are abusing toasts. How about just showing your own dialog that is set up to not get focus or be touchable? You can use this background to make it look like a toast: http://developer.android.com/reference/android/R.drawable.html#toast_frame And this animation style for the same fade effect: http://developer.android.com/reference/android/R.style.html#Animation_Toast I am trying to do this and confused about the syntax for accessing the toast_frame via theme xml. Would appreciate example. Thank You, Jason On Thu, Jul 23, 2009 at 8:17 AM, Mohamed Amir mohamed.a...@gmail.com wrote: Is there a way to make the Toast last for longer time? I have tried this code Toast t = new Toast(this); View v = View.inflate(this, R.toast_layout, null); t.setView(v); t.setDuration(Toast.LENGTH_LONG); t.show(); t.show(); t.show(); By calling show() method more than once, I hoped this would give a similar effect to lasting for longer time with some flickering, but I didn't see any difference. Is there some limit to the number of times that show() method can be called on the same Toast? e.g. just once per toast instance and further calling has no effect? Any ideas to increase that duration? Thank you. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and scrolling
Wouter wrote: Isn't this the right way to inflate? LayoutInflater inflater = (LayoutInflater)this.getSystemService (Context.LAYOUT_INFLATER_SERVICE); View filmLayout = inflater.inflate(R.layout.filmdetail_layout, null); plot = (TextView) filmLayout.findViewById(R.id.plot); filmdetail_layout is my seperate layout file.. I got a nullpointer exception when i try to set text in this view.. Do i have to place this in newView like this? protected View newView(int position, ViewGroup parent) { TextView txt=new TextView(SackOfViewsDemo.this); txt.setText(items[(position-2)/2]); return(txt); } Probably not. I would just use SackOfViewsAdapter directly (do not subclass it), and call add() on it for each inflated view you want in the list. See the onCreate() method in SackOfViewsDemo and how it adds the clock and buttons. In your case, if a layout file defines a single item to go into the list, it would look like: views.add(inflater.inflate(R.layout.filmdetail_layout, null)); -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need help for your Android OSS project? http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and scrolling
Isn't this the right way to inflate? LayoutInflater inflater = (LayoutInflater)this.getSystemService (Context.LAYOUT_INFLATER_SERVICE); View filmLayout = inflater.inflate(R.layout.filmdetail_layout, null); plot = (TextView) filmLayout.findViewById(R.id.plot); filmdetail_layout is my seperate layout file.. I got a nullpointer exception when i try to set text in this view.. Do i have to place this in newView like this? protected View newView(int position, ViewGroup parent) { TextView txt=new TextView(SackOfViewsDemo.this); txt.setText(items[(position-2)/2]); return(txt); } On 19 sep, 18:31, Wouter wouterg...@gmail.com wrote: Ok thank you i will try putting them in seperate layout files now! Will let you know if this all worked ;) On 19 sep, 18:28, Mark Murphy mmur...@commonsware.com wrote: Wouter wrote: But i have a layout xml file where i declarate all the widgets (yes its a lot). Do i have to put this layout file in seperate file (so for all that has to come above the review list) and then do like this: View v = LayoutInflater.from(this).inflate(your_layout_xml,..); and then add this view to the arraylist of views? (like in the SackOfViewsDemo). I also have a custom adapter for my listview (list of rows) Or how can i do this the best and easiest? :) Either: -- Put all of your widgets (outside of the custom adapter) in separate layout files, or -- Construct them in Java rather than use layout XML It's conceivable to add support for loading a single layout file and pouring all the root's children into the list, but I don't have that in there right now. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Need help for your Android OSS project?http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and scrolling
Ok but is the MergeAdapter not better for adding a listadapter to the listview? or how can i do that too with SackOfViewsAdapter? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Debug certificate has expired!
My debug.keystore certificate has expired. Does anyone know how to force Android to regenerate either certificate or the whole directory under C:\Documents and Settings\Admin\Local Settings\Application Data \Android I have tried deleting the file then recompiling and switching SDK's but nothing seems to work! 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] Certificate has expirted
My debug.keystore certificate has expired. Does anyone know how to force Android to regenerate either certificate or the whole directory under C:\Documents and Settings\Admin\Local Settings\Application Data \Android I have tried deleting the file then recompiling and switching SDK's but nothing seem to work! Any idea? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: YouTube in the emulator?
Yes you are correct about the activity stack, with the following caveats. The activity that you call may not be designed perfectly for your use case. For example, YouTube is all about viral promotion of videos, and if you don't want your user wandering off, or perhaps want the activity to return as soon as the video is done playing, well you're out of luck unless the YouTube activity supports those use cases. I like the idea of a generic Intent monitor. Might slap that together. It won't help with figuring undocumented data options though. On Sep 19, 6:28 am, Felix Oghina felix.ogh...@gmail.com wrote: Thanks, your Activity is great and I might just use it (I have to speak with a manager - the reason why I used quotes is because he's actually my brother :P). Still, I think an application would be more 'polished' if it was able to launch the standard YouTube application (I'm all for standardization). In your blog post you mention one of the reasons for using this custom Activity as not losing the user to a foreign Activity. That shouldn't be a problem with Android (as opposed to the iPhone), thanks to the Activity stack (correct me if I'm wrong, I'm still a newbie with Android). I have a proposal for this. If we somehow knew the Intents that the YouTube application puts out (maybe Google should publish them? or if someone has an Android-powered device, maybe he/she can somehow inspect it?), we could make a simple yet incredibly useful application that responds to those same intents, but doesn't actually do anything -- just display something like If I were the YouTube app, I'd play the video with ID asd876gs. I have another question: on an actual device (I don't have one), if you open a YouTube video page in the browser, does the YouTube app automatically launch and play that video? On Sep 19, 4:36 am, dadical keyes...@gmail.com wrote: If you just want to be able to play YouTube videos, you're welcome to use my free Activity that I wrote. Just drop the source in your project and change the package and you should be pretty close to ready to play YouTube videos. It's barebones, but it takes care of all of the hard stuff with respect to YouTube, and you have the source so you can do whatever you want with it. Find it here: http://keyeslabs.com/joomla/index.php/blogs/i-think-im-becoming-an-an... Hope that helps! On Sep 18, 7:39 pm, Felix Oghina felix.ogh...@gmail.com wrote: How can I get the YouTube application in the emulator? I want to create an application that launches YouTube clips and I need to test my Intents. I can't find anything related to this in the docs. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and scrolling
I have this now: private void setupViews() { MergeAdapter adapter=new MergeAdapter(); LayoutInflater inflater = (LayoutInflater)this.getSystemService (Context.LAYOUT_INFLATER_SERVICE); View filmLayout = inflater.inflate(R.layout.filmdetail_layout, null); plot = (TextView) filmLayout.findViewById(R.id.plot); filmTitle = (TextView) filmLayout.findViewById(R.id.txtFilmTitle); filmAverage = (TextView) filmLayout.findViewById(R.id.filmAverage); filmVotes = (TextView) filmLayout.findViewById(R.id.filmVotes); filmRating = (RatingBar) filmLayout.findViewById(R.id.filmRating); filmImg = (ImageView) filmLayout.findViewById(R.id.imgFilmDetail); adapter.addView(filmLayout); //reviews = new ArrayListReview(); //this.reviAdapter = new reviewsAdapter(this, R.layout.review_row, reviews); setListAdapter(adapter); } so i add one view with all the widgets except of my custom list adapter. And then i want to do this filmTitle.setText(detail.getTitle() + ( + detail.getYear() + )); plot.setText(detail.getPlot()); filmAverage.setText(gemiddelde: + detail.getAverage()); filmVotes.setText(detail.getVotes_count() + stemmen); filmRating.setRating(Float.valueOf(detail.getAverage())); and it gives nullpointerexception.. On 19 sep, 19:02, Wouter wouterg...@gmail.com wrote: Ok but is the MergeAdapter not better for adding a listadapter to the listview? or how can i do that too with SackOfViewsAdapter? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and scrolling
Wouter wrote: Ok but is the MergeAdapter not better for adding a listadapter to the listview? or how can i do that too with SackOfViewsAdapter? The MergeAdapter uses the SackOfViewsAdapter. If you wish to use MergeAdapter, feed it the inflated views and your other adapters, as per the demo: MergeAdapter adapter=new MergeAdapter(); adapter.addAdapter(buildFirstList()); adapter.addView(buildButton()); adapter.addAdapter(buildSecondList()); setListAdapter(adapter); In your case, addView() would be passed the results of an inflation. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need help for your Android OSS project? http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and scrolling
Thank you so much for your help! It worked great and fast with MergeAdapter.. Preview: http://snapplr.com/803q Very nice :) On 19 sep, 19:16, Mark Murphy mmur...@commonsware.com wrote: Wouter wrote: Ok but is the MergeAdapter not better for adding a listadapter to the listview? or how can i do that too with SackOfViewsAdapter? The MergeAdapter uses the SackOfViewsAdapter. If you wish to use MergeAdapter, feed it the inflated views and your other adapters, as per the demo: MergeAdapter adapter=new MergeAdapter(); adapter.addAdapter(buildFirstList()); adapter.addView(buildButton()); adapter.addAdapter(buildSecondList()); setListAdapter(adapter); In your case, addView() would be passed the results of an inflation. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Need help for your Android OSS project?http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and scrolling
Hmm it seems that i cannot click on the list items.. how can i enable that? On 19 sep, 19:23, Wouter wouterg...@gmail.com wrote: Thank you so much for your help! It worked great and fast with MergeAdapter.. Preview:http://snapplr.com/803q Very nice :) On 19 sep, 19:16, Mark Murphy mmur...@commonsware.com wrote: Wouter wrote: Ok but is the MergeAdapter not better for adding a listadapter to the listview? or how can i do that too with SackOfViewsAdapter? The MergeAdapter uses the SackOfViewsAdapter. If you wish to use MergeAdapter, feed it the inflated views and your other adapters, as per the demo: MergeAdapter adapter=new MergeAdapter(); adapter.addAdapter(buildFirstList()); adapter.addView(buildButton()); adapter.addAdapter(buildSecondList()); setListAdapter(adapter); In your case, addView() would be passed the results of an inflation. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Need help for your Android OSS project?http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android Toast Duration
On Sat, Sep 19, 2009 at 9:47 AM, Jason Van Anden jason.van.an...@gmail.comwrote: There are a few threads on this topic that offer advice where an example would be more useful (IMHO). I post to this list in my (oh so copious) spare time; I can either post answers that I can do quickly, or just not post at all if it is going to take me time to put together and test an example. Your choice. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: DisplayMetrics issue on Android1.6 SDK
That is intentional. If you haven't said you support other densities than the framework runs you in a compatibility mode to make it look like you are on a medium density device. By saying that you work with SDK 4, you are also implying that you understand how to deal with densities. On Sat, Sep 19, 2009 at 3:00 AM, lianwei lianwei.w...@gmail.com wrote: I got a issue with DisplayMetrics. DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); Log.d(TEST, dm.widthPixels + x + dm.heightPixels); If I do not specify the uses-sdk android:minSdkVersion=4 / or supports-screens android:anyDensity=true/supports-screens, then the value of dm.widthPixels and heightPixels is wrong on QVGA and WVGA screen. e.g. on QVGA, the return value is 320x427. If this is a bug on Android1.6 SDK? For chinese users, please see http://easyandroid.com/bbs/viewthread.php?tid=19 -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: store data in registory
Android doesn't have a registry. Please read the documentation on security: http://developer.android.com/guide/topics/security/security.html http://developer.android.com/guide/topics/security/security.htmlAnd data storage, which operates within the uid constraints: http://developer.android.com/guide/topics/data/data-storage.html There was last just last week or so a discussion on this list about storing files securely. On Sat, Sep 19, 2009 at 3:58 AM, Honest honestsucc...@gmail.com wrote: Hello, i need to store data securely. So can some one tell me what should be the best way to store it on device. Is there something like registory in android. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Get dimension from R.attr in Java code
You are trying to retrieve an attribute identifier as a dimension, which is incompatible. If you want to get the value of an attribute in the theme, you can use the Theme class (though typically you will use declare-styleable to define a set of attributes you are interested in and retrieve them as a batch; there is an example showing this in ApiDemo's custom view). On Sat, Sep 19, 2009 at 12:28 AM, an0 an0...@gmail.com wrote: Resources.getDimensionPixelSize (android.R.attr.listPreferredItemHeight) does not work. So how to? And any other way to specify resolution independent dimension values in Java code? -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Orientation : onStop onDestroy called from BACK key or not ?
Also you can check isFinishing() in onDestroy() to find out of the activity is actually being finished. This is described in the onDestroy() documentation: http://developer.android.com/reference/android/app/Activity.html#onDestroy() http://developer.android.com/reference/android/app/Activity.html#onDestroy()For retaining active state across configuration changes, the ideal way is to onRetainNonConfigurationInstance(): http://developer.android.com/reference/android/app/Activity.html#onRetainNonConfigurationInstance() http://developer.android.com/reference/android/app/Activity.html#onRetainNonConfigurationInstance()Unfortunately I don't know if we have any good examples of using this to model after, but I am working on one that can serve the purpose for the next release. On Fri, Sep 18, 2009 at 11:00 PM, EboMike ebom...@gmail.com wrote: That is a very bad way of doing it. What if the user presses the HOME button? What if the user goes to a different activity using the notification bar? The camera button? What if it's a device that allows switching activities using a custom button? Relying on a button press to detect the lifetime of your application is a major hack and bound to break in many ways. You might want to read the documentation for the Activity class to see how the lifetime of an application works. It goes in detail about what each stage does: onPause wants you to suspend your threads. onDestroy means your app will be gone for good if isFinishing() is set. If you want to handle the specific case of an orientation change, you can respond to onConfigurationChanged(). I would strongly advise against any kind of hacks circumventing those methods. What are you trying to do in your back button code? -Mike On Sep 17, 2:28 pm, Nanard bsegon...@free.fr wrote: I have founded ! Thanks I should not rely on onStop() nor onDestroy() to know when I quit my Activity. The only safe way is : @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { ... do some cleaning here } return super.onKeyDown(keyCode, event); } -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and scrolling
Edit: got it, thankx On 19 sep, 19:25, Wouter wouterg...@gmail.com wrote: Hmm it seems that i cannot click on the list items.. how can i enable that? On 19 sep, 19:23, Wouter wouterg...@gmail.com wrote: Thank you so much for your help! It worked great and fast with MergeAdapter.. Preview:http://snapplr.com/803q Very nice :) On 19 sep, 19:16, Mark Murphy mmur...@commonsware.com wrote: Wouter wrote: Ok but is the MergeAdapter not better for adding a listadapter to the listview? or how can i do that too with SackOfViewsAdapter? The MergeAdapter uses the SackOfViewsAdapter. If you wish to use MergeAdapter, feed it the inflated views and your other adapters, as per the demo: MergeAdapter adapter=new MergeAdapter(); adapter.addAdapter(buildFirstList()); adapter.addView(buildButton()); adapter.addAdapter(buildSecondList()); setListAdapter(adapter); In your case, addView() would be passed the results of an inflation. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Need help for your Android OSS project?http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and scrolling
Wouter wrote: Hmm it seems that i cannot click on the list items.. how can i enable that? To quote from my copious documentation: You are welcome to override other methods as well, since this is just an Adapter. In particular, if all rows are not enabled for selection, you will want to override isEnabled() and return true or false as needed to indicate which rows are selectable and which are not (e.g., header rows). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need help for your Android OSS project? http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android Toast Duration
Dear Dianne et al, My feedback was meant as constructive criticism in general - definitely not as a dis directed at you. I believe that an example is worth a thousand words - it works or it don't. I appreciate the time you spend with the board. I make it a point to star pretty much anything you write here so I can review it later. This particular thread was recalled exactly because of this. Your suggestion of altering the style of a dialog seems perfect for a step by step walk through of an app - which is what I am working on. Clearly we need more generous experts like yourself helping Android along. That being said ... I thought I had figured it out - but I am still stumped. If someone out there could help, it will help save at least one Android developer's weekend ... Here is my code: Within my theme.xml I have: resources style name=ToastyDialog parent=android:Theme item name=android:windowBackground@android:drawable/toast_frame/item item name=android:windowAnimationStyle@android:style/Animation.Toast/item /style resources Within my dialog layout I have: ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=vertical style=@style/ToastyDialog TextView android:id=@+id/TextView01 android:layout_width=wrap_content android:layout_height=wrap_content android:text=@string/hello_world /TextView /LinearLayout NOTE: The Eclipse interface gives you a choice to pick a theme, and my theme does appear. Thing is, it does not write it in the XML. I added the style tag based upon this post: http://brainflush.wordpress.com/2009/03/15/understanding-android-themes-and-styles/ I sincerely hope that I am making a stupid, obvious mistake. Thank You, Jason On Sat, Sep 19, 2009 at 1:25 PM, Dianne Hackborn hack...@android.com wrote: On Sat, Sep 19, 2009 at 9:47 AM, Jason Van Anden jason.van.an...@gmail.com wrote: There are a few threads on this topic that offer advice where an example would be more useful (IMHO). I post to this list in my (oh so copious) spare time; I can either post answers that I can do quickly, or just not post at all if it is going to take me time to put together and test an example. Your choice. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android 1.6 SDK is here!
On Thu, Sep 17, 2009 at 06:35:43AM -0700, QF wrote: Yes, source code is there, but there is not git TAG (something like android-sdk-1.6_r1) in the repo. Is the tree going to be taged soon? The tags are there now. Thanks guys! -- Tom Rini --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Reading if the Notification Bar is open?
Is there a way to recognize that the Notification window is open? My current app plays a ringtone for text messages, but doesn't override their messaging notifications, so the user has to actually make it into the messaging app before the sound stops. I would like it to stop if the user pulls their notification bar down...Any ideas on how I would catch that?(Note: I can't use the built in notification sound tools because I'm not showing a notification at all) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 Toast Duration
You are making a theme, which is a kind of style that applies to an entire context, but just a UI element. You need to use it as the theme for an activity take or the second argument to the Dialog constructor, however you are creating the window. On Sat, Sep 19, 2009 at 11:26 AM, Jason Van Anden jason.van.an...@gmail.com wrote: Dear Dianne et al, My feedback was meant as constructive criticism in general - definitely not as a dis directed at you. I believe that an example is worth a thousand words - it works or it don't. I appreciate the time you spend with the board. I make it a point to star pretty much anything you write here so I can review it later. This particular thread was recalled exactly because of this. Your suggestion of altering the style of a dialog seems perfect for a step by step walk through of an app - which is what I am working on. Clearly we need more generous experts like yourself helping Android along. That being said ... I thought I had figured it out - but I am still stumped. If someone out there could help, it will help save at least one Android developer's weekend ... Here is my code: Within my theme.xml I have: resources style name=ToastyDialog parent=android:Theme item name=android:windowBackground@android:drawable/toast_frame/item item name=android:windowAnimationStyle@android:style/Animation.Toast/item /style resources Within my dialog layout I have: ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=vertical style=@style/ToastyDialog TextView android:id=@+id/TextView01 android:layout_width=wrap_content android:layout_height=wrap_content android:text=@string/hello_world /TextView /LinearLayout NOTE: The Eclipse interface gives you a choice to pick a theme, and my theme does appear. Thing is, it does not write it in the XML. I added the style tag based upon this post: http://brainflush.wordpress.com/2009/03/15/understanding-android-themes-and-styles/ I sincerely hope that I am making a stupid, obvious mistake. Thank You, Jason On Sat, Sep 19, 2009 at 1:25 PM, Dianne Hackborn hack...@android.com wrote: On Sat, Sep 19, 2009 at 9:47 AM, Jason Van Anden jason.van.an...@gmail.com wrote: There are a few threads on this topic that offer advice where an example would be more useful (IMHO). I post to this list in my (oh so copious) spare time; I can either post answers that I can do quickly, or just not post at all if it is going to take me time to put together and test an example. Your choice. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android Toast Duration
(Btw, Api demos has one or two examples of creating custom themed dialogs, I believe in the app section.) On Sat, Sep 19, 2009 at 12:07 PM, Dianne Hackborn hack...@android.comwrote: You are making a theme, which is a kind of style that applies to an entire context, but just a UI element. You need to use it as the theme for an activity take or the second argument to the Dialog constructor, however you are creating the window. On Sat, Sep 19, 2009 at 11:26 AM, Jason Van Anden jason.van.an...@gmail.com wrote: Dear Dianne et al, My feedback was meant as constructive criticism in general - definitely not as a dis directed at you. I believe that an example is worth a thousand words - it works or it don't. I appreciate the time you spend with the board. I make it a point to star pretty much anything you write here so I can review it later. This particular thread was recalled exactly because of this. Your suggestion of altering the style of a dialog seems perfect for a step by step walk through of an app - which is what I am working on. Clearly we need more generous experts like yourself helping Android along. That being said ... I thought I had figured it out - but I am still stumped. If someone out there could help, it will help save at least one Android developer's weekend ... Here is my code: Within my theme.xml I have: resources style name=ToastyDialog parent=android:Theme item name=android:windowBackground@android:drawable/toast_frame/item item name=android:windowAnimationStyle@android:style/Animation.Toast/item /style resources Within my dialog layout I have: ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=vertical style=@style/ToastyDialog TextView android:id=@+id/TextView01 android:layout_width=wrap_content android:layout_height=wrap_content android:text=@string/hello_world /TextView /LinearLayout NOTE: The Eclipse interface gives you a choice to pick a theme, and my theme does appear. Thing is, it does not write it in the XML. I added the style tag based upon this post: http://brainflush.wordpress.com/2009/03/15/understanding-android-themes-and-styles/ I sincerely hope that I am making a stupid, obvious mistake. Thank You, Jason On Sat, Sep 19, 2009 at 1:25 PM, Dianne Hackborn hack...@android.com wrote: On Sat, Sep 19, 2009 at 9:47 AM, Jason Van Anden jason.van.an...@gmail.com wrote: There are a few threads on this topic that offer advice where an example would be more useful (IMHO). I post to this list in my (oh so copious) spare time; I can either post answers that I can do quickly, or just not post at all if it is going to take me time to put together and test an example. Your choice. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Reading if the Notification Bar is open?
I don't believe there is. But I don't really understand the problem -- notification sounds should be short. If you are playing a sound that goes on for a long time, I think that would be the problem. On Sat, Sep 19, 2009 at 11:52 AM, Tydiz tydiz...@gmail.com wrote: Is there a way to recognize that the Notification window is open? My current app plays a ringtone for text messages, but doesn't override their messaging notifications, so the user has to actually make it into the messaging app before the sound stops. I would like it to stop if the user pulls their notification bar down...Any ideas on how I would catch that?(Note: I can't use the built in notification sound tools because I'm not showing a notification at all) -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Trying to get Javascript on Android
Is Android *supposed* to run JavaScript like any other JavaScript capable browser? On the whole, yes. Bear in mind that Android uses WebKit, so where you see browser-specific instructions for Javascript libraries, follow those for iPhone, Safari, or perhaps Chrome. If only Chrome were available on Linux... but that's another issue. Hmm... I looked around on the web, and I don't see any instructions that are different for browsers, at least not for anything I'm doing. Ultimately I'm aspiring to create some JavaScript that is usable on Android, iPhone, and most modern desktop browsers. Does JavaScript have the same cross-browser compatibility issues that CSS does? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Trying to get Javascript on Android
In a word: YES! Implementations of JavaScript vary across all the major platforms, you have to be very careful about testing, test and more testing each time you make a change to any code on a web page. The worst offenders are IE6 and IE7. Safari has plenty of quirks and as the iPhone is a variant of Safari, you'll have to have an actual device (or the emulator at least) to test on as well. The most compliant is FireFox, and the Android browser will work pretty well if it works in FF, however, the events are different. Search for touch events to see how to handle them in regard to mouse events. GWT has solved a lot of these issues but if you want to code in raw JavaScript, then you'll need to be very careful. -John Coryat What Zip Code? Radar Now! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How do I know whether my device is currently charging?
Thanks Mark, that was the hint I needed. What I really wanted to know was whether or not the battery was currently in use, and for anybody else following this thread, here's the method I came up with: /** * Is the battery currently discharging? * * @return True if our battery is discharging. False otherwise. */ private boolean isDischarging() { // Contact the battery manager Intent batteryIntent = registerReceiver(null, new IntentFilter (Intent.ACTION_BATTERY_CHANGED)); if (batteryIntent == null) { Log.w(DrainOMeter.LOGGING_TAG, Failed to talk to the battery manager, assuming we're on battery power); return true; } // Ask about battery charging status int batteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; if (batteryIntent != null) { batteryStatus = batteryIntent.getIntExtra(status, BatteryManager.BATTERY_STATUS_UNKNOWN); } if (batteryStatus == BatteryManager.BATTERY_STATUS_UNKNOWN) { Log.w(DrainOMeter.LOGGING_TAG, Failed to get battery charging status, assuming we're on battery power); return true; } return batteryStatus == BatteryManager.BATTERY_STATUS_DISCHARGING; } Cheers //Johan On 18 Sep, 11:54, Mark Murphy mmur...@commonsware.com wrote: Walles wrote: I want to know if my device is currently charging. How do I find that out? I've been looking a bit at the Intents API, but AFAIU I can just subscribe to events from there, and a subscription is not what I'm after. And even if I *did* want updates, I'd still need to know the initial state. I just want to ask a one-shot are we charging question. How can I do that? Register for the broadcast Intent with a null receiver. If you get a non-null return value, then that return value is an Intent from the last sticky broadcast matching your supplied IntentFilter. I believe the battery updates are such a sticky broadcast. By passing null for the receiver, you do not actually register a receiver and so do not need to unregister anything later. For more instructions on this, look up registerReceiver() in the Context class (which is a base class for Activity, Service, etc.). -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.1 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: YouTube in the emulator?
I see. It seems rather peculiar to me that such a powerful platform with so much accent on freedom and sharing between applications lacks this particular, very useful, feature. dadical, thank you very much for your Activity, I will surely use it as an example for writing my own (I'm new to both Android and Java, so I try to gain experience wherever I can). On Sep 19, 8:10 pm, dadical keyes...@gmail.com wrote: Yes you are correct about the activity stack, with the following caveats. The activity that you call may not be designed perfectly for your use case. For example, YouTube is all about viral promotion of videos, and if you don't want your user wandering off, or perhaps want the activity to return as soon as the video is done playing, well you're out of luck unless the YouTube activity supports those use cases. I like the idea of a generic Intent monitor. Might slap that together. It won't help with figuring undocumented data options though. On Sep 19, 6:28 am, Felix Oghina felix.ogh...@gmail.com wrote: Thanks, your Activity is great and I might just use it (I have to speak with a manager - the reason why I used quotes is because he's actually my brother :P). Still, I think an application would be more 'polished' if it was able to launch the standard YouTube application (I'm all for standardization). In your blog post you mention one of the reasons for using this custom Activity as not losing the user to a foreign Activity. That shouldn't be a problem with Android (as opposed to the iPhone), thanks to the Activity stack (correct me if I'm wrong, I'm still a newbie with Android). I have a proposal for this. If we somehow knew the Intents that the YouTube application puts out (maybe Google should publish them? or if someone has an Android-powered device, maybe he/she can somehow inspect it?), we could make a simple yet incredibly useful application that responds to those same intents, but doesn't actually do anything -- just display something like If I were the YouTube app, I'd play the video with ID asd876gs. I have another question: on an actual device (I don't have one), if you open a YouTube video page in the browser, does the YouTube app automatically launch and play that video? On Sep 19, 4:36 am, dadical keyes...@gmail.com wrote: If you just want to be able to play YouTube videos, you're welcome to use my free Activity that I wrote. Just drop the source in your project and change the package and you should be pretty close to ready to play YouTube videos. It's barebones, but it takes care of all of the hard stuff with respect to YouTube, and you have the source so you can do whatever you want with it. Find it here: http://keyeslabs.com/joomla/index.php/blogs/i-think-im-becoming-an-an... Hope that helps! On Sep 18, 7:39 pm, Felix Oghina felix.ogh...@gmail.com wrote: How can I get the YouTube application in the emulator? I want to create an application that launches YouTube clips and I need to test my Intents. I can't find anything related to this in the docs. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Reading if the Notification Bar is open?
Its set to play however long they want it to(1-60 seconds or however long the ringtone is) or until they read the any of their unread messages. I didn't think there was a way but I thought I would check, in case someone happened to know. Thanks for the quick response :) On Sep 19, 1:09 pm, Dianne Hackborn hack...@android.com wrote: I don't believe there is. But I don't really understand the problem -- notification sounds should be short. If you are playing a sound that goes on for a long time, I think that would be the problem. On Sat, Sep 19, 2009 at 11:52 AM, Tydiz tydiz...@gmail.com wrote: Is there a way to recognize that the Notification window is open? My current app plays a ringtone for text messages, but doesn't override their messaging notifications, so the user has to actually make it into the messaging app before the sound stops. I would like it to stop if the user pulls their notification bar down...Any ideas on how I would catch that?(Note: I can't use the built in notification sound tools because I'm not showing a notification at all) -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How do I know whether my device is currently charging?
What do you mean by in use? You can find out whether you are attached to a power source with the plugged field (0 means not plugged in / on battery, non-zero is the power source), which is generally what things use to determine whether the device is plugged in (so it is okay to do more power drawing operations). On Sat, Sep 19, 2009 at 12:42 PM, Walles johan.wal...@gmail.com wrote: Thanks Mark, that was the hint I needed. What I really wanted to know was whether or not the battery was currently in use, and for anybody else following this thread, here's the method I came up with: /** * Is the battery currently discharging? * * @return True if our battery is discharging. False otherwise. */ private boolean isDischarging() { // Contact the battery manager Intent batteryIntent = registerReceiver(null, new IntentFilter (Intent.ACTION_BATTERY_CHANGED)); if (batteryIntent == null) { Log.w(DrainOMeter.LOGGING_TAG, Failed to talk to the battery manager, assuming we're on battery power); return true; } // Ask about battery charging status int batteryStatus = BatteryManager.BATTERY_STATUS_UNKNOWN; if (batteryIntent != null) { batteryStatus = batteryIntent.getIntExtra(status, BatteryManager.BATTERY_STATUS_UNKNOWN); } if (batteryStatus == BatteryManager.BATTERY_STATUS_UNKNOWN) { Log.w(DrainOMeter.LOGGING_TAG, Failed to get battery charging status, assuming we're on battery power); return true; } return batteryStatus == BatteryManager.BATTERY_STATUS_DISCHARGING; } Cheers //Johan On 18 Sep, 11:54, Mark Murphy mmur...@commonsware.com wrote: Walles wrote: I want to know if my device is currently charging. How do I find that out? I've been looking a bit at the Intents API, but AFAIU I can just subscribe to events from there, and a subscription is not what I'm after. And even if I *did* want updates, I'd still need to know the initial state. I just want to ask a one-shot are we charging question. How can I do that? Register for the broadcast Intent with a null receiver. If you get a non-null return value, then that return value is an Intent from the last sticky broadcast matching your supplied IntentFilter. I believe the battery updates are such a sticky broadcast. By passing null for the receiver, you do not actually register a receiver and so do not need to unregister anything later. For more instructions on this, look up registerReceiver() in the Context class (which is a base class for Activity, Service, etc.). -- Mark Murphy (a Commons Guy)http://commonsware.com| http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.1 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, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to open a dialog immediately after onResume? Is it even possible?
what code do you have in onResume() ? On Sep 18, 6:40 pm, Agus agus.sant...@gmail.com wrote: Hi all, I need to open a progress dialog on the onResume() method. But no dialog is opened. Any solutions for this? Agus. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Is the limit of memory heap only 6M?
On Sep 18, 5:49 pm, fadden fad...@android.com wrote: I don't know anything about how Maps works, so I can't offer any specific advice there. Something is using lots of memory, and until it stops, this will be a problem. :-( I understand Andy, I was just wondering if you could answer my question above: Short of forcing GCs, which I hate to do for a number of reasons, is there any way we can affect the heap management within our process, specifically to be more aggressive about finalizing objects and freeing their memory? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 Programmatically Turn On/Off WIFI?
Tell the Android team to add Wifi support in the emulator ... -- Roman Baumgaertner Sr. SW Engineer-OSDC ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Sep 18, 9:21 pm, !oEL runzhou...@gmail.com wrote: So there is no way I can really test it? On 9月18日, 下午1时07分, Roman ( T-Mobile USA) roman.baumgaert...@t- mobile.com wrote: You don't have Wifi support on the emulator -- Roman Baumgaertner Sr. SW Engineer-OSDC ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Sep 17, 9:48 pm, !oEL runzhou...@gmail.com wrote: Thank you guys. I got rid of the Security Exceptions by adding a couple of permissions, including WAKE_LOCK, which appears to be the exception I got after adding the two WIFI ones. However, now I've managed to actually access the state, but in Emulator it tells me: Failed to load WIFI driver. The same thing happens when I use the built-in power control widget. On Sep 17, 12:48 am, Raphael r...@android.com wrote: On Tue, Sep 15, 2009 at 8:36 PM, !oEL runzhou...@gmail.com wrote: Hi, Second question of the day, how do Iprogrammaticallyturn on/off WIFI? There's an example at line 226 here: http://code.google.com/p/autosettings/source/browse/trunk/AutoSetting... R/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Tab Formatting
I think I already know the answer to these, but I'm going to ask anway: 1) Is there a straightforward way to set the background color of a tab in its unselected state? 2) Is there a simple way to align the text on a tab? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] [Poll?] Android should provide remote database access for applications...
The idea is to allow developers to access a remote database provided by google. In android the developer will need a special permission to be set at the manifest file. This could allow applications to keep a backup of users application data without having to sign in ever, seamless. Users could than sign-in to their gmail and see a list of applications that are currently storing data on their gmail space... The user could be allowed to wipe the data or even block the application from storing data to it... This idea make the most sense since Android will be a platform were users will be constantly changing android phones as new better ones come out... Well you get the idea... So what you think? GOOGLE you too! :) -Moto! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Default Styles?
Where can I find default styles for my widgets? Let me give you an example. In the Contacts application, when adding a new contact, at the very bottom there are two buttons that have a particular background. I have traced that to here: http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=blob;f=res/layout-finger/edit_contact.xml;h=a3a1849e600d22a6736eabcdedb8cc172139b8a1;hb=065dbad4fd142645e54c301ea6e6febdedaf9843 and it would seem that that background is achieved by using style=@android:style/ButtonBar on a LinearLayout. From what I understand, this is a system-wide theme default for button bars. However, what I am searching for is not a ButtonBar, but similar, so I tried searching for this ButtonBar in the documentation, hoping to find other similar styles I could use. I *thought* I would find it in R.style: http://developer.android.com/reference/android/R.style.html , but it seems I have mistaken. It is not there. Can anyone tell me where I can find such styles? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Tab Formatting
With the 1.6 SDK you have full contol of the look of the tab since you can set the tab to be any view you provide. Previous versions of the SDK required considerable work to do the same. On Sep 19, 2:29 pm, polyclefsoftware dja...@gmail.com wrote: I think I already know the answer to these, but I'm going to ask anway: 1) Is there a straightforward way to set the background color of a tab in its unselected state? 2) Is there a simple way to align the text on a tab? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 should provide remote database access for applications...
Naturally, you've got the right idea - and the elements are (almost) in place today. There's probably more legwork needed than a nicely wrapped framework would require, and there's a security concern that you need to cover yourself. What can be done today: - On the server side, you can use AppEngine to build a RESTful web server with a database back end. Authentication through Google Accounts. Bonus for using AppEngine: The user authentication is encrypted (SSL), right out of the box. - The aforementioned user authentication is integrated in the user facing part of the web server that you build. After logging on, it allows the user to check and manage his or her stored data - On the client side, use GET and POST methods to query the server (could be SOAP or something else, of course), based on the protocol that you implement. Most likely candidate is a XML-based protocol, I suppose. Where it's getting shaky as of today: The part where you access the implicit user authentication on the device. This is not covered by the Android SDK, and the solution currently is through a framework JAR that you download independent from the SDK. - At any rate, to comfort both users and dev, you do not gain or need access to user passwords, neither on the client, nor on the server side. - The downside as mentioned above, is the lacking formal integration of user account lookups in the SDK. As an added challenge, the user's gmail ID needs to directly travel along with every GET and POST call from the client side, or initially at least, if the protocol you implement has some form of session management. This is needed in order to allow the selection of the user's data in the backend database. The onus of encrypting the user's identifying information as part of your protocol is on you! JP On Sep 19, 2:48 pm, Moto medicalsou...@gmail.com wrote: The idea is to allow developers to access a remote database provided by google. In android the developer will need a special permission to be set at the manifest file. This could allow applications to keep a backup of users application data without having to sign in ever, seamless. Users could than sign-in to their gmail and see a list of applications that are currently storing data on their gmail space... The user could be allowed to wipe the data or even block the application from storing data to it... This idea make the most sense since Android will be a platform were users will be constantly changing android phones as new better ones come out... Well you get the idea... So what you think? GOOGLE you too! :) -Moto! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Trying to get Javascript on Android
ebisudave wrote: On the whole, yes. Bear in mind that Android uses WebKit, so where you see browser-specific instructions for Javascript libraries, follow those for iPhone, Safari, or perhaps Chrome. If only Chrome were available on Linux... but that's another issue. I'm reading this group using Chromium on Ubuntu Jaunty. Chromium dailies for Ubuntu are available at https://launchpad.net/~chromium-daily/+archive/ppa --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 updating app in android market.
I have an application in the market and I tried to post an update, but it says that The apk must be signed with at least one certificate in common with the previous version. I don't have the previous certificate and I can't simply create a new project since my app is a paid app and I don't want to have users charged again. What can I do? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Find contact with Phone Number
How can I find a contact enrty given a phone number? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 open a dialog immediately after onResume? Is it even possible?
Yeah. It's easy. Override onCreateDialog() - have it create your dialog. Override onResume() - call showDialog(id). It's the same as any creation of a dialog. I like to declare a constant for each dialog id. The ID you pass from showDialog gets passed into onCreateDialog(int id). So just make your first dialog 0, next 1, or whatever you like. On Sep 18, 6:40 pm, Agus agus.sant...@gmail.com wrote: Hi all, I need to open a progress dialog on the onResume() method. But no dialog is opened. Any solutions for this? Agus. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Get dimension from R.attr in Java code
I see, but I am not initializing a custom view. Is there any simple way to retrieve a predefined attribute value as whatever proper type? On Sep 20, 2009, at 1:33 AM, Dianne Hackborn wrote: You are trying to retrieve an attribute identifier as a dimension, which is incompatible. If you want to get the value of an attribute in the theme, you can use the Theme class (though typically you will use declare-styleable to define a set of attributes you are interested in and retrieve them as a batch; there is an example showing this in ApiDemo's custom view). On Sat, Sep 19, 2009 at 12:28 AM, an0 an0...@gmail.com wrote: Resources.getDimensionPixelSize (android.R.attr.listPreferredItemHeight) does not work. So how to? And any other way to specify resolution independent dimension values in Java code? -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e- mails. All such questions should be posted on public forums, where I and others can see and answer them. -- A ghost writing code with soul @ http://wangling.me/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Restore last viewed Activity
I have 3 different Activities that user navigates between in no particular order. My goal it twofold: 1. When user switches to something else when app is resumed I want to start where user left even if app was terminated. Specifically I want to display last viewed activity, not the default one 2. When last activity is resumed I want to restore it to the last viewed state (this one I think I have a pretty good idea on how to achieve) I think the problem is not start/stop - where I pretty much get what I need, but onCreate() if app was terminated. In that case - it picks Activity that I configured in the manifest. I suppose I can put something in onCreate method of that default activity but is there a better way that I'm maybe missing? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 data caching
My problem is that data I'm loading/reloading into WebView takes long time to process since it's full blown HTML + JS + CSS. I noticed that when cached, same code loads way faster. What I'm trying to do is to minimize loading hiccup when user reloads already cached content On Sep 3, 4:42 pm, Jason Proctor jason.android.li...@gmail.com wrote: i'm not sure i follow you. why would webkit cache data loads, when they're coming from local strings anyway? say some more about what you're trying to achieve and maybe i can help out. hth j This really stinks (not caching data loads). Is it possible to code it in? On Sep 2, 4:07 pm, Jason Proctor jason.android.li...@gmail.com wrote: the loadData() methods don't enter anything into the history and rather more awkwardly don't set the current URL. so if you call loadData() and then getUrl() you'll find that they don't match up. it's not really clear what WebKit is supposed to do in these circumstances, but i think as a minimum it might want to insist on a base URL for string loads (like other versions of embedded WebKit do) and then put that URL in the current URL and history. AFAIK the WebKitcacheis persistent across Activity lifecycles. if you find that a page load is taking a long time however you can do what i do and put content: URLs to infrequently changed resources (like external Javascript etc) so they come from the APK instead of across the network. there's some extra hassle associated with content: URLs accessed from WebKit, but eventually it worked for me. search the archives for more stuff. hth J 1. I load HTML data intoWebViewwith loadDataWithBaseURL 2. Do it one more time 3. Execute the following code and instead of going back to the 1st page - whole app exits. What am I doing wrong here? public boolean onKeyDown(final int keyCode, final KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK this.browser.canGoBack ()) { this.browser.goBack(); return true; } return super.onKeyDown(keyCode, event); } Also - is it possible forWebViewcacheto survive Activity#onStop? Basically - if I close app and reopen - I wantWebViewto display last data that was loaded, currently - I'll get a blank screen and then have to reload same data again -- jason.vp.engineering.particle -- jason.vp.engineering.particle --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 data caching
Indra - I would suggest asking separate question. It's hard to answer 2 questions on a single thread however related these may be On Sep 18, 4:10 am, indra indrad...@gmail.com wrote: Hi Guys, I am doing google search and I want to receive the data without loading the webView. Just like a query to google db, but don't know the content uri of the db. I have done a similar thing in google suggestion provider, where content uri is content://com.android.googlesearch.SuggestionProvider I will appreciate your help. Thanks Indra On Sep 4, 4:42 am, Jason Proctor jason.android.li...@gmail.com wrote: i'm not sure i follow you. why would webkit cache data loads, when they're coming from local strings anyway? say some more about what you're trying to achieve and maybe i can help out. hth j This really stinks (not caching data loads). Is it possible to code it in? On Sep 2, 4:07 pm, Jason Proctor jason.android.li...@gmail.com wrote: the loadData() methods don't enter anything into the history and rather more awkwardly don't set the current URL. so if you call loadData() and then getUrl() you'll find that they don't match up. it's not really clear what WebKit is supposed to do in these circumstances, but i think as a minimum it might want to insist on a base URL for string loads (like other versions of embedded WebKit do) and then put that URL in the current URL and history. AFAIK the WebKitcacheis persistent across Activity lifecycles. if you find that a page load is taking a long time however you can do what i do and put content: URLs to infrequently changed resources (like external Javascript etc) so they come from the APK instead of across the network. there's some extra hassle associated with content: URLs accessed from WebKit, but eventually it worked for me. search the archives for more stuff. hth J 1. I load HTML data intoWebViewwith loadDataWithBaseURL 2. Do it one more time 3. Execute the following code and instead of going back to the 1st page - whole app exits. What am I doing wrong here? public boolean onKeyDown(final int keyCode, final KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK this.browser.canGoBack ()) { this.browser.goBack(); return true; } return super.onKeyDown(keyCode, event); } Also - is it possible forWebViewcacheto survive Activity#onStop? Basically - if I close app and reopen - I wantWebViewto display last data that was loaded, currently - I'll get a blank screen and then have to reload same data again -- jason.vp.engineering.particle -- jason.vp.engineering.particle- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Trying to get Javascript on Android
Hi, * http://www.nanaze.com/2009/01/debugging-javascript-on-android.html * Thank you for the link, however, that article went way, way over my head, at commercial airliner altitudes. Maybe not. Just: 1) get the sdk http://developer.android.com/sdk/1.6_r1/index.html 2) set your path http://developer.android.com/sdk/1.6_r1/installing.html 3) hook up your phone via usb -- turn on Settings/Application/developement/USB debugging 4) run (in a shell on your linux box) $adb logcat WebCore:V *:S 5) stick logging in your javascript on your web page console.error('oops damn'); console.info(' I am here'); console.log('3'); console.warn(' eeeh uuum'); This is much easier than the stuff I know you fiddle with in you linux box -- fonts, encodings etc etc. You may want to find a cross browser js solution that is targeted at (among others) Android/iPhone and let me know. Extjs may be one but I am not sure about their mobile support. Shawn --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Get dimension from R.attr in Java code
I'm just saying you need to retrieve it from the theme, and the custom view Api demo is one example I know of doing so. On Sat, Sep 19, 2009 at 6:26 PM, an0...@gmail.com wrote: I see, but I am not initializing a custom view. Is there any simple way to retrieve a predefined attribute value as whatever proper type? On Sep 20, 2009, at 1:33 AM, Dianne Hackborn wrote: You are trying to retrieve an attribute identifier as a dimension, which is incompatible. If you want to get the value of an attribute in the theme, you can use the Theme class (though typically you will use declare-styleable to define a set of attributes you are interested in and retrieve them as a batch; there is an example showing this in ApiDemo's custom view). On Sat, Sep 19, 2009 at 12:28 AM, an0 an0...@gmail.com wrote: Resources.getDimensionPixelSize (android.R.attr.listPreferredItemHeight) does not work. So how to? And any other way to specify resolution independent dimension values in Java code? -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- A ghost writing code with soul @ http://wangling.me/. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Default Styles?
R.style contains all of the public styles. If it isn't in there, it isn't public. On Sat, Sep 19, 2009 at 4:07 PM, Felix Oghina felix.ogh...@gmail.comwrote: Where can I find default styles for my widgets? Let me give you an example. In the Contacts application, when adding a new contact, at the very bottom there are two buttons that have a particular background. I have traced that to here: http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=blob;f=res/layout-finger/edit_contact.xml;h=a3a1849e600d22a6736eabcdedb8cc172139b8a1;hb=065dbad4fd142645e54c301ea6e6febdedaf9843 and it would seem that that background is achieved by using style=@android:style/ButtonBar on a LinearLayout. From what I understand, this is a system-wide theme default for button bars. However, what I am searching for is not a ButtonBar, but similar, so I tried searching for this ButtonBar in the documentation, hoping to find other similar styles I could use. I *thought* I would find it in R.style: http://developer.android.com/reference/android/R.style.html , but it seems I have mistaken. It is not there. Can anyone tell me where I can find such styles? -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Trying to get Javascript on Android
Here's what I have learned so far: The following scripts all behave the same on my Android device: http://developer.yahoo.com/yui/examples/slider/slider-ticks.html http://developer.yahoo.com/yui/examples/slider/slider_dual_thumb_clean.html http://www.extjs.com/deploy/dev/examples/slider/slider.html ... which is that they display okay, but the functionality is only half there. One can click somewhere in the slider area, and the pointer will move to that position. However, one can't grab the pointer and move it directly. On my page, one can't get the pointer to move by either method, indicating I may have lost something when I modified from the original JavaScript. However, since none of the above original examples work perfectly either, it's hard to know what I should be shooting for. So, I think my question has become more basic and general: Has anyone got a JavaScript slider to work on an Android device, ever? Has anyone seen one? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Trying to get Javascript on Android
Shawn, This is much easier than the stuff I know you fiddle with in you linux box No... no it's not. Let's not get into broad statements about what my environment is like or how I handle it. Linux is fine, it's me who has different abilities, so please leave it for me to decide what I can and can't do. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---