[android-developers] Re: generating keypress
You have to use start() to execute instrumentation in its own thread. This new thread will call onStart() where you can call your sendKeyDownUpSync(int) method. If you are using this for testing purposes only, you can create a separate test class that extends ActivityInstrumentationTestCase2YourActivity and implement your testing accordingly. On Apr 27, 4:16 am, Ryan, Nguyen lenguyen0...@gmail.com wrote: I developed an application to generate keypress. I find out that we can use Instrumentation object to generate. However, when I run the following code, I got these errors. 04-27 16:12:16.720: ERROR/AndroidRuntime(4406): Caused by: java.lang.RuntimeException: This method can not be called from the main application thread 04-27 16:12:16.720: ERROR/AndroidRuntime(4406): at android.app.Instrumentation.validateNotAppThread(Instrumentation.java: 1427) 04-27 16:12:16.720: ERROR/AndroidRuntime(4406): at android.app.Instrumentation.sendKeySync(Instrumentation.java:857) 04-27 16:12:16.720: ERROR/AndroidRuntime(4406): at android.app.Instrumentation.sendKeyDownUpSync(Instrumentation.java: 871) Please help. All answers are appreciated. @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.main); } @Override protected void onStart() { // TODO Auto-generated method stub super.onStart(); //press key Instrumentation inst = new Instrumentation(); inst.sendKeyDownUpSync(KeyEvent.KEYCODE_1); } @Override protected void onStop() { // TODO Auto-generated method stub super.onStop(); } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Issue with MediaPLayer
What error do you get? On Apr 26, 7:26 pm, arberb beqi...@gmail.com wrote: This is my script: public class MainActivity extends Activity { @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); this.setContentView(R.layout.main); Button myButton = (Button)this.findViewById(R.id.my_button); myButton.setOnClickListener(new OnClickListener(){ �...@override public void onClick(View arg0) { MediaPlayer mp = MediaPlayer.create(MainActivity.this, R.raw.xd); mp.start(); // i.e. react on the end of the music-file: mp.setOnCompletionListener(new OnCompletionListener(){ // @Override public void onCompletion(MediaPlayer arg0) { // File has ended !!! Wink } }); } }); } } but when I click the button in my app the application crashes. Why does this happen? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Issue with MediaPLayer
It should have worked the way he did it ( http://developer.android.com/guide/topics/media/index.html#playraw). The exception raised should be of more help. On Wed, Apr 28, 2010 at 8:23 AM, AJ ajeet.invinci...@gmail.com wrote: Before starting the media you need to do following things:- FileDescriptor fd = getResources().openRawResourceFd(R.raw.xxx).getFileDescriptor(); mp.setDataSource(fd); mp.setAudioStreamType(AudioManager.STREAM_RING); mp.prepareAsync(); For more info check this http://developer.android.com/guide/topics/media/index.html Hope this helps you. Thanks, AJ On Apr 28, 2:59 pm, Mihai Fonoage fonoag...@gmail.com wrote: What error do you get? On Apr 26, 7:26 pm, arberb beqi...@gmail.com wrote: This is my script: public class MainActivity extends Activity { @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); this.setContentView(R.layout.main); Button myButton = (Button)this.findViewById(R.id.my_button); myButton.setOnClickListener(new OnClickListener(){ @Override public void onClick(View arg0) { MediaPlayer mp = MediaPlayer.create(MainActivity.this, R.raw.xd); mp.start(); // i.e. react on the end of the music-file: mp.setOnCompletionListener(new OnCompletionListener(){ // @Override public void onCompletion(MediaPlayer arg0) { // File has ended !!! Wink } }); } }); } } but when I click the button in my app the application crashes. Why does this happen? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: J2ME converting/translation to Android
Hmm, do you have a link to those tools? On Apr 27, 6:56 am, dillirao malipeddi dillir...@arijasoft.com wrote: motorola is giving tools for free to convert j2me to android... enjoy On Mon, Apr 26, 2010 at 1:25 AM, ricardocunha ricardocu...@gmail.comwrote: Hi, I want to know if exists a converter for a j2me source-code to android. Listen, it´s not a runner, like a midp runner for android, it ´s a converter for a source code. A tool for translate a source code for a new plataform, from j2me to android. Sorry about my English. Thank´s for any help. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Thank you, Dilli Rao. Mwww.arijasoft.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 athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: J2ME converting/translation to Android
There is a tool called J2Android by Myriad which converts MIDlet apps to .dex bytecode files. Search a little on Google about this tool to find more info. On Apr 25, 3:55 pm, ricardocunha ricardocu...@gmail.com wrote: Hi, I want to know if exists a converter for a j2me source-code to android. Listen, it´s not a runner, like a midp runner for android, it ´s a converter for a source code. A tool for translate a source code for a new plataform, from j2me to android. Sorry about my English. Thank´s for any help. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: what's the best 2d engine and what's the tools I need to create a game?
From http://knol.google.com/k/fred-grott/android-resources-for-application/166jfml0mowlh/12#Android_Development_Libraries: Angle, Rokon2D, Cocos2D, AGE, Cloak, JuicyGames On Mar 30, 3:24 am, jProg bk.1...@gmail.com wrote: Hi, I'm a newbie to android and I want to develop my first 2d game..:) I read about engines ..but what do you advice me to go with--for 2d game and what is the best tools I need to create the sprites or characters in addition to the map or the background? Thank you in advance..:) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
[android-developers] Re: what's the best 2d engine and what's the tools I need to create a game?
From http://knol.google.com/k/fred-grott/android-resources-for-application/166jfml0mowlh/12#Android_Development_Libraries Angle, Rokon2D, Cocos2D, AGE, Cloak, JuicyGames On Mar 30, 3:24 am, jProg bk.1...@gmail.com wrote: Hi, I'm a newbie to android and I want to develop my first 2d game..:) I read about engines ..but what do you advice me to go with--for 2d game and what is the best tools I need to create the sprites or characters in addition to the map or the background? Thank you in advance..:) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
[android-developers] Re: help
http://developer.android.com/guide/appendix/faq/commontasks.html#localhostalias On Mar 11, 4:04 am, subrat kumar panda evergreen.sub...@gmail.com wrote: hello all, subrat here.im struggling with android soap which not getting any respone from axis server.currently i want 2 authenticate the username password. im sending my client code. help me, plz. android-client.txt 4KViewDownload -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: When to use TestCase, InstrumentationTestCase or AndroidTestCase
Hi Navin, I have not used AndroidTestCase (though I guess you read the API documentation for the class). Regarding CTS, no I have not, sorry. Mihai On Wed, Mar 3, 2010 at 5:23 AM, navin celebna...@gmail.com wrote: Hi Mihai, Thanks for the post, it did helped. And also your post on the unit and functional testing..that was very helpful. In any chance have you developed any test case and included in CTS?? also if you can explain something about AndroidTestCase class and why specifically use it when we have the InstrumentationTestCase and ActivityInstrumentationTestCase2...i want to include my test case in CTS package and then compile the whole package..if you have any idea regarding the same..please do reply. Thanks. Navin. On Mar 2, 11:39 pm, Mihai Fonoage fonoag...@gmail.com wrote: Hi navin, From what I know, for functional testing your entire activity, one woulduseActivityInstrumentationTestCase2; for testing some part of your activity in isolation you woulduseanInstrumentationTestCase; for unit testing, if youuseJUnit 4.x version, you just need to annotate your class methods appropriately (don't need to extend/ implement anything). I have some examples (and some additional details) of all this if it helps: http://dtmilano.blogspot.com/2009/07/android-testing-on-android-platf...http://mihaifonoage.blogspot.com/2010/01/unit-and-functional-testing-. .. Mihai Fonoage On Mar 2, 7:44 am, navin celebna...@gmail.com wrote: hi, I am trying to figure out while writing a test case for android most of the classes extend either of these.. 1. AndroidTestCase 2.InstrumentationTestCase 3. ActivityInstrumementationTestCase2 4. TestCase My doubt is which one we have tousewhile writing a new test ?? i mean on what criteria we have to write the test case for either of the above base classes?? Navin. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: When to use TestCase, InstrumentationTestCase or AndroidTestCase
Hi navin, From what I know, for functional testing your entire activity, one would use ActivityInstrumentationTestCase2; for testing some part of your activity in isolation you would use an InstrumentationTestCase; for unit testing, if you use JUnit 4.x version, you just need to annotate your class methods appropriately (don't need to extend/ implement anything). I have some examples (and some additional details) of all this if it helps: http://dtmilano.blogspot.com/2009/07/android-testing-on-android-platform_7528.html http://mihaifonoage.blogspot.com/2010/01/unit-and-functional-testing-in-android.html Mihai Fonoage On Mar 2, 7:44 am, navin celebna...@gmail.com wrote: hi, I am trying to figure out while writing a test case for android most of the classes extend either of these.. 1. AndroidTestCase 2. InstrumentationTestCase 3. ActivityInstrumementationTestCase2 4. TestCase My doubt is which one we have to use while writing a new test ?? i mean on what criteria we have to write the test case for either of the above base classes?? Navin. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Testing problem with ActivityInstrumentationTestCase2T -- Error when trying to access Activity under testing
Hi Vladimir, Maybe this example will help: http://mihaifonoage.blogspot.com/2010/01/unit-and-functional-testing-in-android.html On Feb 24, 10:00 am, vladimir kroz vladimir.k...@gmail.com wrote: I wrote a simplest test based on android.test.ActivityInstrumentationTestCase2. [sourcecode language=java] package andtest.threads.asynctask; import java.util.concurrent.ExecutionException; import andtest.R; import andtest.threads.asynctask.AsyncTaskDemo; import andtest.threads.asynctask.AsyncTaskDemoActivity; import android.test.ActivityInstrumentationTestCase2; import android.test.UiThreadTest; import android.widget.Button; public class AsyncTaskDemoTest3 extends ActivityInstrumentationTestCase2AsyncTaskDemoActivity { public AsyncTaskDemoTest3() { super(andtest.threads.asynctask, AsyncTaskDemoActivity.class); } protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } @UiThreadTest public final void testExecute() { Button btnStart = (Button) getActivity().findViewById(R.id.Button01); assertNotNull(btnStart); btnStart.performClick(); } } [/sourcecode] Whenever I try to run it I got: - java.lang.RuntimeException: This method can not be called from the main application thread at android.app.Instrumentation.validateNotAppThread(Instrumentation.java: 1500) at android.app.Instrumentation.startActivitySync(Instrumentation.java: 439) at android.test.InstrumentationTestCase.launchActivityWithIntent(Instrumentati onTestCase.java: 106) at android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase .java: 84) at android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumen tationTestCase2.java: 87) at andtest.threads.asynctask.AsyncTaskDemoTest3.testExecute(AsyncTaskDemoTest3 .java: 36) . . . Based on error message I thought that possible a problem in calling 'getActivity()' from main UI thread (ridiculous), so I removed annotation line @UiThreadTest Now I got the error: java.lang.RuntimeException: Unable to resolve activity for: Intent { action=android.intent.action.MAIN flags=0x1000 comp={andtest.threads.asynctask/ andtest.threads.asynctask.AsyncTaskDemoActivity} } at android.app.Instrumentation.startActivitySync(Instrumentation.java: 447) at android.test.InstrumentationTestCase.launchActivityWithIntent(Instrumentati onTestCase.java: 106) at android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase .java: 84) at android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumen tationTestCase2.java: 87) at andtest.threads.asynctask.AsyncTaskDemoTest3.testExecute(AsyncTaskDemoTest3 .java: 36) . . . 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] Re: Android 2.0 battery level
Take a look at http://developer.android.com/reference/android/os/BatteryManager.html#EXTRA_VOLTAGE. Mihai Fonoage On Feb 15, 7:49 am, Maxood maqs...@salsoft.net wrote: Hi Mark! I want to display Batter level stats in my app as shown in the following link: http://itunes.apple.com/us/app/app-genie/id352781306?mt=8 Wonder how can i access batter voltage/power information at runtime? On Dec 23 2009, 5:50 pm, Mark Murphy mmur...@commonsware.com wrote: Motalen wrote: Is this to say that the Droid has the capability to report higher precision values given the nature of the hardware BUT there is no way to access it? Here is my interpretation: -- Precision refers to the fineness of detail. Many Android devices report at 1% precision, but the DROID reports at 10% precision. -- Accuracy refers to how well the reported values reflect reality. If I am mistaken, which I hope I am, how would we go about accessing the finer granularity that is needed when developing batteryapplications on the Droid? As far as I know, you can't. As Ms. Hackborn said, [10%] is just the precision the Droidbatteryreports. I have no problem getting single digit precision with other handsets only the Droid produces the strange '10's increments' only. That's the way Motorola elected to implement thebatterylevel information. The SDK does not mandate a minimum level of precision, so device manufacturers can report 1%, 10%, 3.14%, or whatever floats their boats. Applications (particularly paid ones) should not be relying upon some minimum level of precision, just as they should not be relying on certain LED colors or the availability of a physical CAMERA button. If you have more detailed questions on Motorola devices, I recommend asking Motorola the questions, since they have developer support boards: http://developer.motorola.com -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Development Wiki:http://wiki.andmob.org -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: UI Testing
Hi Andrew, Maybe you'll find this helpful as well: http://mihaifonoage.blogspot.com/2010/01/unit-and-functional-testing-in-android.html. Mihai Fonoage On Feb 8, 12:42 am, andrew_prunicki andrew.pruni...@gmail.com wrote: Of course right after I wrote this, I noticed the classes in android.test, including TouchUtils, which seems to have numerous methods for UI interaction. On Feb 7, 11:10 pm, andrew_prunicki andrew.pruni...@gmail.com wrote: Is there anything to test the UI of an Android app like Jemmy for Swing? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Bug? Invalidate causing unnecessary redraws.
This is similar to the issue I had a while back: http://groups.google.com/group/android-developers/browse_thread/thread/efcd7416c2cbd78/8848e1d87cdec74a Mihai Fonoage On Feb 2, 3:47 pm, Keean Schupke keean.schu...@googlemail.com wrote: When I have two views directly next to each other in a layout, invalidating one causes _both_ to redraw. If I separate them with a one pixel margin (or a View used as a one pixel separator) invalidating one no longer causes the other to also be invalidated. This looks like an off-by-one bug in the core android View hierarchy. Can anyone comment on whether this is deliberate or whether it is a bug? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to 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 Programming Class
Hi Josh, We are teaching undergrad and grad students Android at FAU. Our end goal is to get high school students interested in Android. I salute your efforts and I donated for these efforts! Mihai Fonoage On Jan 30, 6:20 pm, joshbeck josh.beck2...@gmail.com wrote: Hello everyone: I teach an 8th grade programming class in San Antonio Texas. We're learning Android and I convinced the school to buy us 3 dev phones for the kids. Here's an article about what we're doing: http://www.neisd.net/ComRel/News/Krueger_Smartphone_10.htm I'd like to purchase a netbook to supplement the phones so that when the students check them out, they have an out-of-the-box programming environment within which the phones work. I've put together a donation page. My goal is to raise $350 dollars for a netbook to go along with these devices. If you can donate $1, $5, or $10 to help my class out, it would be greatly appreciated. http://www.linuxclassroom.com/donation/donate.html Thanks so much for considering it! Josh Beck -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: UI Design Book
Thanks Sam for the useful info! Mihai Fonoage On Fri, Jan 15, 2010 at 7:13 AM, Sam Dutton sam.dut...@gmail.com wrote: Not sure what your background is, and neither of these is oriented specifically to mobile UI design, but both are good (I think the first is by far the most useful usability/UI book): Don't Make Me Think! http://www.amazon.com/Dont-Make-Me-Think-Usability/dp/0321344758/ref=sr_1_1?ie=UTF8s=booksqid=1263556986sr=1-1 Non-Designer's Design Book http://www.amazon.com/Non-Designers-Design-Book-Robin-Williams/dp/0321534042/ref=sr_1_1?ie=UTF8s=booksqid=1263556907sr=8-1 Also: iPhone interface guidelines http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/MobileHIG/Introduction/Introduction.html ...and this seems to be coming along nicely: Android Human Interface Guidelines www.binarysheep.com/AndroidCode/AndroidHIG.pdf and Jakob Nielsen has his detractors, but this is sensible: http://www.useit.com/alertbox/mobile-usability.html Sam Dutton On Jan 15, 1:39 am, Mihai Fonoage fonoag...@gmail.com wrote: Hi, I have asked this question on android-developers, but I had no replies. Maybe I'll get lucky on this forum: Anybody know a good book on UI Design that is particularly geared towards mobile phones, or that is general enough that the principles described can be applied also to mobile phones? Thank you! Mihai Fonoage -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] UI Design Book
Hi, I have asked this question on android-developers, but I had no replies. Maybe I'll get lucky on this forum: Anybody know a good book on UI Design that is particularly geared towards mobile phones, or that is general enough that the principles described can be applied also to mobile phones? Thank you! Mihai Fonoage -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] UI Design Book
Thanks Romain, great resources! I also found The Visual Display of Quantitative Information by Edward Tufte. Mihai Fonoage On Thu, Jan 14, 2010 at 8:42 PM, Romain Guy romain...@android.com wrote: Here are a few very good reads: GUI Bloopers by Jeff Johnson About Face 3.0 by Alan Cooper Designing Interfaces by Jennifer Tidwell Desining Visual Interfaces by Kevin Mullet and Darrell Sano (EXCELLENT book, hard to find) On Thu, Jan 14, 2010 at 5:39 PM, Mihai Fonoage fonoag...@gmail.com wrote: Hi, I have asked this question on android-developers, but I had no replies. Maybe I'll get lucky on this forum: Anybody know a good book on UI Design that is particularly geared towards mobile phones, or that is general enough that the principles described can be applied also to mobile phones? Thank you! Mihai Fonoage -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: MediaStore returning loop of images and not entire directory
Hi Jason, Have you tried the updated version of my code (http:// mihaifonoage.blogspot.com/2009/11/displaying-images-from-sd-card- in.html) ? I am curious if you'll encounter the same problem with it. I am still using MediaStore, so you might. It would also be interesting to know what is wrong with the above code. I remember getting the same behavior on the emulator once, but I deleted the AVD, created a new one, and could not reproduce it afterwards. By the way, what phone are you using, and what version of the SDK do you have on it? Mihai Fonoage On Nov 22, 1:38 pm, JasonMP hyperje...@gmail.com wrote: Hello, I'm testing some code from a demo found in a forum and I'm getting some strange results. My goal is to be able to allow users to access the pictures on their device to choose an avatar/logo. This code run flawlessly except that I only get a handful of images on the phone. And its not even always the same images. Whats more is that it loads those images into a gridview and repeats them for what looks like a number of times equal to the actual number of images that are on the device. And on top of that if I scroll down the through the pictures, and scroll back up, it reorders the pictures from what they were previously. Each time I load the app the pictures seem to be different as well. I have around 400 pictures stored on my phone, and thats what I'm using to test. If someone could shed some light on this for me that would be great. This is my first time using a URI to access content to I'm not sure where to start troubleshooting this one. public class gallery extends Activity { /** * Cursor used to access the results from querying for images on the SD card. */ private Cursor cursor; /* * Column index for the Thumbnails Image IDs. */ private int columnIndex; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.gallery); // Set up an array of the Thumbnail Image ID column we want String[] projection = {MediaStore.Images.Thumbnails._ID}; // Create the cursor pointing to the SDCard cursor = managedQuery ( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, projection, // Which columns to return null, // Return all rows null, MediaStore.Images.Thumbnails.IMAGE_ID); // Get the column index of the Thumbnails Image ID columnIndex = cursor.getColumnIndexOrThrow (MediaStore.Images.Thumbnails._ID); GridView sdcardImages = (GridView) findViewById(R.id.sdcard); sdcardImages.setAdapter(new ImageAdapter(this)); // Set up a click listener sdcardImages.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View v, int position, long id) { // Get the data location of the image String[] projection = {MediaStore.Images.Media.DATA}; cursor = managedQuery ( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, // Which columns to return null, // Return all rows null, null); columnIndex = cursor.getColumnIndexOrThrow (MediaStore.Images.Media.DATA); cursor.moveToPosition(position); // Get image filename String imagePath = cursor.getString(columnIndex); // Use this path to do further processing, i.e. full screen display } }); } /** * Adapter for our image files. */ private class ImageAdapter extends BaseAdapter { private Context context; public ImageAdapter(Context localContext) { context = localContext; } public int getCount() { return cursor.getCount(); } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent) { ImageView picturesView; if (convertView == null) { picturesView = new ImageView(context); // Move cursor to current position cursor.moveToPosition(position); // Get the current value for the requested column int imageID = cursor.getInt(columnIndex); // Set the content of the image based on the provided URI picturesView.setImageURI(Uri.withAppendedPath( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, + imageID)); picturesView.setScaleType (ImageView.ScaleType.FIT_CENTER
[android-developers] Re: MediaStore returning loop of images and not entire directory
No, you can take that line out (I updated the code with this change). Thanks for noticing that. Mihai Fonoage On Nov 23, 10:04 am, Jason Mallet-Prevost hyperje...@gmail.com wrote: Do I need to be including any other classes for this to run? What is a PuzzleView? Is that something in Android 2.0? On Mon, Nov 23, 2009 at 9:59 AM, Jason Mallet-Prevost hyperje...@gmail.comwrote: Hi Mihai, I have an HTC G1 running Android 1.6. I'm working on getting your new code implemented this morning. I'll let you know how it goes. And thank you. On Mon, Nov 23, 2009 at 7:56 AM, Mihai Fonoage fonoag...@gmail.comwrote: Hi Jason, Have you tried the updated version of my code (http:// mihaifonoage.blogspot.com/2009/11/displaying-images-from-sd-card- in.htmlhttp://mihaifonoage.blogspot.com/2009/11/displaying-images-from-sd-ca...) ? I am curious if you'll encounter the same problem with it. I am still using MediaStore, so you might. It would also be interesting to know what is wrong with the above code. I remember getting the same behavior on the emulator once, but I deleted the AVD, created a new one, and could not reproduce it afterwards. By the way, what phone are you using, and what version of the SDK do you have on it? Mihai Fonoage On Nov 22, 1:38 pm, JasonMP hyperje...@gmail.com wrote: Hello, I'm testing some code from a demo found in a forum and I'm getting some strange results. My goal is to be able to allow users to access the pictures on their device to choose an avatar/logo. This code run flawlessly except that I only get a handful of images on the phone. And its not even always the same images. Whats more is that it loads those images into a gridview and repeats them for what looks like a number of times equal to the actual number of images that are on the device. And on top of that if I scroll down the through the pictures, and scroll back up, it reorders the pictures from what they were previously. Each time I load the app the pictures seem to be different as well. I have around 400 pictures stored on my phone, and thats what I'm using to test. If someone could shed some light on this for me that would be great. This is my first time using a URI to access content to I'm not sure where to start troubleshooting this one. public class gallery extends Activity { /** * Cursor used to access the results from querying for images on the SD card. */ private Cursor cursor; /* * Column index for the Thumbnails Image IDs. */ private int columnIndex; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.gallery); // Set up an array of the Thumbnail Image ID column we want String[] projection = {MediaStore.Images.Thumbnails._ID}; // Create the cursor pointing to the SDCard cursor = managedQuery ( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, projection, // Which columns to return null, // Return all rows null, MediaStore.Images.Thumbnails.IMAGE_ID); // Get the column index of the Thumbnails Image ID columnIndex = cursor.getColumnIndexOrThrow (MediaStore.Images.Thumbnails._ID); GridView sdcardImages = (GridView) findViewById(R.id.sdcard); sdcardImages.setAdapter(new ImageAdapter(this)); // Set up a click listener sdcardImages.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View v, int position, long id) { // Get the data location of the image String[] projection = {MediaStore.Images.Media.DATA}; cursor = managedQuery ( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, // Which columns to return null, // Return all rows null, null); columnIndex = cursor.getColumnIndexOrThrow (MediaStore.Images.Media.DATA); cursor.moveToPosition(position); // Get image filename String imagePath = cursor.getString(columnIndex); // Use this path to do further processing, i.e. full screen display } }); } /** * Adapter for our image files. */ private class ImageAdapter extends BaseAdapter { private Context context; public ImageAdapter(Context localContext) { context = localContext; } public int getCount() { return cursor.getCount(); } public Object getItem(int position
[android-developers] Re: MediaStore returning loop of images and not entire directory
Happy it does. I posted a very brief description of the code at the beginning of the blog; that, together with code comments should help a bit. Let me know if you have any questions. Mihai Fonoage On Nov 23, 10:52 am, Jason Mallet-Prevost hyperje...@gmail.com wrote: Mihai, It works! Like a charm too. Thanks for your help on this. I'll have to tinker around with it and see how it works exactly. On Mon, Nov 23, 2009 at 10:27 AM, Mihai Fonoage fonoag...@gmail.com wrote: No, you can take that line out (I updated the code with this change). Thanks for noticing that. Mihai Fonoage On Nov 23, 10:04 am, Jason Mallet-Prevost hyperje...@gmail.com wrote: Do I need to be including any other classes for this to run? What is a PuzzleView? Is that something in Android 2.0? On Mon, Nov 23, 2009 at 9:59 AM, Jason Mallet-Prevost hyperje...@gmail.comwrote: Hi Mihai, I have an HTC G1 running Android 1.6. I'm working on getting your new code implemented this morning. I'll let you know how it goes. And thank you. On Mon, Nov 23, 2009 at 7:56 AM, Mihai Fonoage fonoag...@gmail.com wrote: Hi Jason, Have you tried the updated version of my code (http:// mihaifonoage.blogspot.com/2009/11/displaying-images-from-sd-card- in.html http://mihaifonoage.blogspot.com/2009/11/displaying-images-from-sd-ca...) ? I am curious if you'll encounter the same problem with it. I am still using MediaStore, so you might. It would also be interesting to know what is wrong with the above code. I remember getting the same behavior on the emulator once, but I deleted the AVD, created a new one, and could not reproduce it afterwards. By the way, what phone are you using, and what version of the SDK do you have on it? Mihai Fonoage On Nov 22, 1:38 pm, JasonMP hyperje...@gmail.com wrote: Hello, I'm testing some code from a demo found in a forum and I'm getting some strange results. My goal is to be able to allow users to access the pictures on their device to choose an avatar/logo. This code run flawlessly except that I only get a handful of images on the phone. And its not even always the same images. Whats more is that it loads those images into a gridview and repeats them for what looks like a number of times equal to the actual number of images that are on the device. And on top of that if I scroll down the through the pictures, and scroll back up, it reorders the pictures from what they were previously. Each time I load the app the pictures seem to be different as well. I have around 400 pictures stored on my phone, and thats what I'm using to test. If someone could shed some light on this for me that would be great. This is my first time using a URI to access content to I'm not sure where to start troubleshooting this one. public class gallery extends Activity { /** * Cursor used to access the results from querying for images on the SD card. */ private Cursor cursor; /* * Column index for the Thumbnails Image IDs. */ private int columnIndex; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.gallery); // Set up an array of the Thumbnail Image ID column we want String[] projection = {MediaStore.Images.Thumbnails._ID}; // Create the cursor pointing to the SDCard cursor = managedQuery ( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, projection, // Which columns to return null, // Return all rows null, MediaStore.Images.Thumbnails.IMAGE_ID); // Get the column index of the Thumbnails Image ID columnIndex = cursor.getColumnIndexOrThrow (MediaStore.Images.Thumbnails._ID); GridView sdcardImages = (GridView) findViewById(R.id.sdcard); sdcardImages.setAdapter(new ImageAdapter(this)); // Set up a click listener sdcardImages.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View v, int position, long id) { // Get the data location of the image String[] projection = {MediaStore.Images.Media.DATA}; cursor = managedQuery ( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, // Which columns to return null, // Return all rows null, null); columnIndex = cursor.getColumnIndexOrThrow (MediaStore.Images.Media.DATA
[android-developers] Re: MediaStore returning loop of images and not entire directory
I see that you already received an answer for this in another thread. On Nov 23, 12:39 pm, JasonMP hyperje...@gmail.com wrote: I implemented a bit of code at the end there before you recycle the bitmap to open a fileoutput stream and write the image to the /data/ data/package/file directory and save it there after the scaling. What I need to figure out is how to grab that images URI so that I can bind it to a simpleCursorAdapter. Does the image even have a URI after I place it into the apps file dir? or should I instead of copying it to the file dir just reference the original image on the sdcard? On Nov 23, 11:23 am, Mihai Fonoage fonoag...@gmail.com wrote: Happy it does. I posted a very brief description of the code at the beginning of the blog; that, together with code comments should help a bit. Let me know if you have any questions. Mihai Fonoage On Nov 23, 10:52 am, Jason Mallet-Prevost hyperje...@gmail.com wrote: Mihai, It works! Like a charm too. Thanks for your help on this. I'll have to tinker around with it and see how it works exactly. On Mon, Nov 23, 2009 at 10:27 AM, Mihai Fonoage fonoag...@gmail.com wrote: No, you can take that line out (I updated the code with this change). Thanks for noticing that. Mihai Fonoage On Nov 23, 10:04 am, Jason Mallet-Prevost hyperje...@gmail.com wrote: Do I need to be including any other classes for this to run? What is a PuzzleView? Is that something in Android 2.0? On Mon, Nov 23, 2009 at 9:59 AM, Jason Mallet-Prevost hyperje...@gmail.comwrote: Hi Mihai, I have an HTC G1 running Android 1.6. I'm working on getting your new code implemented this morning. I'll let you know how it goes. And thank you. On Mon, Nov 23, 2009 at 7:56 AM, Mihai Fonoage fonoag...@gmail.com wrote: Hi Jason, Have you tried the updated version of my code (http:// mihaifonoage.blogspot.com/2009/11/displaying-images-from-sd-card- in.html http://mihaifonoage.blogspot.com/2009/11/displaying-images-from-sd-ca...) ? I am curious if you'll encounter the same problem with it. I am still using MediaStore, so you might. It would also be interesting to know what is wrong with the above code. I remember getting the same behavior on the emulator once, but I deleted the AVD, created a new one, and could not reproduce it afterwards. By the way, what phone are you using, and what version of the SDK do you have on it? Mihai Fonoage On Nov 22, 1:38 pm, JasonMP hyperje...@gmail.com wrote: Hello, I'm testing some code from a demo found in a forum and I'm getting some strange results. My goal is to be able to allow users to access the pictures on their device to choose an avatar/logo. This code run flawlessly except that I only get a handful of images on the phone. And its not even always the same images. Whats more is that it loads those images into a gridview and repeats them for what looks like a number of times equal to the actual number of images that are on the device. And on top of that if I scroll down the through the pictures, and scroll back up, it reorders the pictures from what they were previously. Each time I load the app the pictures seem to be different as well. I have around 400 pictures stored on my phone, and thats what I'm using to test. If someone could shed some light on this for me that would be great. This is my first time using a URI to access content to I'm not sure where to start troubleshooting this one. public class gallery extends Activity { /** * Cursor used to access the results from querying for images on the SD card. */ private Cursor cursor; /* * Column index for the Thumbnails Image IDs. */ private int columnIndex; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.gallery); // Set up an array of the Thumbnail Image ID column we want String[] projection = {MediaStore.Images.Thumbnails._ID}; // Create the cursor pointing to the SDCard cursor = managedQuery ( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, projection, // Which columns to return null, // Return all rows null, MediaStore.Images.Thumbnails.IMAGE_ID); // Get the column index of the Thumbnails Image ID columnIndex
[android-developers] Re: schemas.android.com site down?
A similar discussion: http://groups.google.com/group/android-developers/browse_thread/thread/454642e27ef741c4/21aeaf195f2f4b8c Mihai Fonoage On Nov 10, 1:24 pm, Guy Resh guyr...@gmail.com wrote: Am I missing something or didhttp://schemas.android.com/apk/res/android just go away today? (11/10/2009) The hostname doesn't appear to be valid (DNS-wise) and Eclipse is showing that it can't find the DTD while editing XML layouts. -Guy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How can I partecipate to an Android project?
Hi Joey, My advise would be to first start reading about Android. There are several books out there that should aid in this task. After you get comfortable with the language, there will be greater chances for people to reply. Without having some theoretical background, many will not give you a chance. Mihai Fonoage On Nov 7, 2:11 pm, Joey Ramone ivan.laso...@gmail.com wrote: Hi everybody. I'm a student in computer science. I know Java, I don't know Android framework and the design patterns but I wish I learn them. Where can I find an Android project which I might partecipate? I'm sorry for my terrible english. Thank you :D -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: java.lang.OutOfMemoryError after orientation changed
When an orientation occurs, your activity is being destroyed, and a new instance is created. The problem is that some references are still kept in memory. Some useful resources to read: Avoiding memory leaks (http://android- developers.blogspot.com/2009/01/avoiding-memory-leaks.html) and Faster screen orientation change (http://android- developers.blogspot.com/2009/02/faster-screen-orientation- change.html). I had similar issues when loading bitmaps, and screen orientation changes would through an out of memory error almost every time at some point. The above links helped in solving the issue. Mihai Fonoage On Nov 3, 4:45 pm, fadden fad...@android.com wrote: On Oct 30, 12:23 pm, Sekar shake...@yahoo.com wrote: 10-30 14:59:50.841: INFO/dalvikvm-heap(23490): Forcing collection of SoftReferences for 134217760-byte allocation Curiously, 134217760 is 0x0820. Something went wrong in here. The original poster's allocation was 0x0A24, also suspiciously round. Is this easily repeatable? If so, can you file a bug on b.android.com and attach the APK to the bug report? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Question regarding com.google.android.photostream.GridLayout
Hi, I have tried to extend the GridLayout class (http://code.google.com/p/ apps-for-android/source/browse/trunk/Photostream/src/com/google/ android/photostream/GridLayout.java) so as to make it scrollable, but with no success. In this regard, I tried initializing the scrollbars inside the GridLayout constructor but I get an unsupported operation exception saying Can't convert to dimension: type=0x10. In addition, in the xml layout file that uses the GridLayout class, I tried placing the FrameLayout (which has the GridLayout) inside a ScrollView but that causes the GridLayout cannot have UNSPECIFIED dimensions error message to be shown. I initially was using a GridView with an adapter, but I never got it to work 'smoothly'. When I changed the code and tried to use the addView(View view) method, the method is not supported, since it is encouraged the use of an adapter. Has anybody used the GridLayout class successfully with scrolling capabilities, or know how to implement them? Many thanks, Mihai Fonoage -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Updating one view also causes another view to update
Any help on this issue is greatly appreciated. Mihai Fonoage On Oct 29, 3:44 pm, Mihai Fonoage fonoag...@gmail.com wrote: Hello everyone, I have two views, one of which is a Chronometer. Whenever the Chronometer gets updated (every second, automatically, after its start () method has been called), the onDraw method of my second view is called. Any way I can stop this from happening? Thank you! Mihai Fonoage --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Updating one view also causes another view to update
Hi Mark, The stack trace is as follows: W/System.err( 769): java.lang.Throwable: stack dump W/System.err( 769):at java.lang.Thread.dumpStack(Thread.java:610) W/System.err( 769):at package_name.SecondView.onDraw(SecondView .java:381) W/System.err( 769):at android.view.View.draw(View.java:6274) W/System.err( 769):at android.view.ViewGroup.drawChild (ViewGroup.java:1526) W/System.err( 769):at android.view.ViewGroup.dispatchDraw (ViewGroup.java:1256) W/System.err( 769):at android.view.ViewGroup.drawChild (ViewGroup.java:1524) W/System.err( 769):at android.view.ViewGroup.dispatchDraw (ViewGroup.java:1256) W/System.err( 769):at android.view.View.draw(View.java:6277) W/System.err( 769):at android.widget.FrameLayout.draw (FrameLayout.java:352) W/System.err( 769):at android.view.ViewGroup.drawChild (ViewGroup.java:1526) W/System.err( 769):at android.view.ViewGroup.dispatchDraw (ViewGroup.java:1256) W/System.err( 769):at android.view.ViewGroup.drawChild (ViewGroup.java:1524) W/System.err( 769):at android.view.ViewGroup.dispatchDraw (ViewGroup.java:1256) W/System.err( 769):at android.view.View.draw(View.java:6277) W/System.err( 769):at android.widget.FrameLayout.draw (FrameLayout.java:352) W/System.err( 769):at com.android.internal.policy.impl.PhoneWindow $DecorView.draw(Pho neWindow.java:1883) W/System.err( 769):at android.view.ViewRoot.draw(ViewRoot.java: 1332) W/System.err( 769):at android.view.ViewRoot.performTraversals (ViewRoot.java:1097) W/System.err( 769):at android.view.ViewRoot.handleMessage (ViewRoot.java:1613) W/System.err( 769):at android.os.Handler.dispatchMessage (Handler.java:99) W/System.err( 769):at android.os.Looper.loop(Looper.java:123) W/System.err( 769):at android.app.ActivityThread.main (ActivityThread.java:4203) W/System.err( 769):at java.lang.reflect.Method.invokeNative (Native Method) W/System.err( 769):at java.lang.reflect.Method.invoke(Method.java: 521) W/System.err( 769):at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(Zygo teInit.java:791) W/System.err( 769):at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:549) W/System.err( 769):at dalvik.system.NativeStart.main(Native Method) I have a LinearLayout that contains the Chronometer (+ some TextViews all in another LinearLayout), and the SecondView view. I guess the problem is that all child views (Chronometer + SecondView) of the root LinearLayout view are updated in case one of its child views (Chronometer) gets updated (there is no concept of partially updating the screen?). Should it be like this. Since I haven't changed anything in my second view, it should not be re-drawn. The problem is that this is out of my control. There is nothing I can do to stop the second view of being re-drawn. Mihai Fonoage On Oct 30, 8:35 am, Mark Murphy mmur...@commonsware.com wrote: Mihai Fonoage wrote: Any help on this issue is greatly appreciated. Your question cannot be answered in the abstract. You need to find this out for yourself. Put a breakpoint or dump a stack trace in onDraw() of your second view. Figure out from there what is triggering it. If I had to guess, it is being triggered somehow through whatever layout contains both your view and the Chronometer. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Development Wiki:http://wiki.andmob.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Updating one view also causes another view to update
Thanks for the link String! I am trying to figure out what Drawable is shared between the Chronometer and my SecondView (which draws some bitmaps), but I cannot come with anything. Looking at my stack trace, there is nothing there to suggest anything similar. I will look more into that, but my feeling is that it might be another (though similar) problem. Mihai Fonoage On Oct 30, 11:22 am, String sterling.ud...@googlemail.com wrote: On Oct 29, 7:44 pm, Mihai Fonoage fonoag...@gmail.com wrote: I have two views, one of which is a Chronometer. Whenever the Chronometer gets updated (every second, automatically, after its start () method has been called), the onDraw method of my second view is called. Any way I can stop this from happening? Might this be your problem?http://www.curious-creature.org/2009/05/02/drawable-mutations/ 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: Updating one view also causes another view to update
@Mark I care because something needs to be drawn if the onDraw method is being called. If there are no actual changes to the view, then this is a waste of resources (probably unnoticeable) and I need to deal with this case specifically, which complicates my application logic a little (here though it is probably my fault - not a perfect design). @skink You are right, there is an issue with the layout, but while I can get it to work and not have onDraw called every second, the views are not displayed as I want to. I will play around with this layout issue some more and see if I can get a fix. Beside all this, I do find it unnecessary; characters representing numbers from 0 to 9 have the same height, so the layout height (which is set to wrap_content) should not change. Mihai Fonoage On Oct 30, 12:25 pm, skink psk...@gmail.com wrote: On Oct 30, 5:15 pm, skink psk...@gmail.com wrote: On Oct 30, 12:36 pm, Mihai Fonoage fonoag...@gmail.com wrote: Any help on this issue is greatly appreciated. Mihai Fonoage On Oct 29, 3:44 pm, Mihai Fonoage fonoag...@gmail.com wrote: Hello everyone, I have two views, one of which is a Chronometer. Whenever the Chronometer gets updated (every second, automatically, after its start () method has been called), the onDraw method of my second view is called. Any way I can stop this from happening? Thank you! Mihai Fonoage hi, my guess is that Chronometer when updated can change its size causing parent ViewGroup to re-leyout its children and as a consequence to draw all children pskink i checked that Chronometer is a TextView so it could be the case. try for testing purposes set both layout_width/layout_height to 'fill_parent' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Updating one view also causes another view to update
Mark Murphy mmur...@commonsware.com wrote: Mihai Fonoage wrote: and I need to deal with this case specifically, which complicates my application logic a little (here though it is probably my fault - not a perfect design). Your View should not care about how many times it is drawn. Relying on assumed behavior (e.g., onDraw() is only called in certain scenarios) is not safe. Otherwise, your code may break in future Android releases where your assumption is no longer valid. You are certainly welcome to figure out how to avoid onDraw() unnecessarily, but you really need to implement support for onDraw() occurring when you are not necessarily expecting it. That is what I ended up doing. I just found everything to be curious to say the least. Thank you all for the feedback! Mihai Fonoage --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Updating one view also causes another view to update
Hello everyone, I have two views, one of which is a Chronometer. Whenever the Chronometer gets updated (every second, automatically, after its start () method has been called), the onDraw method of my second view is called. Any way I can stop this from happening? Thank you! Mihai Fonoage --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Strange behavior when loading images from SDCard
Hi, I have an activity that loads and displays images from the SDCard. I create a new AVD, specify the desired image of the sd card (which has all my pictures already loaded), specify that AVD for deployment, and start the application. I noticed a strange behavior. At first, the images are not loaded; the getView method is never called, although the constructor of my adapter is called. If I close the application, and open the Gallery app that comes pre-installed, I see that the sd card folder has the correct number of images, and it 'displays' the first four. If I start my application again, those four images are displayed, and only those. If I go back to the Gallery application, open the sd card folder so that it loads all images, and restart my application, all images are successfully displayed. Any reason why this happens? I am using version 1.6, and (part of) my code is below: [code] // Set up an array of the Thumbnail Image ID column we want String[] projection = {MediaStore.Images.Thumbnails._ID}; // Create the cursor pointing to the SDCard cursor = managedQuery ( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, projection, null, null, MediaStore.Images.Thumbnails.IMAGE_ID); // Get the column index of the Thumbnails ID columnIndex = cursor.getColumnIndexOrThrow (MediaStore.Images.Thumbnails._ID); sdcardImages = (GridView) findViewById(R.id.sdcard); //new LoadImagesFromSDCard().execute(); imageAdapter = new ImageAdapter(getApplicationContext()); sdcardImages.setAdapter(imageAdapter); [/code] Thank you, Mihai Fonoage --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Strange behavior when loading images from SDCard
Actually, the behavior is not strange at all; there are no thumbnail images on the sd card. When loading the images for the first time, Android creates thumbnails for those images. Mihai Fonoage On Oct 16, 2:01 pm, Mihai Fonoage fonoag...@gmail.com wrote: Hi, I have an activity that loads and displays images from the SDCard. I create a new AVD, specify the desired image of the sd card (which has all my pictures already loaded), specify that AVD for deployment, and start the application. I noticed a strange behavior. At first, the images are not loaded; the getView method is never called, although the constructor of my adapter is called. If I close the application, and open the Gallery app that comes pre-installed, I see that the sd card folder has the correct number of images, and it 'displays' the first four. If I start my application again, those four images are displayed, and only those. If I go back to the Gallery application, open the sd card folder so that it loads all images, and restart my application, all images are successfully displayed. Any reason why this happens? I am using version 1.6, and (part of) my code is below: [code] // Set up an array of the Thumbnail Image ID column we want String[] projection = {MediaStore.Images.Thumbnails._ID}; // Create the cursor pointing to the SDCard cursor = managedQuery ( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, projection, null, null, MediaStore.Images.Thumbnails.IMAGE_ID); // Get the column index of the Thumbnails ID columnIndex = cursor.getColumnIndexOrThrow (MediaStore.Images.Thumbnails._ID); sdcardImages = (GridView) findViewById(R.id.sdcard); //new LoadImagesFromSDCard().execute(); imageAdapter = new ImageAdapter(getApplicationContext()); sdcardImages.setAdapter(imageAdapter); [/code] Thank you, Mihai Fonoage --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Android XML Schema Location
Hi, The Android XML Schema is declared in the xml files as being at http://schemas.android.com/apk/res/android;. Since this URL is not found, how does Android validate the xml attributes that are in the Android namespace? I am guessing the schema file comes bundled with the SDK, in which case where is it located? Thank you, Mihai Fonoage --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to 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 XML Schema Location
But if I change the identifier to something else, it does not work, hence the http://schemas.android.com/apk/res/android; value of the namespace has to have some kind of (internal) meaning. I get though that the validity of the attributes is based on the parent element (as per my understanding), but this does not explain why it will not work with a value of http://mihai/fonoage; for example. Thank you, Mihai Fonoage On Sep 28, 7:09 pm, Romain Guy romain...@google.com wrote: There is no schema, this is just an identifier for the namespace. On Mon, Sep 28, 2009 at 4:04 PM, Mihai Fonoage fonoag...@gmail.com wrote: Hi, The Android XML Schema is declared in the xml files as being at http://schemas.android.com/apk/res/android;. Since this URL is not found, how does Android validate the xml attributes that are in the Android namespace? I am guessing the schema file comes bundled with the SDK, in which case where is it located? Thank you, Mihai Fonoage -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android XML Schema Location
Thanks both for your explanations! Mihai Fonoage On Sep 28, 8:19 pm, Dianne Hackborn hack...@android.com wrote: It's the namespace that the android framework resources live in. It's just a namespace, but if you change the namespace, you totally change the meaning of the XML file because by definition all attributes that were in the old namespace have changed their identity to something unrelated in a different namespace. On Mon, Sep 28, 2009 at 4:25 PM, Mihai Fonoage fonoag...@gmail.com wrote: But if I change the identifier to something else, it does not work, hence the http://schemas.android.com/apk/res/android; value of the namespace has to have some kind of (internal) meaning. I get though that the validity of the attributes is based on the parent element (as per my understanding), but this does not explain why it will not work with a value of http://mihai/fonoage; for example. Thank you, Mihai Fonoage On Sep 28, 7:09 pm, Romain Guy romain...@google.com wrote: There is no schema, this is just an identifier for the namespace. On Mon, Sep 28, 2009 at 4:04 PM, Mihai Fonoage fonoag...@gmail.com wrote: Hi, The Android XML Schema is declared in the xml files as being at http://schemas.android.com/apk/res/android;. Since this URL is not found, how does Android validate the xml attributes that are in the Android namespace? I am guessing the schema file comes bundled with the SDK, in which case where is it located? Thank you, Mihai Fonoage -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- 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] Manifest Editor - Application tab shows empty page
I started playing around with the Android Editors, so I wrote a simple Todo List application (taken from a book), and I opened the AndroidManifest.xml file using the Manifest Editor. My problem is that the Application tab shows an empty page. All other tabs work correctly. I have the ADT and the Android Editors plugins installed on both Eclipse 3.4.1, and Eclipse JEE 3.3.2. I tried reinstalling the plugins but I get the same results. In the past I have not used Android Editors at all, but I can see their utility know. The AndroidManifest.xml file is shown below: ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=todolist android:versionCode=1 android:versionName=1.0.0 application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.ToDoList android:label=@string/app_name intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity /application /manifest Any ideas why the empty page for the Application tab? Thanks, Mihai Fonoage --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: ProgressDialog's dismiss() method throwing IllegalArgumentException
Hi goro, I didn't solve the problem. I do believe this is a bug (or feature) of the m5 version of the sdk. Mihai Fonoage On May 12, 1:33 pm, goro [EMAIL PROTECTED] wrote: Hi, I am experiencing exactly the same issue as Mihai Fonoage. Have you solved it? On 20 Mrz., 13:57, vitvikt [EMAIL PROTECTED] wrote: Hi! I also have problem in my project width dismiss() for ProgressDialog. For explain my problem I used Snake as exaple. I writeed onProgressClick() and onStopProgress() in Snake.java and I call it in update() in SnakeView.java. When I call onStopProgress() width mProgressDialog.dismiss(); I have NullPointerException. Can anybody explain me, what is the matter? Thank You. In detail: I insert in Snake: ProgressDialog mProgressDialog; --- public void onCreate(Bundle icicle) { super.onCreate(icicle); --- mSnakeView.ActWW=this; --- } public void onProgressClick() { mProgressDialog=new ProgressDialog(mSnakeView.getContext()); mProgressDialog.show(mSnakeView.getContext(), null, Computer things..., true, true); } public void onStopProgress() { if(mProgressDialog!=null) mProgressDialog.dismiss(); in SnakeView: boolean toCreateProgresDialog=false; boolean WasFinishedProgress=false; public Snake ActWW; int Sch=0; private void initNewGame() { --- mNextDirection = EAST;//NORTH; --- } public void update() { if (mMode == RUNNING) { Sch++; if(Sch==5) toCreateProgresDialog=true; else if(Sch==10) { Sch=0; WasFinishedProgress=true; } if(ActWW!=null) { if(toCreateProgresDialog) { toCreateProgresDialog=false; ActWW.onProgressClick(); } if(WasFinishedProgress) { WasFinishedProgress=false; ActWW.onStopProgress(); } } --- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Displaying already existing activities
Any other comments are welcome! Mihai On Apr 8, 3:12 pm, Mihai Fonoage [EMAIL PROTECTED] wrote: The solution you mentioned was also the one I found on this forum, and which requires the task id for the activity to be passed in the moveTaskToFront method call. Unfortunately, every activity I create has the same task id. This would not be the case if the activity would be created with singleInstance, but I detailed the problem I have with this solution. Thank you, Mihai On Apr 8, 2:35 pm, David Welton [EMAIL PROTECTED] wrote: It would have been nice to be able to get a list of all existing (background) activities and close them manually, but I don't think it's possible. My guess is that you're going to have to go fishing in the undocumented stuff, which might all change tomorrow. This class looks interesting: public final class android.server.am.ActivityManagerService extends android.app.ActivityManagerNative{ It has this method, for instance: public void moveTaskToFront(int); No idea of course whether any of it's accessible. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Displaying already existing activities
Hello everyone, I am trying to display activities that were already created but are currently in the background. The problem is that I use startActivity or startSubActivity from the current activity to display them, which will create a new instance of the background activity. When calling finish on this new instance, I would want all instances of that activity to be closed, which is not the case. I could use launchMode=singleInstance in the manifest file, but I don't like how the transition is done between different activities (i.e., when starting a new activity from my single instance one, an empty screen is displayed, then the single instance activity is displayed again for a couple of seconds, then the new (map) activity is shown -- this only happens when displaying a map activity). If I don't use single instance on my original activity, the transition is done smoothly. I tried using an approach mentioned in a previous thread, where I first have to get the task id for the activity and use that when trying to bring it to the foreground, but I get the same task id for every activity that I create. Single instance would have solved that also, but as mentioned above, I dislike the screen transition process. It would have been nice to be able to get a list of all existing (background) activities and close them manually, but I don't think it's possible. If I call finish() write after I start a new activity, an intermediate screen appears before showing the new activity, which I dislike also. I am implementing the whole onActivityResult concept, but this goes to waits (at least in my case) when more than one instance of an activity is running, since I want all instances to be closed when one is. Hence, exiting the application has become more cumbersome. How can I solve this problem? Thank you, Mihai --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Displaying already existing activities
The solution you mentioned was also the one I found on this forum, and which requires the task id for the activity to be passed in the moveTaskToFront method call. Unfortunately, every activity I create has the same task id. This would not be the case if the activity would be created with singleInstance, but I detailed the problem I have with this solution. Thank you, Mihai On Apr 8, 2:35 pm, David Welton [EMAIL PROTECTED] wrote: It would have been nice to be able to get a list of all existing (background) activities and close them manually, but I don't think it's possible. My guess is that you're going to have to go fishing in the undocumented stuff, which might all change tomorrow. This class looks interesting: public final class android.server.am.ActivityManagerService extends android.app.ActivityManagerNative{ It has this method, for instance: public void moveTaskToFront(int); No idea of course whether any of it's accessible. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---