[android-developers] Nesting table layout in linear layout
Hi , I have defined the layout which you can see at the end of this message. I do not understand, why the button is not displayed. If I move the button to the top that the rendering works. Any hint? Thanks. http://schemas.android.com/apk/res/ android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> http://schemas.android.com/apk/res/ android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="1"> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Extremely slow Android SDK download (5 kB/sec)
Does anyone else have problems with the download of packages in the Android SDK? I can download the SDK with around 300 kB/sec, but downloading the packages inside the SDK reaches only around 5 kB/sec and it tells me something like "215 minutes left". I tried it a couple of times the last days but it didn't get better. >From the developer site (http://developer.android.com/sdk/adding- components.html): "Adding and updating components in your Android SDK is fast and easy". Yes, it's very easy, but I liked the old all-in-one SDKs which came to me in a couple of minutes... Marco -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Insufficient log / Scala deployment fails
Hi, I want to develop in Scala (within Eclipse) and have followed the procedure given in http://www.scala-lang.org/node/160. The build process works but when I try to deploy the application (emulator or device) I get the error: [2009-09-30 09:06:34 - mySecondTry]Installation error: INSTALL_FAILED_DEXOPT [2009-09-30 09:06:34 - mySecondTry]Please check logcat output for more details. [2009-09-30 09:06:34 - mySecondTry]Launch canceled! In logcat I get only this: W/installd( 543): DexInv: --- END '/data/app/vmdl24436.tmp' --- status=0x000b, process failed E/installd( 543): dexopt failed on '/data/dalvik-cache/ d...@app@vmdl24436@c lasses.dex' res = 11 W/PackageManager( 568): Package couldn't be installed in /data/app/ hello.world. apk Any help is much appreciated! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Insufficient log / Scala deployment fails
Tried it again today according to http://www.novoda.com/blog/?p=154 and this time it works :-) On 30 Sep., 21:49, fadden wrote: > On Sep 30, 12:16 am, Marco wrote: > > > In logcat I get only this: > > W/installd( 543): DexInv: --- END '/data/app/vmdl24436.tmp' --- > > status=0x000b, process failed > > E/installd( 543): dexopt failed on > > '/data/dalvik-cache/d...@a...@vmdl24436@classes.dex' res = 11 > > W/PackageManager( 568): Package couldn't be installed in > > /data/app/hello.world.apk > > That seems to indicate that dexopt failed with a segmentation fault. > > Ideally you'd have a stack trace from debuggerd earlier in the log. > > Please file a bug report on b.android.com, with the problematic APK > file attached. Be sure to indicate what version of the system you're > running on the device. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] getFilesDir() throws NullPointerException
Dear list, calling getFilesDir() in my main activity works as expected, but if I call it later from another class it throws a NullPointerException: D/AndroidRuntime( 716): Shutting down VM W/dalvikvm( 716): threadid=1: thread exiting with uncaught exception (group=0x40015560) E/AndroidRuntime( 716): FATAL EXCEPTION: main E/AndroidRuntime( 716): java.lang.RuntimeException: Unable to start activity ComponentInfo{se.miun.application/se.miun.application.MainActivity}: java.lang.NullPointerException What could be the reason and how to fix this? (The problematic class extends Activity). Please tell me if I should provide more information. Marco -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: getFilesDir() throws NullPointerException
Thanks for the very fast response. > The only reason I can think of for getFilesDir() to > return null is if it's not a real live Activity instance > (you created it via new MyActivity() instead of starting > it with startActivity(), you call getFilesDir() sometime > after the activity is destroyed, etc.). Where do I have to call startActivity()? It's not unlikely that I make something conceptually wrong in my application, since I'm new to android. This is what I did: /*/ // MainActivity.java public class MainActivity extends Activity { public MainActivity() { } @Override public void onCreate(Bundle savedInstanceState) { // getFilesDir() works here AnotherClass myA = new AnotherClassImpl(); myA.start(); } } // AnotherClassImpl.java public class AnotherClassImpl implements AnotherClass { public AnotherClassImpl () { ProblematicClass props = ProblematicClass.getProperties(); } // ProblematicClass.java public class ProblematicClass extends Activity { private static ProblematicClass myProblematicClass = null; public static ProblematicClass getProperties(){ if(myProblematicClass == null) { myProblematicClass = new ProblematicClass(); } return myProblematicClass; } public MediaSenseProperties() { // getFilesDir() failes here } } /*/ I hope this illustrates my method. All this should take place in the same activity. Marco -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: getFilesDir() throws NullPointerException
On 2011-05-27 Mark Murphy wrote: > ProblematicClass should not extend Activity. Then methods like getFileDir(), openFileInput(), … are not defined. That's the reason why I extended Activity. How to get access to these methods correctly? Marco -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: getFilesDir() throws NullPointerException
> > How to get access to these methods correctly? > > Move the code from ProblematicClass into MainActivity. > Or, if you are careful, you can pass your instance > of MainActivity to ProblematicClass. Or, if you are > careful, you can make ProblematicClass an inner class of > MainActivity. I'll elaborate in this direction. If I encounter further problems I open a new thread. Thanks for your help. Marco -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] hsqldb could not find class problem
Hi, I get a lot of error messages like: W/dalvikvm( 2368): Implementation of Lorg/hsqldb/jdbc/jdbcStatement;.isClosed is not public W/dalvikvm( 2368): Link of class 'Lorg/hsqldb/jdbc/jdbcStatement;' failed E/dalvikvm( 2368): Could not find class 'org.hsqldb.jdbc.jdbcStatement', referenced from method org.hsqldb.jdbc.jdbcConnection.createStatement W/dalvikvm( 2368): VFY: unable to resolve new-instance 446 (Lorg/hsqldb/jdbc/jdbcStatement;) in Lorg/hsqldb/jdbc/jdbcConnection; D/dalvikvm( 2368): VFY: replacing opcode 0x22 at 0x0004 D/dalvikvm( 2368): VFY: dead code 0x0006-000c in Lorg/hsqldb/jdbc/jdbcConnection;.createStatement ()Ljava/sql/Statement; I don't really believe that it is a problem in the external hsqldb jar file. It works when I compile for desktop but it fails when compiling for android. Marco -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] camera preview formats and sizes
hello, i would need to process camera preview frames of high quality in android. Is there a list of devices which are capable of using the ImageFormat.RGB_565 camera preview format? i would need to know supported preview formats and supported preview size before buying the device... (i can't use the YUV420 format, i need color information of the frame) -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Local variable type mismatch
Hi, when compiling a project I get the following error: [2011-05-09 16:30:25 - MediaSenseAndroid] Dx UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dx.cf.code.SimException: local variable type mismatch: attempt to set or access a value of type java.lang.Object using a local variable of type java.lang.Object[]. This is symptomatic of .class transformation tools that ignore local variable information. [2011-05-09 16:30:25 - MediaSenseAndroid] Dxat com.android.dx.cf.code.BaseMachine.throwLocalMismatch(BaseMachine.java:550) [2011-05-09 16:30:25 - MediaSenseAndroid] Dxat com.android.dx.cf.code.BaseMachine.getLocalTarget(BaseMachine.java:405) […] I have no clue what that means, why this happens and how I can solve the problem. If necessary I can provide further information or full log files. Marco -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Local variable type mismatch
On 2011-05-09 Igor Prilepov wrote: > As it is shown in the log file you are trying to use > array where a single object is expected. But where can I find the incorrect line? Which file, which line number? I cannot find the file BaseMachine.java that is mentioned in the logs in my sources. Thanks for your quick reply. Marco -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Local variable type mismatch
On 2011-05-09 Igor Prilepov wrote: > According to the message you are trying to set/get > variable of type Object using local variable which is > defined as [] Object. Check your local arrays and how do > you use them. That's a lot of work to check the entire code. Is it somehow possible to narrow down the error to a particular jar package or file? It's kind-of cumbersome to check every single source file in every jar package. BTW: This error only appears during compilation for Android. The program compiles/runs fine for desktop. Marco -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Local variable type mismatch
On 2011-05-10 Kostya Vasilyev wrote: > Do you have any machine-generated .class files, or any > supplied in compiled form, such as a jar file? (as > opposed to compiled on your machine from Java sources) I have many jar files included. A few of them I compiled on my machine, most of them were provided from third party or written and compiled by somebody else. > If you do, that'd be the first place to check. Thanks. Marco -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Search Bar
Did you ever manage to solve this? I'm also interested in making a search bar which looks like QuickSearch. On 18 mar, 00:38, Paolo wrote: > I'd like to make asearchbaras in the youtube widget. It seems a > layout with a edittext view and two imagebutton, but i'm not able to > make it equal. > this is an > example:http://www.mobiletor.com/images/quick-search-box-android.jpg > > I'm interested only to the GUI, not to the quicksearchfeature. > > Do you have an idea on how to reproduce it? > > Then, I'd like to have also the same keyboard, with thesearchkey in > the bottom to right, is it possibile? > > 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 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: Issue with Threads and onCreate()
That will solve the problem when opening/closing the keyboard, but won't solve it when e.g. starting the app and then immediately hitting the back button to exit it. On Wed, Mar 11, 2009 at 5:37 AM, Stoyan Damov wrote: > > keyboardHidden|orientation > > On Wed, Mar 11, 2009 at 2:34 PM, mobilekid wrote: >> >> For some reason that seems not to work in my case. I've declared the >> activity as android:configChanges="orientation" in the >> AndroidManifest.xml, which I assume will call onConfigurationChanged >> (Configuration). So for testing purposes I've simply implemented it as >> follows: >> >> @Override >> public void onConfigurationChanged (Configuration newConfig){ >> Log.i(this.toString(), "I've been called!"); >> super.onConfigurationChanged(newConfig); >> } >> >> However, it never gets called. Am I doing anything wrong here?! >> Thanks! >> >> >> >> >> On Mar 11, 11:44 am, Stoyan Damov wrote: >>> Yes, basically if you declare your activity's orientation to be >>> "sensor" there's nothing else to do (I think). >> >> > >> > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 Threads and onCreate()
Sure, but then what if right as the activity is starting, something else happens that causes it to be destroyed? (incoming phone call, camera app is started, it could be anything, really) My point was: instead of putting in all these hacks to try and prevent your activity from being stopped and restarted at an inconvenient time, it's ultimately easier to do the right thing. Like cleaning up the threads in onDestroy, using a service instead of a thread, or keeping the threads across activities. On Wed, Mar 11, 2009 at 7:18 AM, Stoyan Damov wrote: > > unless he traps the back button in onKeyDown > > On Wed, Mar 11, 2009 at 2:51 PM, Marco Nelissen wrote: >> >> That will solve the problem when opening/closing the keyboard, but >> won't solve it when e.g. starting the app and then immediately hitting >> the back button to exit it. >> >> >> On Wed, Mar 11, 2009 at 5:37 AM, Stoyan Damov wrote: >>> >>> keyboardHidden|orientation >>> >>> On Wed, Mar 11, 2009 at 2:34 PM, mobilekid >>> wrote: >>>> >>>> For some reason that seems not to work in my case. I've declared the >>>> activity as android:configChanges="orientation" in the >>>> AndroidManifest.xml, which I assume will call onConfigurationChanged >>>> (Configuration). So for testing purposes I've simply implemented it as >>>> follows: >>>> >>>> @Override >>>> public void onConfigurationChanged (Configuration newConfig){ >>>> Log.i(this.toString(), "I've been called!"); >>>> super.onConfigurationChanged(newConfig); >>>> } >>>> >>>> However, it never gets called. Am I doing anything wrong here?! >>>> Thanks! >>>> >>>> >>>> >>>> >>>> On Mar 11, 11:44 am, Stoyan Damov wrote: >>>>> Yes, basically if you declare your activity's orientation to be >>>>> "sensor" there's nothing else to do (I think). >>>> >>>> > >>>> >>> >>> > >>> >> >> > >> > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Accelerometer power tied to display backlight power
That's why you'd use a *partial* wakelock. On Sun, Mar 15, 2009 at 6:57 AM, Jordan Frank wrote: > > My fault for not explaining myself better. I want to still be able to > collect accelerometer data while the display is off. I'm well aware of > the fact that I can keep the display on, but if I want to, for > instance, create a pedometer application that counts footsteps while > in the user's pocket, then the last thing I want is to keep the > display to be on the whole time. > > Cheers, > Jordan > > On Mar 14, 3:20 pm, Stoyan Damov wrote: >> http://developer.android.com/reference/android/os/PowerManager.WakeLo... >> >> On Sat, Mar 14, 2009 at 8:23 PM, Jordan Frank >> wrote: >> >> > Hi, >> >> > Although I haven't received confirmation from anyone at Google, I can >> > confidently state that when the power to the display goes off, one can >> > no longer obtain data from the accelerometers. I can easily think of a >> > number of examples of where one would like to continue collecting >> > accelerometer data even when the display is of. >> >> > Supposing that I wanted to "fix" this, can anyone suggest where should >> > I start looking? Would this be in the SDK, the kernel, or in some >> > proprietary firmware that I can't touch? >> >> > Thanks, >> > Jordan Frank >> >> > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: The specified child already has a parent. You must call removeView() on the child's parent first.
It would help if you posted the stack trace for the exception, and the code that triggers it. On Sun, Mar 15, 2009 at 7:18 AM, gsmd wrote: > > This is the IllegalStateException thrown from onCreate() that brings > the main activity of my app down upon restart (e.g. launch app -> hit > back -> launch again -> got it). > Could someone elaborate on what does this exception mean? > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 it normal to play an audio during phone call?
The music player will automatically pause when a call comes in, however if you then decide to resume playback while you're in the call, that's your choice, and we won't prevent you from doing so. On Sun, Mar 15, 2009 at 8:16 PM, roger fang wrote: > > Hi all, > > When you pick up the call and switch the screen to MediaPlayer to play > an audio, it is able to be heard from handset (receiver). > > Thus, you can hear the far-end voice and your local music at the same > time. > Is it a normal behavior? > > Android seems not to have the mechanism to let Mediaplayer to remember > its status (to keep music pause or mute?) in the phone call. > > Or this is a normal design for notification sounds, such as a call- > waiting sound? > Is it possible to have an secondary gain feature like windows mobile > in the future? > > Thanks. > > roger > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 it normal to play an audio during phone call?
A MediaPlayer object will not pause when a call comes in. You'll have to do that yourself. The original poster was talking about "switching the screen to MediaPlayer", so I assumed he was talking about the 'Music' application, which *does* pause. On Mon, Mar 16, 2009 at 1:35 PM, Jason Van Anden wrote: > MediaPlayer keeps playing after I answer a call using my app. I was > assuming that I was responsible for pausing it and was planning to figure > out how this might be done (like, which intent I am listening for). Is the > MP supposed to just pause automatically? > > i++ > > On Mon, Mar 16, 2009 at 4:08 PM, Marco Nelissen wrote: >> >> The music player will automatically pause when a call comes in, >> however if you then decide to resume playback while you're in the >> call, that's your choice, and we won't prevent you from doing so. >> >> >> On Sun, Mar 15, 2009 at 8:16 PM, roger fang wrote: >> > >> > Hi all, >> > >> > When you pick up the call and switch the screen to MediaPlayer to play >> > an audio, it is able to be heard from handset (receiver). >> > >> > Thus, you can hear the far-end voice and your local music at the same >> > time. >> > Is it a normal behavior? >> > >> > Android seems not to have the mechanism to let Mediaplayer to remember >> > its status (to keep music pause or mute?) in the phone call. >> > >> > Or this is a normal design for notification sounds, such as a call- >> > waiting sound? >> > Is it possible to have an secondary gain feature like windows mobile >> > in the future? >> > >> > Thanks. >> > >> > roger >> > >> > > >> > >> >> > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: is there an andriod simulator?
The emulator is included in the SDK. On Tue, Mar 17, 2009 at 3:09 PM, ytbryan wrote: > > hi all, > > > may i know is there an andriod simulator ? like how the iphone > simulator works? > > thank you > > > regards > bryan > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: a way to make signal processing
On Tue, Mar 17, 2009 at 4:09 PM, Maisonobe.A (MaaKs) wrote: > > Hello, > I'm looking for a way to work on sound . I would need to get the mic > input as raw data and to perform some test , is there a way to get raw > sound data ? No, not currently. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: need help on "--core-library"
hi stoyan, I am working for a company that needs an android client for their web application. because the server is coded nicely, the first try is going to be a serialized server object on android. but the server uses jdk 1.6 and therefor some classes that android doesnt support like java.bean. because these beans are transient I just need an empty class inside android. but the problem is to compile it. any suggestions? by the way: what is freetts? greetings, darolla 2009/3/17 Stoyan Damov : > > I'll try to pull a magic now and guess what you're trying to do -- are > you trying to get FreeTTS to work in your app? :P > > On Tue, Mar 17, 2009 at 6:01 PM, DaRolla > wrote: >> >> hello, >> >> I need to build a java.beans.PropertyChangeListener which is part of >> JDK (rt.jar) but not part of Dalvik. >> >> Trying to copy the sources to my Application I get this: >> >> Attempt to include a core VM class in something other than a core >> library. >> It is likely that you have attempted to include the core library from >> a desktop >> virtual machine into an application, which will most assuredly not >> work. If >> you really intend to build a core library -- which is only appropriate >> as >> part of creating a full virtual machine binary, as opposed to >> compiling an >> application -- then use the "--core-library" option to suppress this >> error >> message. If you go ahead and use "--core-library" but are in fact >> building >> an application, then please be aware that your build will still fail >> at some >> point; you will simply be denied the pleasure of reading this helpful >> error >> message. >> >> My solution: >> 1) build a core library with consisting out of >> java.beans.PropertyChangeListener >> 2) integrate that library (jar?) into my application. >> >> My question: >> - how can I build a core library using eclipse? >> >> greetings, >> darolla >> > >> > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Simple Cursor Adapter - List View
You should create your own adapter (probably derived from SimpleCursorAdapter) that does this in its bindView method. On Tue, Mar 17, 2009 at 11:57 PM, Markiv wrote: > > I have table with 3 columns which is binded to an XML document with > three text views. > > String[] from = new String[]{A,B,C}; > > int [] to = new int[] {R.id.a,R.id.b,R.id.c}; > > Where R.id.a, R.id.b, R.id.c -> TextView > > Depending on the value store in the third column, I want to change the > text color in R.id.c > > How should, I go about with this. > > This is what I have so far : > > SimpleCursorAdapter entry = new SimpleCursorAdapter(this, > R.layout.addrow, vCursor , from , to); > > setListAdapter(entry); > > If you can provide me an example, that would be really helpful. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Re-register AlarmManager events on upgrades
On Wed, Mar 18, 2009 at 3:47 AM, Stoyan Damov wrote: > > On Wed, Mar 18, 2009 at 4:36 AM, Dianne Hackborn wrote: >> Fwiw, cupcake will add a new field to PACKAGE_ADDED to tell you if this was >> due to an update, and allow this broadcast to be received by the app to >> restart itself. >> > > This cupcake thing very much reminds me of Duke Nukem Forever... Really? You think Cupcake is not going to ship in the next 12 years? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Problems with NotificationManager
Just use a different Intent for each of your notifications. On Wed, Mar 18, 2009 at 4:03 AM, mobilek...@googlemail.com wrote: > > Hi, > In my app I use several different notifications, which require > different actions. By default the notification manager loads the main > activity, when users select a notification. How can I change that so > different notifications prompt different actions. I've been studying > the related APIs, however, could not find a way of detecting which > notification a user has selected. Any thoughts? > 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: MediaPlayer and onRetainNonConfigurationInstance()
You will have to handle the orientation change yourself, since otherwise the surface that the video is displayed on goes away. On Wed, Mar 18, 2009 at 11:30 AM, Andres Calvete wrote: > > I know this question has been asked previously because I have read the > other postings over a hundred times but yet I cannot come up with an > answer on how to use keep a MediaPlayer object playing over an > orientation change. I've read that you can use > onRetainNonConfigurationInstance() to pass an object to your future > self when the activity is destroyed/recreated, but I can't keep a > video playing in this circumstances. Does anybody have an example or > an advice/guide on how to do this? or rather what do I pass on > onRetainNonConfigurationInstance() to keep the video playing after an > orientation change? > > 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: need help on "--core-library"
I think I have to compile the java.bean. using the makefiles (just like the android core sources). to be honest I didnt find any documentation how to use them. greetings, darolla 2009/3/18 Stoyan Damov : > > FreeTTS is a text-to-speech engine. It's only dependency is *again* > java.beans.PropertyChangeListener. > I've tried compiling with --core-library using Eclipse but no matter > what I did I wasn't able to pass that parameter to the Android tools > (can't remember which one required it). > I managed to compile using the command-line tools but haven't tried > running the app because in the end I've given up because of the big > voice files required for FreeTTS. > Bottom line is, I can't really help you, but try compiling on the > command line OR try creating an IntelliJ IDEA project and modify it's > build script -- I can't guarantee it will work though. > > Cheers > > On Wed, Mar 18, 2009 at 9:51 AM, Marco Schmitz > wrote: >> >> hi stoyan, >> >> I am working for a company that needs an android client for their web >> application. because the server is coded nicely, the first try is >> going to be a serialized server object on android. but the server uses >> jdk 1.6 and therefor some classes that android doesnt support like >> java.bean. because these beans are transient I just need an empty >> class inside android. but the problem is to compile it. >> >> any suggestions? >> >> by the way: what is freetts? >> >> greetings, >> darolla >> >> 2009/3/17 Stoyan Damov : >>> >>> I'll try to pull a magic now and guess what you're trying to do -- are >>> you trying to get FreeTTS to work in your app? :P >>> >>> On Tue, Mar 17, 2009 at 6:01 PM, DaRolla >>> wrote: >>>> >>>> hello, >>>> >>>> I need to build a java.beans.PropertyChangeListener which is part of >>>> JDK (rt.jar) but not part of Dalvik. >>>> >>>> Trying to copy the sources to my Application I get this: >>>> >>>> Attempt to include a core VM class in something other than a core >>>> library. >>>> It is likely that you have attempted to include the core library from >>>> a desktop >>>> virtual machine into an application, which will most assuredly not >>>> work. If >>>> you really intend to build a core library -- which is only appropriate >>>> as >>>> part of creating a full virtual machine binary, as opposed to >>>> compiling an >>>> application -- then use the "--core-library" option to suppress this >>>> error >>>> message. If you go ahead and use "--core-library" but are in fact >>>> building >>>> an application, then please be aware that your build will still fail >>>> at some >>>> point; you will simply be denied the pleasure of reading this helpful >>>> error >>>> message. >>>> >>>> My solution: >>>> 1) build a core library with consisting out of >>>> java.beans.PropertyChangeListener >>>> 2) integrate that library (jar?) into my application. >>>> >>>> My question: >>>> - how can I build a core library using eclipse? >>>> >>>> greetings, >>>> darolla >>>> > >>>> >>> >>> > >>> >> >> > >> > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Problem launching my own (camera) application on press of Camera-button
Try calling abortBroadcast() in your receiver. On Thu, Mar 19, 2009 at 7:18 AM, Streets Of Boston wrote: > > When i press the phone's camera button, both my application and the > system's camera application are launched: > - I press camera button > - After a few seconds, my camera app appears and all looks good. > - However, when i go back (back-button), i'm not brought back to where > i was before. > Instead, i'm brought (back) to the system's camera application. > > It looks like both camera apps are launched: The system's camera app > is launched and on top of that my camera app is launched. > > I expected the activity-chooser to appear asking which camera app i'd > like to start (with an option of making one the default). > > Here are some code snippets: > Manifest: > > > android:name="android.intent.action.CAMERA_BUTTON"/> > > > android:label="@string/app_name" > android:screenOrientation="landscape" android:icon="@drawable/ > camera" > android:clearTaskOnLaunch="true" > android:taskAffinity="smugdroid.task.camera"> > > > android:name="android.intent.category.DEFAULT" /> > android:name="android.intent.category.LAUNCHER" /> > > > > > > > > CameraReceiver.java: > public void onReceive(Context context, Intent intent) { > KeyEvent event = (KeyEvent) intent.getParcelableExtra > (Intent.EXTRA_KEY_EVENT); > > if (event == null) { > return; > } > > Intent i = new Intent(Intent.ACTION_MAIN); > i.setClass(context, SmugCamera.class); > i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); > context.startActivity(i); > } > > Do i have to change the onReceive method to use Intent.createChooser > (...) instead? > Or is there some other problem i'm not aware of? > > Thank you. > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Getting a complete list of android native drawables
On Fri, Mar 20, 2009 at 7:42 AM, Mark Murphy wrote: > >>> That list is... very questionable. It contains lots and lots of >>> resources >>> that are not in the public SDK, and which you should not be using. >> >> Then how about pointing us to a list that isn't questionable? Or at least >> show us where to find said information and we'll draw up a list. > > Agreed. For example, one would hope we are encouraging people to use the > stock option menu icons wherever possible, for consistency between > applications. On the other hand, you might be better off using your own copy of the system icons. For example, if you were to use system icons plus some additional ones in the same style that you made yourself, your application's menus will look weird if the system icons are redesigned. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 check if there are registered broadcast listeners?
On Sun, Mar 22, 2009 at 5:28 AM, Yuriy Olkhovyy wrote: > > Is there a way to check before sending a broadcast (from a remote > service) whether there are registered broadcast listeners? What I'd > like to do is to send broadcasts only if there are registered > listeners, otherwise make a toast. Does it make any sense? Will there be more than one broadcast receiver? If not, then an easy way to do this would be to add another broadcast receiver with a low priority, so that it receives the (ordered) broadcast last, and then have that receiver pop up a toast. The other receiver should call abortBroadcast() in that case to prevent the final receiver from receiving the broadcast. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Cupcake coming in April? Where is the SDK?
I certainly hope there aren't "a lot" of applications that use reflection and private APIs. On Mon, Mar 23, 2009 at 6:59 AM, zl25drexel wrote: > > Cupcake is coming, and as you know it will break a lot of apps in the > market, those that use reflection & private api. So where is the > Cupcake SDK/emulator for us to try our apps? > > I know we can download the source codes and build it, and I know apps > wont break if they dont use undocumented api, blah blah blah, but we > should get an official SDK/emulator for cupcake, dont you think, > google? > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: ProgressBar - Emulator not working?
Try adding this to your xml: style="?android:attr/progressBarStyleHorizontal" On Mon, Mar 23, 2009 at 9:50 AM, droozen wrote: > > I just wanted to run a ProgressBar test, as it's my first time using > them on the Android. Here's my XML (in a Linear Layout): > > android:layout_width="fill_parent" > android:layout_height="25dip" > android:indeterminate="false" > android:max="100" > android:progress="50" /> > > When I run the emulator I get a progress bar that glows orange on the > left and right end. > > I also instead tried programmatically setting indeterminate to false, > max to 100, and progress to a solid 50. No go. I even tried creating a > background worker thread that would update the progress of the bar > every half a second. Nothing. I just get two glowing orange ends to my > bar (with a blank space in the middle). > > Is this a problem with the emulator? Or am I doing something wrong > with the ProgressBar? > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 show my ProgressBar
The problem is that your 'backgroundWork()" method is not actually running in the background, but in the main UI thread. You'll need to do the work in a separate thread. On Tue, Mar 24, 2009 at 8:02 PM, guishenl...@gmail.com wrote: > > I want to show a ProgressBar while doing some background operation, > but my code seems not to work. I hope someone can help me to solve > this problem. Thank you in advance!Here is my code and explanation : > > public boolean onMenuItemSelected(int featureId, MenuItem item) { > switch(item.getItemId()) { > case CASEONE_ID: > ProgressBar progress = (ProgressBar)findViewById > (R.id.ProgressBar); > progress.setVisibility(View.VISIBLE); > progress.bringToFront(); > progress.invalidate(); > > backgroundWork(); > > progress.setVisibility(View.GONE); > progress.invalidate(); > return true; > } > return super.onMenuItemSelected(featureId, item); > }/*In fact I never see the progressbar by this code, instead the > program will keep frozen until backgroundWork() finish. But what I > want is the progressbar can appear in the screen while backgroungWork > () is being processed. > > private void backgroundWork(){ > for(int i=0;i<1E8;i++); > }/*This is not the exact work I did in my own program. I change it to > this form is just to tell you my operation will occupy the processor > for long time.*/ > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: MediaPlayer fails with LocalSocket
The file descriptor used for a MediaPlayer must be seekable, which a socket is not. On Tue, Mar 24, 2009 at 3:22 AM, Pawel Defee wrote: > > > Trying to set a file descriptor originating from a LocalSocket on a > MediaPlayer fails in Android, both the SDK emulator and the actual > devices. > > This problem was originally described in the link below, but the > discussion got (unfortunately) sidetracked: > > http://groups.google.com/group/android-developers/browse_thread/thread/6cf46cf5d1c8af45 > > The link gives example code to reproduce the problem - I am listing > the necessary steps here as well for reference: > > 1) Create a thread with a LocalSocket that receives raw audio data > (e.g. an OGG file), for example from another LocalSocket. > > 2) Connect the socket and a new MediaPlayer using > mediaPlayer.setDataSource( receivingSocket.getFileDescriptor()); > > The code will fail with UNKNOWN_ERROR on C side with the following > exception on Java side: > > java.io.IOException: setDataSourceFD failed: status=0x8000 > at android.Media.MediaPlayer.setDataSource(Native Method) > at android.Media.MediaPlayer.setDataSource(MediaPlayer.java:251) > > I studied the C implementation of MediaPlayer APIs, but could not find > out why the method MediaPlayer::getMediaPlayerService fails to return > a valid media player service in this particular case. > > > Thanks in advance for any help, > Pawel > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: All SYMBIAN based end devices accept Java language Applications :: Need Clarification
On Wed, Mar 25, 2009 at 9:30 AM, Zhubham wrote: > > “All SYMBIAN based end devices accept Java language Applications” > > (i) Does this mean that the applications made for Android would run in > S60 , without any modifications?? No. > (ii) If not then what exactly we mean when we say the above > statement?? Is there any web link to which I can refer to?? You would have to ask the author of that comparison what s/he meant. > (iii) What are the coding guidelines that we need to follow so that an > Android application can be ported on S60 with minimum changes?? I know nothing about S60, but I imagine that keeping your UI code separate from the rest of the code would be a good first step towards portability to other platforms. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: TERRIBLE BUG: aapt crashes on Windows
On Wed, Mar 25, 2009 at 3:38 PM, Stoyan Damov wrote: > > This is a showstopper, and I'm experiencing for the 2nd time. > > Shouldn't be hard to find, if the apt tool developers have created a > .map file for the release build. > It seems like the dev has dereferenced a null pointer (see below). 012FA000 is not null :) Are you using any ninepatches with a large number of stretch regions, by any chance? If so, that bug has already been reported and is fixed in cupcake. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Anything on Android that can do smooth scrolling?
On Fri, Mar 27, 2009 at 2:35 AM, Al Sutton wrote: > > Or an "Exclusive app" and "App that can pause exclusive app" pair of > permissions. > > If you really want to make this user friendly the settings page could allow > users to select which apps with the "App that can pause exclusive apps" > permission actually can pause the exclusive app That doesn't strike me as user friendly 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: how to add "--core-library" to Eclipse ?
is there noone who can help me on this? 2009/3/26 DaRolla : > hi, > > I need to know how to add the parameter "--core-library" to Eclipse, > especially to DEX. > > I managed to work around with activitycreator and ant scripts > (build.xml), but this way it takes too long. > > Where can I configure this? > > Thanks, > DaRolla --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Some stacktraces do not show up in logcat output
All uncaught exceptions are logged. The library you are using is probably catching them at a different level, preventing them from showing up in the log. On Sun, Mar 29, 2009 at 4:14 PM, Dirk Jaeckel wrote: > > Hi! > > Usually I can see the exceptions that are thrown in my application via adb > logcat. But they > seem to get lost when thrown by code running in a somehow different Thread. > > I use the Smack Library to receive XMPPMessages. When the receiving thread > throws a > NullPointerException that is not logged. I can catch it myself and log it with > android.util.Log. > > Is it possible to have logcat show all stacktraces from all exceptions thrown > in all Threads? > > Regards, > Dirk > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: can i add a click listener to a drawable?
Your Drawable itself is not part of the UI, but is drawn onto something that is part of your UI. Therefore, you should attach your listener to the UI object that displays the Drawable. See also http://developer.android.com/reference/android/graphics/drawable/Drawable.html, which says "Unlike a View, a Drawable does not have any facility to receive events or otherwise interact with the user. " On Sun, Mar 29, 2009 at 10:24 PM, Josh wrote: > > I currently have a drawable and i need to know when it's clicked. Is > there a way to add an event listener to a drawable? > > I realize that there may be a better control to use for me needs so I > tried ImageButton but Im a bit confused on how to position the > ImageButton. For example whe i position the drawable i just use > setBounds. Is there a way to specify the x and y coordinates for an > image button? > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 game developers desperately need optimised game engine example code ...
On Mon, Mar 30, 2009 at 2:14 AM, admin.androidsl...@googlemail.com wrote: > > Thanks for the response. > > Side scrolling is a very commonly used game engine and I believe that > the platform needs better examples of this. Obviously other graphic > engines are needed too, e.g. OpenGL - but I think getting good > performance out of 2d graphics will be a very good start for many > games. > > Compare the smooth scrolling in GridViews with say the scrolling in a > paid game like deBlob (very jerky - see for yourselves) to see what I > mean. What makes you think that the reason GridView is smooth and deBlob is jerky is because of "magic" in GridView, and not because of bad coding in deBlob? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 game developers desperately need optimised game engine example code ...
Unless you're trying to build your side-scroller using multiple nested layouts and dozens of textviews, it's completely irrelevant. On Mon, Mar 30, 2009 at 9:45 AM, Sundog wrote: > > I find this more depressing than otherwise. So whoever wrote those > views wasn't happy with the system's response either and had to > "optimize". Doesn't bode well for the side-scrollers. > > > On Mar 30, 10:07 am, Romain Guy wrote: > > > > GridView and ListView don't use any magic. They just do whatever they > > can to make things fast: > > - When you touch the screen, all the children are turned into bitmaps > > - When a child is turned into a bitmap, it's an opaque bitmap whenever > > possible (ListView reuse the background color of the window) > > - When you move your finger around, the bitmaps are simply moved > > - When a new child appears, it's turned into a bitmap, etc. > > > > ListView actually does quite a lot of things when you scroll it. > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 add "--core-library" to Eclipse ?
hello you all, and thanks for your answers. it is like dan bornstein wrote: I tried to integrate java.beans.PropertyChangeListener and java.beans.PropertyChangeEvent into my eclipse android project and got the dx error. I played around with that android-sdk/tools/activitycreator and succeeded. Right now I use the build.xml (ant script) to compile, reinstall and debug my activity with included PropertyChangeListener and PropertyChangeEvent. I imported that project into eclipse in order to start the build.xml from there. I had to check off "build automatically". So right now I am using Eclipse as a texteditor and to trigger that ant script. To be more comfortable I'd like to add that parameter --core-library to eclipse / dex. is this possible somehow? greetings, darolla 2009/3/30 Mark Murphy : > > Dan Bornstein wrote: >> Maybe it needs some further wordsmithing. > > As another "for instance" of this error, I am working on Android-ifying > some existing Java code that relies on java.beans.PropertyChangeListener > and java.beans.PropertyChangeEvent. I can pull those files out of Apache > Harmony, and they are nicely self-contained -- PropertyChangeEvent > references PropertyChangeListener, but everything else they use are > supplied by Android. > > When I tried putting src/java/beans/PropertyChangeEvent.java and > src/java/beans/PropertyChangeListener.java in my source tree, though, I > triggered the --core-library error message from dx. > >> In particular, dx >> rejects the definition of classes in namespaces which are already used >> by classes in the standard boot classpath or are likely to be defined >> in future incarnations of the platform. > > The problem is that you put us out here in a bind: we can't use your > classes (because they are not in the SDK) and you won't let us use our > edition of those classes. > > I would recommend the --core-library dx error message have a link to > some documentation page where this gets spelled out, so we know what to > expect. In particular, a list of the prohibited namespaces would be > handy, so we don't have to just guess what we can and cannot use. > > FYI, I have filed this in the issue tracker as: > > http://code.google.com/p/android/issues/detail?id=2329 > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://twitter.com/commonsguy > > _The Busy Coder's Guide to Android Development_ Version 2.0 Available! > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: can i add a click listener to a drawable?
You might want to look at the source code for the camera app, which uses a SurfaceView for its preview, and puts controls on top of it. On Tue, Mar 31, 2009 at 9:21 PM, Josh Dobbs wrote: > I am using in ImageButton Now and am using the following code to ad the > button to the surfaceview.. > > myImgTest > .setBackgroundDrawable(mBalloon1); > > myImgTest.draw(canvas); > This seems to work as I do not get any errors however i don't see the > button. What is the proper way to add the button to the surface view and how > do I specify cordinates? > > > > > On Sun, Mar 29, 2009 at 11:41 PM, Marco Nelissen wrote: > >> >> Your Drawable itself is not part of the UI, but is drawn onto >> something that is part of your UI. Therefore, you should attach your >> listener to the UI object that displays the Drawable. >> See also >> http://developer.android.com/reference/android/graphics/drawable/Drawable.html >> , >> which says "Unlike a View, a Drawable does not have any facility to >> receive events or otherwise interact with the user. " >> >> >> >> On Sun, Mar 29, 2009 at 10:24 PM, Josh wrote: >> > >> > I currently have a drawable and i need to know when it's clicked. Is >> > there a way to add an event listener to a drawable? >> > >> > I realize that there may be a better control to use for me needs so I >> > tried ImageButton but Im a bit confused on how to position the >> > ImageButton. For example whe i position the drawable i just use >> > setBounds. Is there a way to specify the x and y coordinates for an >> > image button? >> > > >> > >> >> >> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: MediaPlayer sluggish to play sounds
I'm surprised that calling start() has no effect, and that it takes several seconds for playback to work again. Do you have the same issue when playing a file in the music player, for example? On Tue, Mar 31, 2009 at 5:35 PM, Eric M. Burke wrote: > > I have an Activity that plays a brief OGG "pop" sound effect when > bubbles pop. To keep it fast and to ensure I can play several pops, I > create four MediaPlayer instances. I synchronize access to a pool of > instances, so I can play up to four pops at once. Once a sound > completes, I call seekTo(0) and return the MediaPlayer instance to my > pool. > > Here is a rough sketch of the code: > > // when the activity resumes... > for (int i=0; i<4; i++) { > MediaPlayer mp = MediaPlayer.create(context, R.raw.pop); > mp.setOnCompletionListener(this); > mp.setVolume(1f, 1f); > players.add(mp); // put into a pool of available players > } > > // when a bubble pops... > MediaPlayer mp = ...get player instance from the pool > if (mp != null) { > mp.start(); // works! plays the pop sound > } > > // implement the OnCompletionListener interface > public void onCompletion(MediaPlayer mp) { > // seek to the start so I can play the sound fast the next time > mp.seekTo(0); > return the MediaPlayer to the pool > } > > Here is the problem. The pops all work so long as my game is active. > But if I let it sit there for just a few seconds, I see this in the > LogCat console: (on my G1 phone) > > AudioHardwareMSM72xx Going to standby > > Once this happens, the next several calls to MediaPlayer's start() > method play nothing...but they do cause the audio hardware to wake up > again, so then my sounds eventually (after a few seconds) start > playing again. > > My question is, how do I prevent the AudioHardwareMSM72xx from going > to standby mode while my Activity is active? > > One hacky idea...I could loop a continuous sound at extremely low > volume level in another MediaPlayer instance to force it to stay > awake. That's not appealing to me. > > 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: SQLite functions - how to use them?
While that works, it will create a Cursor with 'N' rows and then counts the number of rows. If you instead retrieved "count(*)" as a column, you'd have a Cursor with 1 row, with a field that contains the count. The latter is more efficient. On Wed, Apr 1, 2009 at 5:03 PM, Glen Humphrey wrote: > > I've used this and it works for me. > > c.getCount(); > > On Apr 1, 12:34 pm, "nEx.Software" wrote: >> I have found that, if you will be doing a lot of data access, compiled >> statements will cut the time to complete most operations in half. This >> is particularly true of inserts. Used in conjunction with >> beginTransaction()/endTransaction(), using compiled statements can >> make your data access quite swift. In addition to being faster, I find >> it easier to construct compiled statements as I can just use plain SQL >> syntax. Of course, getting familiar with the functions themselves is >> an important first step. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: screen sleeps while playing the video
Use MediaPlayer.setScreenOnWhilePlaying(), or use a VideoView instead of rolling your own. On Wed, Apr 1, 2009 at 10:33 PM, manoj wrote: > > Hi, > > I have written a video player app. Its working fine, but the problem > is the screen is going to in sleep mode after playing some time. When > I click on "Menu" button on the device, then only it wakes up. > > How can I solve this? > > Thanks, > Manoj. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Some of the strange JAVA syntax - android specifics?
On Thu, Apr 2, 2009 at 10:13 AM, Odessa Silverberg wrote: > >> synchronized: >> I'd suggest your starting reading about Java Synchronization. >> 'synchronized' blocks prevent multiple threads from executing the same >> block of code at the same time. They are used to synchronize access to >> methods and instance-variables and avoid race-conditions. Careless use >> of 'synchronized' block, however, could cause dead-locks. > In other word, similar to the lock key word in C/C++ There is no lock keyword in C/C++ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: OpenGL What Cube Face Is Facing Me
Since you're rotating and drawing the cube, shouldn't you have that information in your app already? On Thu, Apr 2, 2009 at 7:30 PM, William wrote: > > Hi Folks, > > I am drawing and rotating a cube. Is there a programmatic way to tell > what side of the cube is facing me? > > For example if I randomly spin the cube when done spinning. I want to > know which face(s) I am looking at. 10% of face 1, 90% of face 2. > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: OpenGL What Cube Face Is Facing Me
On Fri, Apr 3, 2009 at 7:24 AM, William wrote: > > //i rotate the cube using the following > //xRot,yRot are inc or decremented to change angles > gl.glRotatef(xRot, 1.0f, 0.0f, 0.0f); > gl.glRotatef(yRot, 0.0f, 1.0f, 0.0f); > > So yes i have access to yRot and xRot but they numbers range from -900 > to +900. I figure I can used them somehow to tell what is rotated but > I am unsure how. i just pass them in and it magically rotates for > me. so i am unsure how to tell from the numbers what angle the cube > is at. > > can I take a trig function to them or what? or do i take the xRot % > 360 and the remainder is what degree I am at. Or is xRot in radians > so I must convert it. The angles are in degrees. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Observation and comments on Android and "regularly" scheduled events
So, given that the functionality should be there, why is the AlarmClock App (from Google!) not working yet? http://code.google.com/p/android/issues/detail?id=1942 Is that a bug in the application, in the system, in the hardware or something else? Thanks M On Mar 30, 11:09 am, Dianne Hackborn wrote: > On Sun, Mar 29, 2009 at 5:58 PM, gjs wrote: > > (1) Is it recommended that a Service which runs for more than a few > > seconds always use a wake lock in an attempt to ensure it completes ? > > It's not really a matter of how long you run. If you want to run at all, > and don't know that the screen will be on while doing do, then you need to > hold a wake lock. > > > My limited tests on a G1 seem to show that a Service that runs for a > > few minutes ( up to about 5 minutes ) does not seem to need a wake > > lock as the phone stays awake at least until the service is completed. > > I have not tried forcing the issue by turning the phone off during the > > Service running. > > This is just happen-stance. There is no minimum amount of time that the > system keeps the CPU running for your service to run; the CPU will only run > while someone is holding a wake lock. > > > (2) Where a Service is killed by the system in a low memory situation > > and possibly restarted, is the Services onDestroy() method always > > called by the system or is the Service just killed ? > > No, nothing is called. You will usually get onLowMemory() though. > > > If the system then restarts the Service is onStart() called again with > > any of the original pending Intents or is only onCreate() called and > > the Service is then responsible for working out what work is still > > outstanding based on what it has previously stored about those intents > > from persistent storage ? > > Only onCreate() is guaranteed to be called. The onStart() method will only > be called if there are outstanding startService() requests that you have not > seen. > > > And do these behaviors vary according to whether the Service runs in > > the same process as an Activity, or in its own separate process ? ( I > > am mainly asking about a Service which runs in its own process ) > > The rules are outlined in the docs, and there is nothing special about > having one thing run in one place or another... except whether the process > will be killed is determined by the most import thing in that process. > > > (3) Should the threads running in a service always be niced down or > > will the system eventually do this automatically ? > > You should do this. Use Process.setThreadPriority(); there is a standard > constant for background threads. > > -- > Dianne Hackborn > Android framework engineer > hack...@android.com > > Note: please don't send private questions to me, as I don't have time to > provide private support. All such questions should be posted on public > forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: What is the proper handling of action.MEDIA_BUTTON?
On Fri, Apr 3, 2009 at 1:35 PM, Stefan wrote: > > Does anyone know what is the "proper" way of subscribing for the > "action.MEDIA_BUTTON" - (this is sent by the button on the headset and > currently controls the play/pause of the built in player). It depends. What do you want to do with it? If you just want to use it in your foreground application, then you can just handle it like any other key in onKeyDown. Be sure to return 'true' in that case, otherwise the system will catch the key event and turn it in to a broadcast. If you need to use it in a background service, then your only option is to use a broadcast receiver at a higher priority. We're aware that this is less than ideal and will implement something better in the future. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: play video error
What do you mean by "windows flat form"? If you want to play a file in the emulator, you will have to create an sd card image, copy the file to it, and then run the emulator with that sd card image. You cannot play a file directly off your C: drive. On Fri, Apr 3, 2009 at 10:49 PM, Nithin Varamballi wrote: > Hi.. > Can you tell me that how to run video file in > android emulator. I am using windows flat form. It is possible > to run > video file in android emulator using windows flat form... If > possible > please tell me how to run... > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: [TextView] What are that XML Attributes in JAVA ?
is there noone who want to help me on this? the most setter methods are documentated, but on this I get really nuts: android:layout_height="wrap_content" thanks darolla 2009/4/4 DaRolla : > > Hi, > > I need to programm this XML in JAVA. Some I figured out, some not. Can > you help me on the missing ones? > > > android:layout_height="wrap_content" > android:text="Bladidadi" > android:layout_gravity="center_vertical" > android:textColor="#ff" /> > > > TextView tv = new TextView(this); > > //android:layout_width="150px" > tv.setWidth(150); > > //android:layout_height="wrap_content" > ??? > > //android:text="Bladidadi" > tv.setText("Bladidadi"); > > //android:layout_gravity="center_vertical" > tv.setGravity(Gravity.CENTER_VERTICAL); > > //android:textColor="#ff" > tv.setTextColor(Color.rgb(0xff, 0xff,0xff)); // tv.setTextColor > (0xff) doesn't work somehow > > > Greetings, > DaRolla > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Detecting Noise!
That's not going to work on Android. On Sun, Apr 5, 2009 at 5:16 PM, MyLinuxSupport wrote: > > You should be able to fork the audio in Linux and write a c program to > do the analysis, then write your results to android... The challenge > you will have is getting your c program installed on the locked down > phones... Since you are only doing analysis you should be able to > fork the audio path and pipe it to your application. I'm also > interested in this area... > > Food for thought below... > > From: > http://www.commandlinefu.com/commands/view/907/unencrypted-voicechat#comment > > $ On PC1: nc -l -p > /dev/dsp On PC2: cat /dev/dsp | nc > > > > > > On Apr 6, 4:55 am, MrSnowflake wrote: >> The only way I see this possible is by having the MediaRecorder record >> some sound for a very short time, have it stop and save the file, and >> immediately start recording again. Then analyse the previous shot >> sample. You have to do it this way, because you don't have direct >> access to the sound stream from the mic. >> >> On 5 apr, 22:34, John Doe wrote: >> >> > Hi everyone. >> > I am trying to develop a program which detects noise level of >> > outside.Is it loud or silent? How loud? >> >> > Where should I start? Is there any example ? Any comment will be >> > greatly appreciated... > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: MediaPlayer API
If you want to play a file in the emulator, you will have to create an sd card image, copy the file to it, and then run the emulator with that sd card image. You cannot play a file directly off your D: drive On Mon, Apr 6, 2009 at 9:36 PM, vinny.s...@gmail.com wrote: > > can any body tell that how to play the file which is present in MY > computer For Eg : Path="D:/Vinod/Songs" > can any body give the way to play the audiao file from files in > system . > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 completely Destroy application
You should start by taking a look at the system log to see what the actual problem is. There will probably be a helpful stack trace in there. On Tue, Apr 7, 2009 at 4:01 AM, manohar wrote: > > Hi all, > > I am unable to completely destory my app. My app is thread based app. > Once i exit the app by calling onDestroy method, it is exiting > properly. If i try to relaunch the application is says "The applicatin > stoped unexpectedly, try again". If i again select my app it is > launching. It means in a alternative attempt its launching. as i am > guessing, its not making Null for few static objects. once it shows > the exception has explained above it is making all the objects null, > so that i am able to reluanch. Pls can some one suggest how to > overcome this issue. How to completely destory the application?? > > regards > manu > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Restoring the active Activity while resuming the application
On Tue, Apr 7, 2009 at 10:04 AM, Omer Saatcioglu wrote: > > Hello all, > > I have two activities running: MainActivity and ChildActivity. > Whenever the user clicks in the button in MainActivity, the > ChildActivity is launched. What I want to do is this: > > When the active activity is the ChildActivity and the user clicks the > home button then relaunch the application (like opening from the > beginning), I want to see the ChildActivity instead of MainActivity > that is launched. However; This is happening only when the user clicks > from recent activities window. (the window opened when you long press > the home button) It should already be doing what you want it to do, unless you have something in your manifest that specifically makes it not do this. What does your AndroidManifest.xml look like? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 do a startActivity() in BroadcastReceiver ?
On Tue, Apr 7, 2009 at 11:55 AM, Prem Thilagar wrote: > > Hi all > My use case is to launch one of settings app screen when I receive a > certain event in idle state. > For which, I added my new intent to PhoneAppBroadcastReceiver() in > PhoneApp.java (looks like this receiver handles the misc intents) > But when i call startActivity(), The phone seems to go into a panic What do you mean by that? > ex. startActivity(new Intent(this, NetworkSetting.class)); When starting an activity from a broadcastreceiver, you need to specify the FLAG_ACTIVITY_NEW_TASK intent flag. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: ERROR/MediaPlayer(1066): setDataSource called in state 128
Looks like you're calling MediaPlayer.setDataSource() on a MediaPlayer that was already initialized, without first calling MediaPlayer.reset() On Tue, Apr 7, 2009 at 1:28 PM, ATrubka wrote: > > Hi, guys. > > I'm using MediaPlayer and sometimes when first audio is about to end > and I click to the next audio I get the exception below. Looks like > the MediaPlayer is in some weird state of stopping playing and cannot > accept audio at the moment. > > The exception goes to the native code which is greeks to me. > I couldn't find anything about this error on the internet either. > > Is anyone here familiar with the problem? > > Thank you in advance! > > 04-07 20:19:35.855: ERROR/MediaPlayer(1066): setDataSource called in > state 128 > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): Unable to play > chapter audio > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): > java.lang.IllegalStateException > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at > android.media.MediaPlayer.setDataSource(Native Method) > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at > com.tourizo.android.services.AudioPlayerService.playResource > (AudioPlayerService.java:291) > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at > com.tourizo.android.services.AudioPlayerService.access$3 > (AudioPlayerService.java:287) > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at > com.tourizo.android.services.AudioPlayerService$1.playCurrentChapter > (AudioPlayerService.java:89) > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at > com.tourizo.android.services.AudioPlayerRemoteInterface$Stub.onTransact > (AudioPlayerRemoteInterface.java:99) > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at > android.os.Binder.execTransact(Binder.java:276) > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at > dalvik.system.NativeStart.run(Native Method) > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 completely Destroy application
Sure, but that's just masking the real problem, and is preventing the system from caching your application. On Tue, Apr 7, 2009 at 9:48 PM, manohar wrote: > > Thanks, android.os.Process.killProcess(android.os.Process.myPid()); > this got worked for me > > On Apr 7, 9:25 pm, Marco Nelissen wrote: >> You should start by taking a look at the system log to see what the >> actual problem is. There will probably be a helpful stack trace in >> there. >> >> >> >> On Tue, Apr 7, 2009 at 4:01 AM,manohar wrote: >> >> > Hi all, >> >> > I am unable to completely destory my app. My app is thread based app. >> > Once i exit the app by calling onDestroy method, it is exiting >> > properly. If i try to relaunch the application is says "The applicatin >> > stoped unexpectedly, try again". If i again select my app it is >> > launching. It means in a alternative attempt its launching. as i am >> > guessing, its not making Null for few static objects. once it shows >> > the exception has explained above it is making all the objects null, >> > so that i am able to reluanch. Pls can some one suggest how to >> > overcome this issue. How to completely destory the application?? >> >> > regards >> > manu- 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: Android XMLRPC client
hi, I don't know this framework, but I know the user. pskink. he is an android developer from poland, mostly writing into the forum anddev.org. maybe you can post him a pm there, I am sure he will help you. greetings, darolla ps: maybe you can tell him "greetings from darolla" ;) 2009/4/8 Saravanan.K : > > Hi, > > I have downloaded the XMLRPC library from > http://code.google.com/p/android-xmlrpc/downloads/detail?name=XMLRPC.tar.gz&can=2&q= > and tried using it to access my webservice. I have modified the > Test.java file to consume my own webservice. But i was not quite > successfull. > > This is the first time am trying to access a webservice. Am not quite > sure if any modifications need to be done on the file > org.xmlrpc.android.XMLRPCClient.java. > > I have seen few variables declared there... should those also need to > be modified or is it enough if we modify the Test.java file > > Am much confused with this and i have spent almost one week struggling > in this Please help me its urgent > > I need to create an android client to consume the wsdl file > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Playback of dynamic MIDI?
This is not possible right now. On Wed, Apr 8, 2009 at 8:26 PM, meantime wrote: > > For one of my apps I generate MIDI data on the fly. Is there any way > to play MIDI data from a java.io.InputStream or directly from a byte > []? So far I've only seen ways to do MIDI playback from files. Given > the continuous and dynamic nature of my audio there is no way I can > write it to a file first. > > -c > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 I call startActivity() in BradocastReceiver
You already asked this exact same question from a different email address. Please don't start multiple threads for the same question. On Tue, Apr 7, 2009 at 11:26 AM, yeons...@gmail.com wrote: > > hello, > > I'd like to launch one of settings app screen when I received a > certain event in idle state. > For that, I added my new intent to PhoneAppBroadcastReceiver() in > PhoneApp.java > (because it seems this receiver handles the misc intents) > But if I called startActivity(), seems phone goes to panic. > ex. startActivity(new Intent(this, NetworkSetting.class)); > > 1. How can I launch the activity inside of bradcastreceiver? > > 2. If the activity which I want to start is already started, how can I > check it? > I read can use NEW_TASK_LAUNCH but don't know how to use it. > If you have a sample code, could you post it? > > Thank you! > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: ERROR/MediaPlayer(1066): setDataSource called in state 128
I am one, and the error you posted indicates you called setDataSource while the MediaPlayer was in the 'playback completed' state. It could be a race condition in the framework, but since I have never seen this problem occur with the Android music app, I'm inclined to think it's a problem with your code. As a workaround, you could create a new MediaPlayer when you want to play something new. On Wed, Apr 8, 2009 at 1:05 PM, ATrubka wrote: > > Guys, please... > Is there any Android native code developers around? > > On Apr 8, 12:38 am, ATrubka wrote: >> MediaPlayer.reset() always gets invoked. Here's the exact lines of >> code: >> >> _mediaPlayer.reset(); >> _mediaPlayer.setDataSource(resource); >> _mediaPlayer.prepare(); >> _mediaPlayer.start(); >> >> Additionally, the error occurs only when next audio starts while >> previous audio is about to end. >> If next audio starts in the middle of the playback or after it has >> completely stopped playing, then everything works fine. >> >> It looks pretty much like a synchronization issue to me. >> This method is not synchronized at the moment. >> Since most of the MediaPlayer code is native I'm not sure what should >> be synchronized. >> >> On Apr 7, 9:20 pm, Marco Nelissen wrote: >> >> > Looks like you're calling MediaPlayer.setDataSource() on a MediaPlayer >> > that was already initialized, without first calling >> > MediaPlayer.reset() >> >> > On Tue, Apr 7, 2009 at 1:28 PM, ATrubka wrote: >> >> > > Hi, guys. >> >> > > I'm using MediaPlayer and sometimes when first audio is about to end >> > > and I click to the next audio I get the exception below. Looks like >> > > the MediaPlayer is in some weird state of stopping playing and cannot >> > > accept audio at the moment. >> >> > > The exception goes to the native code which is greeks to me. >> > > I couldn't find anything about this error on the internet either. >> >> > > Is anyone here familiar with the problem? >> >> > > Thank you in advance! >> >> > > 04-07 20:19:35.855: ERROR/MediaPlayer(1066): setDataSource called in >> > > state 128 >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): Unable to play >> > > chapter audio >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): >> > > java.lang.IllegalStateException >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at >> > > android.media.MediaPlayer.setDataSource(Native Method) >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at >> > > com.tourizo.android.services.AudioPlayerService.playResource >> > > (AudioPlayerService.java:291) >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at >> > > com.tourizo.android.services.AudioPlayerService.access$3 >> > > (AudioPlayerService.java:287) >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at >> > > com.tourizo.android.services.AudioPlayerService$1.playCurrentChapter >> > > (AudioPlayerService.java:89) >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at >> > > com.tourizo.android.services.AudioPlayerRemoteInterface$Stub.onTransact >> > > (AudioPlayerRemoteInterface.java:99) >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at >> > > android.os.Binder.execTransact(Binder.java:276) >> > > 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at >> > > dalvik.system.NativeStart.run(Native Method) >> >> > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 get MediaRecorder to record in MP3 format
There is no mp3 encoder included in Android currently, so you can't record to mp3. On Fri, Apr 10, 2009 at 5:13 PM, admin.androidsl...@googlemail.com wrote: > > Would be more useful than AMR / MP4. > > Also would be compatible with the very handy source code for RingDroid. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: sdcard
It would help if you said what error you're getting. You can check whether the file is actually there by doing something like "adb shell ls -l /sdcard" and checking that the file exists. On Fri, Apr 10, 2009 at 9:23 PM, Nithin wrote: > > Hi to all > > I push the one video file... and tried to play that video > file in emulator.. But > i got error... Can any tell me how can i check weather video file > insert or not... > > > Thank You > Nithin N V > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: sdcard
Are the files in a supported format? How did you put the files in /sdcard? On Fri, Apr 10, 2009 at 10:33 PM, l hx wrote: > and i meet a matter such as: some file in the /sdcard can not be seen in the > trackbrowserActivity of music app. i found the file also can not be found in > the database of the mediaprovider. who know why? > > > On Sat, Apr 11, 2009 at 1:24 PM, Marco Nelissen wrote: >> >> It would help if you said what error you're getting. >> You can check whether the file is actually there by doing something >> like "adb shell ls -l /sdcard" and checking that the file exists. >> >> >> >> On Fri, Apr 10, 2009 at 9:23 PM, Nithin wrote: >> > >> > Hi to all >> > >> > I push the one video file... and tried to play that video >> > file in emulator.. But >> > i got error... Can any tell me how can i check weather video file >> > insert or not... >> > >> > >> > Thank You >> > Nithin N V >> > > >> > >> >> > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: sdcard
What format and resolution is this file? If it's high res H264, then the emulator is probably too slow to play it. On Sat, Apr 11, 2009 at 12:07 AM, Nithin Varamballi wrote: > > Thanks for replying I dont have real phone... I am working in > Emulator... But i got error like > Cannot paly the video... > > Thanks > Nithin n v > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: FTP on android
Are you accessing the server through wi-fi, or through the carrier network? If the latter, make sure it's actually accessible from your carrier's network. On Sat, Apr 11, 2009 at 2:39 PM, tiwana wrote: > > By th way the problem is with my dev phone not with emulator, emulator > is working fine. > > On Apr 11, 2:07 pm, tiwana wrote: >> Actually my bucket upload is also not working.It is not able to >> connect to anyFTPserver. What settings do i need to change? >> >> David Given wrote: >> > -BEGIN PGP SIGNED MESSAGE- >> > Hash: SHA1 >> >> > Mark Murphy wrote: >> > [...] >> > > Bear in mind that the Android emulator runs in a virtual machine (qemu). >> > > Just because you can get to theFTPserver from your desktop does not >> > > necessarily mean you can get to it from the virtual machine. >> >> > Also, don't forget that depending on how youFTPsession is configured >> > then the server might need to make a connection back to your Android >> > system ---FTPis a ghastly protocol, and needs to be configured just >> > right (PASV) to avoid this: >> >> >http://slacksite.com/other/ftp.html >> >> > - -- >> > ┌─── dg@cowlark.com ─http://www.cowlark.com─ >> > │ >> > │ "All power corrupts, but we need electricity." --- Diana Wynne Jones, >> > │ _Archer's Goon_ >> > -BEGIN PGP SIGNATURE- >> > Version: GnuPG v1.4.9 (GNU/Linux) >> > Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org >> >> > iD8DBQFJ4NTRf9E0noFvlzgRArcJAJ9PaPtNzwl35G+ziZH+wWXKjCLCfgCfWvl/ >> > G6lErc/AmwUU36VYUb1K1Fs= >> > =PFsP >> > -END PGP SIGNATURE- > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: sdcard
mp4 is a container, which can contain all kinds of video formats. What codec was used to encode the video? On Sat, Apr 11, 2009 at 11:26 PM, Nithin Varamballi wrote: > > Hi > > Its mp4 format... Is it possible to do the videostreming > > Thank You > Nithin N V > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: finish() not killing Activity
Are you sure you don't have several instances of activity C, and each press of the back button exits one until you finally get back to activity B? Try printing "this" in C.onDestroy() to make sure. On Sun, Apr 12, 2009 at 5:07 AM, Todd Sjolander wrote: > > Hello, > I've got an application that has (among other things) three > Activities, let's call them A, B, and C. A is the main navigation > point for the entire application, and launches B and C directly using > startActivity(). They work fine that way. However, when I call C > from inside B, I get a strange problem. The code for launching > Activity C is exactly the same in both places. The problem is the > hardware back button. In the emulator, it takes two presses of the > back button in order to close Activity C and come back to B. On a G1, > it takes 3 or 4 presses. > > Upon seeing this, I implemented the usual suspects in C - onPause(), > onStop(), and onDestroy(), and onResume() in B. When I press the back > button from C and it doesn't work, I get onPause(), onStop(), onDestroy > () - in that order, but nothing happens. When it works (on press 3 or > 4 on the G1), I get onPause(), then onResume() in B, then onStop() and > onDestroy(). > > I've tried catching the key press of the back button and calling finish > (), but that doesn't make a difference. > > Has anyone seen this? To pre-empt some questions: All C does is > display some data. There are no threads or any other special > resources that C might have an active handle to that's preventing it > from closing. But out of curiosity, if it did, how would I detect > that? Any ideas for further diagnostics here? I'm out of ideas. > > 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: sdcard
If it's been scanned, but doesn't appear in the database (as you said earlier), you'll have to figure out why the file was rejected. Also, if you're having problems on a particular device, you should probably post over on the android-porting list instead of here. On Sun, Apr 12, 2009 at 5:47 AM, l hx wrote: > i am sure that the file can been played in android. when i inport android to > my device such as pxa310, it can be played in my device. but i can not be > seen in my emulation. but some other mp4 file can been seen in my emulation. > i just copy the file into the sdcard normally and can be seen in the /sdcard > catalog. i see in the mediacanner.java that ttis file is been sannered > also. > > On Sat, Apr 11, 2009 at 1:58 PM, Marco Nelissen wrote: >> >> Are the files in a supported format? How did you put the files in /sdcard? >> >> >> On Fri, Apr 10, 2009 at 10:33 PM, l hx wrote: >> > and i meet a matter such as: some file in the /sdcard can not be seen in >> > the >> > trackbrowserActivity of music app. i found the file also can not be >> > found in >> > the database of the mediaprovider. who know why? >> > >> > >> > On Sat, Apr 11, 2009 at 1:24 PM, Marco Nelissen >> > wrote: >> >> >> >> It would help if you said what error you're getting. >> >> You can check whether the file is actually there by doing something >> >> like "adb shell ls -l /sdcard" and checking that the file exists. >> >> >> >> >> >> >> >> On Fri, Apr 10, 2009 at 9:23 PM, Nithin wrote: >> >> > >> >> > Hi to all >> >> > >> >> > I push the one video file... and tried to play that video >> >> > file in emulator.. But >> >> > i got error... Can any tell me how can i check weather video file >> >> > insert or not... >> >> > >> >> > >> >> > Thank You >> >> > Nithin N V >> >> > > >> >> > >> >> >> >> > >> >> > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Events not catched on real device using Activity.dispatch
Are you sure that settings[1], settings[2] and settings[3] are true on the device? On Sun, Apr 12, 2009 at 5:20 AM, TjerkW wrote: > > Hello all! > > I am creating a game in which the user can control a ship by > - Using DPAD > - Using touchscreen > - Using trackball > - And even using orientation events (roll pitch etc) > > > It all works on the emulator but when i open the game on a real device > then > the events (touch, trackball) do not work anymore. > > I am catching evetns by overriding the dispatch() methods. > This is the code in my Activity class that catches the events: > > > public boolean dispatchKeyEvent(KeyEvent e) { > super.dispatchKeyEvent(e); > return controller.onKeyEvent(e.getKeyCode(), e); > } > > public boolean dispatchTrackballEvent(MotionEvent e) { > if(settings[2] || settings[3]) { > return controller.onTrackballEvent(e); > } else { > return super.dispatchTrackballEvent(e); > } > } > > public boolean dispatchTouchEvent(MotionEvent e) { > if(settings[1]) { > return controller.onTouchEvent(e); > } else { > return super.dispatchTouchEvent(e); > } > } > > I think the dispatchKeyEvent(..) method works fine, but the other ones > do not work on a real device. > They work without problems on the emulator. > > What am i doing wrong? > I really do not understand it. > > Thanks in advance. > > - > Tjerk Wolterink > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 is the recording format of Intent .RECORD_SOUND_ACTION?
They don't really decode let alone encode those formats though, hence the 'cheap' moniker. Short of porting a full mp3 encoder to android, there is no way to convert sound to mp3 format on the phone. On Sun, Apr 12, 2009 at 11:40 AM, bw wrote: > > Try looking at the source code for RingDroid: > http://code.google.com/p/ringdroid/source/checkout > > Particularly the CheapAMR and CheapMP3 classes which can read/write > these formats: > http://code.google.com/p/ringdroid/source/browse/#svn/trunk/src/com/ringdroid/soundfile > > > > On Mar 13, 5:27 am, zeeshan wrote: >> any solution plz? >> >> On Mar 5, 9:20 am, zeeshan wrote: >> >> > thanks for the reply Dave, i was really waiting for it. >> > is there any way to transcode it in mp3 after record finish. >> >> > i need this kind of output: >> >> > Intent intent = new Intent >> > (MediaStore.Audio.Media.RECORD_SOUND_ACTION); >> > startActivityForResult(intent, ACTIVITY_RECORD_SOUND); >> >> > protected void onActivityResult(int requestCode, int resultCode,Intent >> > data) { >> >> > if(requestCode == SELECT_AUDIO){ >> > if (resultCode == RESULT_CANCELED) { >> >> > } else { >> >> > if (data != null) { >> >> > Uri RecordedAudio = data.getData(); >> > convertInMp3(Uri); >> >> > } >> >> > } >> > } >> >> > } >> >> > ? >> >> > On Mar 5, 7:59 am, Dave Sparks wrote: >> >> > > The only audio format supported on G1 is AMR format (raw .AMR file). >> >> > > On Mar 4, 1:18 pm, zeeshan wrote: >> >> > > > Hi, >> >> > > > can anyone tell me what is the default format of android recording. >> > > > i have recorded an audio clip but dont know how can i check its >> > > > extention? >> >> > > > i am using this activity >> >> > > > Intent intent = new Intent >> > > > (MediaStore.Audio.Media.RECORD_SOUND_ACTION); >> > > > startActivityForResult(intent, ACTIVITY_RECORD_SOUND); >> >> > > > i need mp3/wav format, is it the same or do i need to convert it? how? >> >> > > > please reply me >> >> > > > thanks.- Hide quoted text - >> >> > > - Show quoted text -- Hide quoted text - >> >> > - Show quoted text - > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: finish() not killing Activity
On Sun, Apr 12, 2009 at 1:05 PM, Jon Colverson wrote: > > On Apr 12, 1:07 pm, Todd Sjolander wrote: >> hardware back button. In the emulator, it takes two presses of the >> back button in order to close Activity C and come back to B. On a G1, >> it takes 3 or 4 presses. > > When you're testing, do you clear the activity history (by going back > to the home screen) before you install a new version? Things act > weirdly if you reinstall an app that is already running. I had huge > difficulty understanding the activity lifecycle stuff (I was confused > for months, literally) until I realized that. Huh? Reinstalling an app that is running kills the running app. Are you seeing something different? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: getContentResolver.query(Images.Media.EXTERNAL_CONTENT_URI ...) returns null on device
Is there an sd card in the phone? On Sun, Apr 12, 2009 at 5:24 PM, yves...@gmail.com wrote: > > This code works fine with the emulator, I can get a cursor to all the > images, but after I installed the app into the real device (G1), I ran > the app, this call returns null. If I change from EXTERNAL_CONTENT_URI > to INTERNAL_CONTENT_URI, at least it returns not null cursor and the > count is 0. > > Anything I should do to get this to work? > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: finish() not killing Activity
On Sun, Apr 12, 2009 at 6:28 PM, Todd Sjolander wrote: > > Marco, your hunch was right. I was somehow creating multiple copies > of Activity C. In case anyone can benefit from this, let me explain > how it went wrong. > > I implemented onTouch() in Activity B, which would create an Intent > for Activity C, and then call startActivity(). For some reason, > onTouch() would get called multiple times with each touch, launching a > new Activity C each time. Yes, the onTouchEvent() method will usually be called multiple times on an actual device, since you can't hold your finger completely still, and so you will get a continuous stream of 'move' events following the 'down' event. You should only get one 'down' event though, so you could always check whether the event was a down event, and only start activity C when it is. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Loading New Data with Back Button
If 'view 2' is another activity, then the onResume() of 'view1' will be called after pressing the back button, so you could simply redisplay your data there. On Fri, Apr 10, 2009 at 7:16 PM, apple.developer27 wrote: > > I have a message application so that on view 1 is displayed a list of > messages and when you go to view 2 (subactivity) you can send a > message. I want the program to work so that when you hit the android > back button, you can go back to view 1 and see the list of messages > including the new message. Right now only the old data is displayed, > and I noticed that displayContent() is not called when going back > which I assumed it would. Is there any way to specify that when the > back button is hit, to call displayContent() again on the previous > 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: onCreateContextMenu
The return type should be void, not boolean. See: http://developer.android.com/reference/android/app/Activity.html On Sat, Apr 11, 2009 at 8:06 AM, streetdestroy...@gmail.com wrote: > > > public boolean onCreateContextMenu(Menu menu, View > v,ContextMenuInfo menuInfo) { > super.onCreateContextMenu(menu, v, menuInfo); > menu.add(0,DELETE_ID, 0, R.string.menu_delete); > > > } > > hi i did the notepadv2-tutorial and at this method eclipse shows me an > error: that this method in the type Activity is not applicable for the > arguments(menu, v, menuinfo). what's here the problem? > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: not able to play file when set data source to the sdcard file
On Mon, Apr 13, 2009 at 2:52 AM, Honest wrote: > > Hello, > I am trying to play file which is stored in SDCARD in emulator. I have > Linux O/S. So i need to provide command in run configuration. > > I am providing following parameter. > > -sdcard /usr/android/sdcard/mysdcard.iso -audio oss The sd card image needs to be a FAT filesystem image, not an ISO image. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: sdcard
That message indicates the name is not valid utf-8. What's the name/encoding you used? On Mon, Apr 13, 2009 at 5:39 AM, l hx wrote: > i found the matter may be the title of the file. because i seen the log > LOGW("JNI WARNING: illegal start byte 0x%x\n", utf8);.who know why? > > On Sun, Apr 12, 2009 at 11:46 PM, Marco Nelissen > wrote: >> >> If it's been scanned, but doesn't appear in the database (as you said >> earlier), you'll have to figure out why the file was rejected. >> Also, if you're having problems on a particular device, you should >> probably post over on the android-porting list instead of here. >> >> >> On Sun, Apr 12, 2009 at 5:47 AM, l hx wrote: >> > i am sure that the file can been played in android. when i inport >> > android to >> > my device such as pxa310, it can be played in my device. but i can not >> > be >> > seen in my emulation. but some other mp4 file can been seen in my >> > emulation. >> > i just copy the file into the sdcard normally and can be seen in the >> > /sdcard >> > catalog. i see in the mediacanner.java that ttis file is been sannered >> > also. >> > >> > On Sat, Apr 11, 2009 at 1:58 PM, Marco Nelissen >> > wrote: >> >> >> >> Are the files in a supported format? How did you put the files in >> >> /sdcard? >> >> >> >> >> >> On Fri, Apr 10, 2009 at 10:33 PM, l hx wrote: >> >> > and i meet a matter such as: some file in the /sdcard can not be seen >> >> > in >> >> > the >> >> > trackbrowserActivity of music app. i found the file also can not be >> >> > found in >> >> > the database of the mediaprovider. who know why? >> >> > >> >> > >> >> > On Sat, Apr 11, 2009 at 1:24 PM, Marco Nelissen >> >> > wrote: >> >> >> >> >> >> It would help if you said what error you're getting. >> >> >> You can check whether the file is actually there by doing something >> >> >> like "adb shell ls -l /sdcard" and checking that the file exists. >> >> >> >> >> >> >> >> >> >> >> >> On Fri, Apr 10, 2009 at 9:23 PM, Nithin wrote: >> >> >> > >> >> >> > Hi to all >> >> >> > >> >> >> > I push the one video file... and tried to play that >> >> >> > video >> >> >> > file in emulator.. But >> >> >> > i got error... Can any tell me how can i check weather video file >> >> >> > insert or not... >> >> >> > >> >> >> > >> >> >> > Thank You >> >> >> > Nithin N V >> >> >> > > >> >> >> > >> >> >> >> >> >> > >> >> >> >> > >> >> > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Does iTunes/3GPP metadata supported?
Some of the iTunes metadata is supported, but not all of it. If you bought a song from the iTunes music store, it should at least get artist/album/title/year from the file. On Mon, Apr 13, 2009 at 1:41 AM, Ethan wrote: > > Hi All, > > Please kindly help to answer the questions below, thank you very very > much! > > 1. Does AAC codec supported in .mp4 container with iTunes metadata? > 2. Does AAC codec supported in .3gp container with 3GPP metadata? > > Also please kindly indicate how retrieve these information, tracing > the codes? > > Thanks a lot!! > > Ethan > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: help......i am a Beginners
You almost no information as to what goes wrong, but my guess is that since you didn't input any values, the call to Double.parseDouble() throws an exception. BTW, since you say you're a beginner, you might want to give the android-beginners mailing list a try. On Mon, Apr 13, 2009 at 7:11 AM, yoyo wrote: > > package com.androidyo.firstbmi; > > import java.text.DecimalFormat; > > import android.app.Activity; > import android.os.Bundle; > import android.view.View; > import android.view.View.OnClickListener; > import android.widget.Button; > import android.widget.EditText; > import android.widget.TextView; > > public class Bmi extends Activity { > > /** Called when the activity is first created. */ > �...@override > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main); > > > Button button=(Button)findViewById(R.id.submit); > button.setOnClickListener(calcBMI); > } > private OnClickListener calcBMI = new OnClickListener() > { > public void onClick(View v) > { > DecimalFormat nf=new DecimalFormat("0.00"); > > EditText fieldheight=(EditText)findViewById(R.id.height); > EditText fieldweight = (EditText)findViewById(R.id.weight); > double height = > Double.parseDouble(fieldheight.getText().toString > ()); > height=height/100; > double weight = > Double.parseDouble(fieldweight.getText().toString > ()); > > TextView result = (TextView)findViewById(R.id.result); > TextView fieldsuggest = (TextView)findViewById(R.id.suggest); > if(height<=0||weight<=0) > result.setText("input wrong"); > else > { > double BMI = weight / (height * height); > > > result.setText("Your BMI is "+nf.format(BMI)); > > if(BMI>25){ > fieldsuggest.setText(R.string.advice_heavy); > }else if(BMI<20){ > fieldsuggest.setText(R.string.advice_light); > }else{ > fieldsuggest.setText(R.string.advice_average); > } > } > > } > > }; > } > > > > MY question: > > > > when runing the app .if i input nothing .it will force close > > how can i fix it??? > please give me a hang...i am a beginners.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: Gallery Child View Problem
How did you get rid of the onFling event? It sounds like whatever you did to achieve that also broke scrolling. On Mon, Apr 13, 2009 at 8:22 AM, Alekh wrote: > > I have created a child class from the Gallery view, named MyGallery. I > did this because I wanted to get rid of the onFling event in the > gallery view. Having that achieved, it lead me to a different problem. > Scrolling the Gallery with the Dpad doesn't work now. When I tried > using the original Gallery class, the dpad works fine. But when I > extend the Gallery and use my custom gallery class, the dpad stops > working. Am I missing something? Please 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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Apps labeled as Tetris Clones removed from Android Market
On Mon, Apr 13, 2009 at 10:39 AM, Ikon wrote: > > This is not legal advice. I actually am a lawyer, and these copyright > violation claims are very shaky. Basically, they have a copyright to > the exactly worded source code. So if they wrote "int numTetrads = > 50" and you wrote "int numBlocks = 50" you would not be infringing. You seem to be saying that I could take someone's source code, rename all the variables, and then claim it as my own. That can't be right. Also note that with most languages the binary would be exactly the same. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Apps labeled as Tetris Clones removed from Android Market
"You can never patent abstract ideas. Game ideas cannot be patented" OK, so we've established you're not a patent lawyer... :) My favorite patent is the one for swinging sideways on a swing, which IMO illustrates you can patent pretty much anything. On Mon, Apr 13, 2009 at 10:44 AM, Ikon wrote: > > Your contention that "grown up operating systems" should not allow you > to copy ideas is totally unfounded. You can never patent abstracty > ideas. Game ideas cannot be patented. Whether they should be is a > different discussion. You can go right and now, and make a game on > Windows with a story very similar to fallout, and write all your own > code, and use all your own graphics/sound assets and you will not be > infringing on that IP in any way. A company may come and try to sue > you, but that has no relevance to a maturity of an operating system. > > On Apr 13, 10:43 am, Sundog wrote: >> Anyone who is surprised by this must be very, very new to the >> programming game. I've been waiting for this since the store opened. >> >> IMHO, to the extent that the Android community becomes a proxy for >> those that think All Ideas Should Be Free And Stealable, that is the >> extent to which Android will never be a real grown-up operating >> system. >> >> On Apr 7, 8:43 am, "tasos.klei...@gmail.com" >> wrote: >> >> > On Saturday April 4th, I received a message from google saying that my >> > game "Robotic Space Rock" was pulled from the android market after a >> > request made by a legal firm representing an entity known as Tetris >> > Company. My application was removed from the android market together >> > with Blocks, Cubik, Net Tetris, Netblocks and Tetroid (6 apps in >> > total) under claim that it violates the DMCA and more specifically >> > trademarks and copyrighted material owned by the Tetris Company. >> > However, none of the trademarks or copyrighted material (music, >> > graphics and sound effects) are present in my game. Sound effects and >> > music were created by me specifically for the game. There is no >> > reference to the word tetris in the game. Additionally, all the game >> > code, graphics and sound effects were created by me and published on >> > the code sitehttp://code.google.com/p/monolithandroid >> >> > Additionally, I am not aware of a software patent covering the game >> > mechanics of Tetris, so I cannot see how I could violate something >> > that is not protected by a software patent. Also, even if the game was >> > protected by a patent, the patent would have expired, since the >> > original game, Tetris, was created 23 years ago. However game >> > mechanics cannot be covered by patents. >> >> > I would also like to point out that my game is available completely >> > free of charge to every user of the android market. >> >> > I wrote those concerns to Google and I sent an email to the EFF. The >> > bottom line is that for my application to be restored on the android >> > market, I have to send a DMCA counter-notification. And then the >> > Tetris Company can sue and take the case to Court. >> >> > When games were pulled from the iPhone App store, they blamed apple, >> > but it is not hard to see that behind application removals we can find >> > companies like the Tetris Company, that demand application removals >> > claiming copyright infringement and trademarks. However, it is not >> > easy to battle these companies as individual developers. I, for >> > example, am a Greek citizen living in Greece, so it is difficult for >> > me to file a counter-notification, because then the Tetris company >> > will probably sue me and I will have to defend my case in court. Why >> > should I bother? Am I making money out of the game? No! But even if I >> > did you can see how easy it is for corporations to neutralize >> > developers like that. I think that something should be done. >> > Independent developers should get together to battle against such >> > misuse of the law by corporations. >> > And to those that want more facts, you can find more details on my >> > blog:http://tkcodesharing.blogspot.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: Apps labeled as Tetris Clones removed from Android Market
On Mon, Apr 13, 2009 at 11:40 AM, Ikon wrote: > > The variable example was just a small example. My point was that on > the variable rename alone is not a copyright violation, just because > it relates to the same idea. However you cannot copy someones > functions and rename the functions/vars and make it your own. This is > obviously a close call, and it must be made by a fact-finder. > > As for your example of a swing, my comment was directed towards video- > games, and not physical apparatuses, which are clearly patentable. I > know what is accepted as patentable or not by the USPTO, as I submit > these patents on a regular basis. If you file patents on a regular basis, then surely you must have heard of the 'swing' patent before, which isn't actually a patent for the apparatus itself, but for a method for swinging sideways on a standard swing. Anyone who was ever a child should be aware of the prior art for that, yet it still got issued. Perhaps patent clerks don't go through the normal human growth cycle but emerge fully grown from a vat or something... :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: One line causing lots of garbage collection. String.format with float. Help?
Don't use String.format(). It creates all kinds of temporary objects every time you call it. Instead, create a single StringBuilder and Formatter, and then reuse those every time you need to format a string. On Mon, Apr 13, 2009 at 7:37 PM, DavidG wrote: > > In my ListView, there's one line of code in my ViewBinder that causes > lots of garbage collection as I scroll through the list, about every > two seconds... > > D/dalvikvm(16312): GC freed 13171 objects / 659576 bytes in 162ms > D/dalvikvm(16312): GC freed 13122 objects / 654128 bytes in 129ms > D/dalvikvm(16312): GC freed 13134 objects / 655416 bytes in 142ms > D/dalvikvm(16312): GC freed 13129 objects / 654840 bytes in 129ms > D/dalvikvm(16312): GC freed 13149 objects / 655000 bytes in 110ms > D/dalvikvm(16312): GC freed 13150 objects / 655720 bytes in 127ms > D/dalvikvm(16312): GC freed 13075 objects / 652256 bytes in 111ms > D/dalvikvm(16312): GC freed 13232 objects / 659040 bytes in 136ms > D/dalvikvm(16312): GC freed 13106 objects / 653920 bytes in 110ms > D/dalvikvm(16312): GC freed 13155 objects / 655152 bytes in 110ms > > The offending code is here, which formats a price for each item in the > list: > > String price = cursor.getString(columnIndex); > final float pricef = Float.parseFloat(price); > price = new StringBuffer("$").append(String.format("%. > 2f",pricef)).toString(); > ((TextView)view).setText(price); > > If I comment out the line with String.format, the garbage collection > goes away. So what's the "right" way to do this to avoid allocations? > That database field holds an unformatted text string which I'm trying > to format into proper currency format (example: format "1.5" to > "$1.50") > > Any pointers on how to improve 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: calling servlet from application
and how do I use authentication (simple http login /pw) and how https / ssl (with my own licence)? using httpclient its quite simple... do I need to set some htttp headers on my own? greetings, darolla 2009/4/14 Opal : > > Gr8, thanks for the clues :) > > On 9 Kwi, 01:03, mark.ka...@gmail.com wrote: >> Yes that is a wonderful feature of Android, in that much of the >> backend functionality is the same as 'regular' java. You can even >> stream objects back and forth to servlets, no need for chossy xml/soap >> type web data services. >> >> M >> >> On Apr 6, 11:06 am, Mark Murphy wrote: >> >> > Opal wrote: >> > > I need to call aservletfrom my android app and send/receive some >> > > data (using post method). I don't know how to do it and reading the >> > > API doesn't help me very much. Do u know any solution or have any idea >> > > how to do it? >> >> > If you use HttpURLConnection, it works the same as in "regular Java": >> >> >http://www.exampledepot.com/egs/java.net/pkg.html >> >> > If you use org.apache.http.*, there is documentation and examples at: >> >> >http://hc.apache.org >> >> > -- >> > Mark Murphy (a Commons >> > Guy)http://commonsware.com|http://twitter.com/commonsguy >> >> > Android App Developer Training:http://commonsware.com/training.html > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: using touch screen to draw a straight line
On Mon, Apr 13, 2009 at 5:12 PM, gandor wrote: > > Hi Folks, > > Want to draw a line when I touch screen at two points. > I can see OnTouch been invoked but after than everything breaks looks, > the application crashes > > I am using drawLine in Canvas. > Please let me know what I am doing wrong Look at the system log , it probably tells you exactly what you're doing wrong. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: One line causing lots of garbage collection. String.format with float. Help?
When you say that it hasn't improved your garbage collection problem, do you mean that it still GCs 13000 objects every 2 seconds? On Mon, Apr 13, 2009 at 10:42 PM, DavidG wrote: > > Thanks for the feedback.. Now I'm trying to use StringBuilder and > Formatter, but I just can't get it to stop doing the garbage > collection. I'm not sure how to go about reusing the Formatter. At > first, I just tried creating a public static Formatter member variable > and using it directly: > > public Formatter mFormatter = new Formatter(); > (then later within setViewValue()... ) > mFormatter.format("%.2f",pricef).toString(); > > Unfortunately the formatter seemed to keep "building" onto itself, > making each item in the list return a longer and longer string as I > scrolled. > > Then I looked into the Android source code and found an example that I > tried to mimick. While it gives me the output I expect, it hasn't > improved my garbage collection problem. I'm just going to post the > majority of my ViewBinder class, can someone point out where I'm going > wrong? > > > import java.util.Formatter; > import android.database.Cursor; > import android.graphics.Color; > import android.graphics.Paint; > import android.view.View; > import android.widget.ImageView; > import android.widget.SimpleCursorAdapter; > import android.widget.TextView; > > public class ItemBinder implements SimpleCursorAdapter.ViewBinder { > > public static final StringBuilder mBuilder = new StringBuilder(); > public static final Formatter mFormatter = new Formatter(mBuilder); > public static final Object[] mArgs = new Object[1]; > > public boolean setViewValue(View view, Cursor cursor, int > columnIndex) { > switch(view.getId()) { > case R.id.price: > // Format the price nicely > String price = cursor.getString(columnIndex); > final float pricef = Float.parseFloat(price); > Object[] args = mArgs; > args[0] = pricef; > mBuilder.setLength(0); > price = mFormatter.format("%.2f", args).toString(); > ((TextView)view).setText(price); > return true; > } > return false; > } > } > > > > > > > On Apr 13, 10:40 pm, Marco Nelissen wrote: >> Don't use String.format(). It creates all kinds of temporary objects >> every time you call it. >> Instead, create a single StringBuilder and Formatter, and then reuse >> those every time you need to format a string. >> >> On Mon, Apr 13, 2009 at 7:37 PM, DavidG wrote: >> >> > In my ListView, there's one line of code in my ViewBinder that causes >> > lots of garbage collection as I scroll through the list, about every >> > two seconds... >> >> > D/dalvikvm(16312): GC freed 13171 objects / 659576 bytes in 162ms >> > D/dalvikvm(16312): GC freed 13122 objects / 654128 bytes in 129ms >> > D/dalvikvm(16312): GC freed 13134 objects / 655416 bytes in 142ms >> > D/dalvikvm(16312): GC freed 13129 objects / 654840 bytes in 129ms >> > D/dalvikvm(16312): GC freed 13149 objects / 655000 bytes in 110ms >> > D/dalvikvm(16312): GC freed 13150 objects / 655720 bytes in 127ms >> > D/dalvikvm(16312): GC freed 13075 objects / 652256 bytes in 111ms >> > D/dalvikvm(16312): GC freed 13232 objects / 659040 bytes in 136ms >> > D/dalvikvm(16312): GC freed 13106 objects / 653920 bytes in 110ms >> > D/dalvikvm(16312): GC freed 13155 objects / 655152 bytes in 110ms >> >> > The offending code is here, which formats a price for each item in the >> > list: >> >> > String price = cursor.getString(columnIndex); >> > final float pricef = Float.parseFloat(price); >> > price = new StringBuffer("$").append(String.format("%. >> > 2f",pricef)).toString(); >> > ((TextView)view).setText(price); >> >> > If I comment out the line with String.format, the garbage collection >> > goes away. So what's the "right" way to do this to avoid allocations? >> > That database field holds an unformatted text string which I'm trying >> > to format into proper currency format (example: format "1.5" to >> > "$1.50") >> >> > Any pointers on how to improve 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: How to use headset button to pick up/hang up a call?
The headset button already answers an incoming call, but once you're in the call, it mutes/unmutes. If you want it to hang up the call instead, you'll need to modify the Phone application. On Tue, Apr 14, 2009 at 2:44 AM, sein wrote: > > When I'm testing the functionality of the headset button in a call,it > just muted the mic,didn't hang up the call.And if there is no > call,when I press the button,there will be a song playing,so I think > the keycode is correctly reported.there maybe some code I need to add? > Anybody knows how to? > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Re-installation failed due to different application signatures
You can't replace or uninstall the sytem apps, so if you want to create a music player based on the Android one, you'll have to put in in a different package. On Tue, Apr 14, 2009 at 3:07 AM, dycl3 wrote: > > hello: > > > out put by eclipse: > > [2009-04-14 17:55:39 - MusicBrowserActivity] Uploading > MusicBrowserActivity.apk onto device 'emulator-5554' > [2009-04-14 17:55:48 - MusicBrowserActivity] Installing > MusicBrowserActivity.apk... > [2009-04-14 17:56:11 - MusicBrowserActivity] Application already > exists. Attempting to re-install instead... > [2009-04-14 17:56:23 - MusicBrowserActivity] Re-installation failed > due to different application signatures. > [2009-04-14 17:56:23 - MusicBrowserActivity] You must perform a full > uninstall of the application. WARNING: This will remove the > application data! > [2009-04-14 17:56:23 - MusicBrowserActivity] Please execute 'adb > uninstall com.android.music' in a shell. > [2009-04-14 17:56:23 - MusicBrowserActivity] Launch canceled! > > adb uninstall com.android.music > say Failure. > > who know what should 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] Re: One line causing lots of garbage collection. String.format with float. Help?
I don't know then. I don't think that Formatter.format() should create that many temporary objects. Have you tried formatting the number differently, like as an integer? (note also that if this is a sqlite based cursor, I think you can just getFloat() the column, so you don't have to parse a string in to a float) On Tue, Apr 14, 2009 at 2:29 PM, DavidG wrote: > > That's right, with the code above, it still GCs about 13000 every 2 > seconds (as long as I'm scrolling the list quickly back and forth). If > I comment out the formatter line (price = mFormatter.format("%.2f", > args).toString();) it doesn't do the GCs anymore, but I of course lose > my formatting. > > On Apr 14, 10:28 am, Marco Nelissen wrote: >> When you say that it hasn't improved yourgarbagecollection problem, >> do you mean that it still GCs 13000 objects every 2 seconds? >> >> On Mon, Apr 13, 2009 at 10:42 PM, DavidG wrote: >> >> > Thanks for the feedback.. Now I'm trying to use StringBuilder and >> > Formatter, but I just can't get it to stop doing thegarbage >> > collection. I'm not sure how to go about reusing the Formatter. At >> > first, I just tried creating a public static Formatter member variable >> > and using it directly: >> >> > public Formatter mFormatter = new Formatter(); >> > (then later within setViewValue()... ) >> > mFormatter.format("%.2f",pricef).toString(); >> >> > Unfortunately the formatter seemed to keep "building" onto itself, >> > making each item in the list return a longer and longer string as I >> > scrolled. >> >> > Then I looked into the Android source code and found an example that I >> > tried to mimick. While it gives me the output I expect, it hasn't >> > improved mygarbagecollection problem. I'm just going to post the >> > majority of my ViewBinder class, can someone point out where I'm going >> > wrong? >> >> > >> > import java.util.Formatter; >> > import android.database.Cursor; >> > import android.graphics.Color; >> > import android.graphics.Paint; >> > import android.view.View; >> > import android.widget.ImageView; >> > import android.widget.SimpleCursorAdapter; >> > import android.widget.TextView; >> >> > public class ItemBinder implements SimpleCursorAdapter.ViewBinder { >> >> > public static final StringBuilder mBuilder = new StringBuilder(); >> > public static final Formatter mFormatter = new Formatter(mBuilder); >> > public static final Object[] mArgs = new Object[1]; >> >> > public boolean setViewValue(View view, Cursor cursor, int >> > columnIndex) { >> > switch(view.getId()) { >> > case R.id.price: >> > // Format the price nicely >> > String price = cursor.getString(columnIndex); >> > final float pricef = Float.parseFloat(price); >> > Object[] args = mArgs; >> > args[0] = pricef; >> > mBuilder.setLength(0); >> > price = mFormatter.format("%.2f", args).toString(); >> > ((TextView)view).setText(price); >> > return true; >> > } >> > return false; >> > } >> > } >> > >> >> > On Apr 13, 10:40 pm, Marco Nelissen wrote: >> >> Don't use String.format(). It creates all kinds of temporary objects >> >> every time you call it. >> >> Instead, create a single StringBuilder and Formatter, and then reuse >> >> those every time you need to format a string. >> >> >> On Mon, Apr 13, 2009 at 7:37 PM, DavidG wrote: >> >> >> > In my ListView, there'sonelineof code in my ViewBinder that causes >> >> > lots ofgarbagecollection as I scroll through the list, about every >> >> > two seconds... >> >> >> > D/dalvikvm(16312): GC freed 13171 objects / 659576 bytes in 162ms >> >> > D/dalvikvm(16312): GC freed 13122 objects / 654128 bytes in 129ms >> >> > D/dalvikvm(16312): GC freed 13134 objects / 655416 bytes in 142ms >> >> > D/dalvikvm(16312): GC freed 13129 objects / 654840 bytes in 129ms >> >> > D/dalvikvm(16312): GC freed 13149 objects / 655000 bytes in 110ms >> >> &
[android-developers] Re: Re-installation failed due to different application signatures
The system partition is mounted read-only for security/robustness. 2009/4/14 dycl3 : > > hello: > > Thank you attention, in fact, now the question is solve , > adb remount > adb shell > rm system/app/Music.apk > then run the project with eclipse , it works good. > > but i don't know why i must adt remount firs, otheriwse i couldn't > delete system/app/Music.apk, > it's say it read only. > thanks. > > > > > On 4月15日, 上午2时36分, Marco Nelissen wrote: >> You can't replace or uninstall the sytem apps, so if you want to >> create a music player based on the Android one, you'll have to put in >> in a different package. >> >> On Tue, Apr 14, 2009 at 3:07 AM,dycl3 wrote: >> >> > hello: >> >> > out put by eclipse: >> >> > [2009-04-14 17:55:39 - MusicBrowserActivity] Uploading >> > MusicBrowserActivity.apk onto device 'emulator-5554' >> > [2009-04-14 17:55:48 - MusicBrowserActivity] Installing >> > MusicBrowserActivity.apk... >> > [2009-04-14 17:56:11 - MusicBrowserActivity] Application already >> > exists. Attempting to re-install instead... >> > [2009-04-14 17:56:23 - MusicBrowserActivity] Re-installation failed >> > due to different application signatures. >> > [2009-04-14 17:56:23 - MusicBrowserActivity] You must perform a full >> > uninstall of the application. WARNING: This will remove the >> > application data! >> > [2009-04-14 17:56:23 - MusicBrowserActivity] Please execute 'adb >> > uninstall com.android.music' in a shell. >> > [2009-04-14 17:56:23 - MusicBrowserActivity] Launch canceled! >> >> > adb uninstall com.android.music >> > say Failure. >> >> > who know what should 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] Re: multiple successive queries to a database
What's the error message in the system log? On Tue, Apr 14, 2009 at 10:38 PM, iki wrote: > > The application has stopped unexpectedly. > Please try again. > > One query always works. > Two consecutive queries works about 75% of the time. > Three consecutive queries works about a third. > Four consecutive queries works about 10% > Five doesn't seem to work at all (it worked once out of many tries). > > On Apr 13, 12:15 am, Ralf wrote: >> What kind of "crash" do you get? Is this a force close or an exception? >> R/ >> >> On Thu, Apr 9, 2009 at 9:26 PM, iki wrote: >> >> > Has anyone other than me needed to make consecutivequeriesto a >> > sqlitedatabase? >> > My application works sometimes but other times (about 98% of the >> > time), the app will crash. >> > What I'm doing is using the sqlitedatabase.query(..) to return a >> > cursor which I parse, >> > I makemultiplesuccessivequeriesto the database and parse different >> > recordsets/cursors. >> >> > My question would be does a sqlitedatabase need to recover or clean up >> > after a .query is issued? > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: sendBroadcast() is crashing
What does it say in the system log? On Wed, Apr 15, 2009 at 11:11 AM, Yogi wrote: > > Hi All, > > I am try to post message with the help of sendBroadcast() API. But its > carshing. > Please find the piece of code as below: > > public static final String UICbkdAction = new String > ("android.intent.action.UICbk"); > protected IntentFilter CallbackFilter = new > IntentFilter(UICbkdAction); > > CallbackReceiver=new IntentReceiver(); > registerReceiver(CallbackReceiver, CallbackFilter); > > Intent scan = new Intent(UICbkdAction); > Bundle b=new Bundle(); > b.putInt("CbkType", ServerAdded); > b.putString("resp", text); > //b.putBoolean("result", ret_val); > scan.putExtras(b); > > sendBroadcast(scan); ->crashing with NULL > pointer exception > > class MyIntentReceiver extends BroadcastReceiver > { > �...@override > public void onReceive(Context context, Intent intent) > { > //doing something > } > } > > Please help me.. > > Thanks in advance, > Yogi > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---