[android-developers] Re: Length of text drawn in pixel?
Yes, look at Paint.measureText(). On Sun, Apr 6, 2008 at 10:57 PM, Joa [EMAIL PROTECTED] wrote: Is there a way to find out the length of text drawn to a Canvas (using drawText()) in pixel? -- Romain Guy www.curious-creature.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Is it safe to share a View among several layouts?
Unless the other applications in the emulator are slow like this, there is something specific about what you are doing that is either slow itself or hitting some slow point in the OS. Have you tried running with the profiler to see where time is being spent? On Apr 5, 8:49 pm, Anil [EMAIL PROTECTED] wrote: The same operation in Java Swing is almost instantaneous. On Apr 4, 6:57 pm, Anil [EMAIL PROTECTED] wrote: 35x35 pixels. this is just the audio 'speaker' icon on a button. On Apr 4, 11:28 am, hackbod [EMAIL PROTECTED] wrote: On Apr 4, 5:44 am, Anil [EMAIL PROTECTED] wrote: No, it is a small image: 863 bytes The second time, I have already removed it from the layout, and am calling getImageResource again, so I am surprised it is much quicker. Resources are cached. The primary difference between the two runs is most likely image loading. Btw, it's not just the file size of the image that matters, but also the size of the bitmap it uncompresses 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Emulator Reboots
I have seen it happen like 4-5 times. I will sure save the output and send it to you when it happens again. Nopes, I dont think I can reproduce it consistently. regards, harsh On Mon, Apr 7, 2008 at 1:15 AM, Digit [EMAIL PROTECTED] wrote: it's a system_server crash, so it's definitely not your application but a really bad system bug. it may have been already fixed in the current sources, but it's difficult to know. could you provide the entire logcat log and send it to me as a zip file ? also, do you have any way to reproduce this consistently ? On Sun, Apr 6, 2008 at 2:34 PM, Harsh Jain [EMAIL PROTECTED] wrote: Hi, I have been noticing that my emulator mysteriously reboots once in a while. I want to make sure this is not due to my application. Does this happen to others as well ? Harsh INFO/DEBUG(494): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** INFO/DEBUG(494): pid: 517, tid: 538 system_server INFO/DEBUG(494): signal 11 (SIGSEGV), fault addr 001a INFO/DEBUG(494): r0 0018e4e0 r1 0002 r2 00188d60 r3 INFO/DEBUG(494): r4 001b r5 r6 4029d1b0 r7 00150518 INFO/DEBUG(494): r8 0002 r9 42b8ed14 10 41f6d9e4 fp 1ab8 INFO/DEBUG(494): ip ad06d604 sp 42c8edb0 lr ad32a805 pc 001a cpsr 4030 INFO/DEBUG(494): #01 pc 001a unknown INFO/DEBUG(494): #01 lr ad32a805 /system/lib/libandroid_runtime.so INFO/DEBUG(494): stack: INFO/DEBUG(494): 42c8ed00 001a9c90 [heap] INFO/DEBUG(494): 42c8ed04 afe0e5d8 /system/lib/libc.so INFO/DEBUG(494): 42c8ed08 001a9c90 [heap] INFO/DEBUG(494): 42c8ed0c 00dc INFO/DEBUG(494): 42c8ed10 afe3c34c INFO/DEBUG(494): 42c8ed14 afe0e448 /system/lib/libc.so INFO/DEBUG(494): 42c8ed18 401ee520 INFO/DEBUG(494): 42c8ed1c afe0f1c8 /system/lib/libc.so INFO/DEBUG(494): 42c8ed20 00da INFO/DEBUG(494): 42c8ed24 401ee520 INFO/DEBUG(494): 42c8ed28 4029d1b0 INFO/DEBUG(494): 42c8ed2c afe0f1c8 /system/lib/libc.so INFO/DEBUG(494): 42c8ed30 401ee520 INFO/DEBUG(494): 42c8ed34 4029d1b0 INFO/DEBUG(494): 42c8ed38 ad06e478 /system/lib/libdvm.so INFO/DEBUG(494): 42c8ed3c afe0e448 /system/lib/libc.so INFO/DEBUG(494): 42c8ed40 4029d1b0 INFO/DEBUG(494): 42c8ed44 ad0372fb /system/lib/libdvm.so INFO/DEBUG(494): 42c8ed48 fffea294 INFO/DEBUG(494): 42c8ed4c 4029d1b0 INFO/DEBUG(494): 42c8ed50 ad06d5c8 /system/lib/libdvm.so INFO/DEBUG(494): 42c8ed54 0014fb90 [heap] INFO/DEBUG(494): 42c8ed58 0001 INFO/DEBUG(494): 42c8ed5c 0007 INFO/DEBUG(494): 42c8ed60 4029d1b0 INFO/DEBUG(494): 42c8ed64 ad03c2f5 /system/lib/libdvm.so INFO/DEBUG(494): 42c8ed68 0014fb90 [heap] INFO/DEBUG(494): 42c8ed6c 0018e4e0 [heap] INFO/DEBUG(494): 42c8ed70 4029d1b0 INFO/DEBUG(494): 42c8ed74 ad033cf1 /system/lib/libdvm.so INFO/DEBUG(494): 42c8ed78 ad06c9ec /system/lib/libdvm.so INFO/DEBUG(494): 42c8ed7c ad033cd5 /system/lib/libdvm.so INFO/DEBUG(494): 42c8ed80 00150518 [heap] INFO/DEBUG(494): 42c8ed84 ad0243f5 /system/lib/libdvm.so INFO/DEBUG(494): 42c8ed88 41f6d9e4 INFO/DEBUG(494): 42c8ed8c ad355700 /system/lib/libandroid_runtime.so INFO/DEBUG(494): 42c8ed90 401ee520 INFO/DEBUG(494): 42c8ed94 0002 INFO/DEBUG(494): 42c8ed98 41f6d9e4 INFO/DEBUG(494): 42c8ed9c ad0243a1 /system/lib/libdvm.so INFO/DEBUG(494): 42c8eda0 INFO/DEBUG(494): 42c8eda4 4029d1b0 INFO/DEBUG(494): 42c8eda8 df002777 INFO/DEBUG(494): 42c8edac e3a070ad INFO/DEBUG(494): == 42c8edb0 INFO/DEBUG(494): 42c8edb4 a9d30ae1 /system/lib/libutils.so INFO/DEBUG(494): 42c8edb8 42b8ed28 INFO/DEBUG(494): 42c8edbc 00188d60 [heap] INFO/DEBUG(494): 42c8edc0 42c8ede0 INFO/DEBUG(494): 42c8edc4 42c8ee00 INFO/DEBUG(494): 42c8edc8 0014fb90 [heap] INFO/DEBUG(494): 42c8edcc 420eaeda INFO/DEBUG(494): 42c8edd0 42b8ed24 INFO/DEBUG(494): 42c8edd4 ad00a668 /system/lib/libdvm.so INFO/DEBUG(494): 42c8edd8 INFO/DEBUG(494): 42c8eddc INFO/DEBUG(494): 42c8ede0 4104c910 INFO/DEBUG(494): 42c8ede4 0014fb90 [heap] INFO/DEBUG(494): 42c8ede8 420eaeda INFO/DEBUG(494): 42c8edec 42c8ee78 INFO/DEBUG(494): 42c8edf0 0001 INFO/DEBUG(494): 42c8edf4 1bfc INFO/DEBUG(494): 42c8edf8 42c8ee00 INFO/DEBUG(494): 42c8edfc ad036b9d /system/lib/libdvm.so INFO/DEBUG(494): 42c8ee00 42b8ed10 INFO/DEBUG(494): 42c8ee04 420eaeda INFO/DEBUG(494): 42c8ee08 ad32a7b9 /system/lib/libandroid_runtime.so INFO/DEBUG(494): 42c8ee0c 42c8ee78 INFO/DEBUG(494): 42c8ee10 42b8ed34 INFO/DEBUG(494): 42c8ee14 42b8ed00 INFO/DEBUG(494): 42c8ee18 0014fb90
[android-developers] Re: Serial Port Programming
I did this for an early protoype that hooked Android up to an actual GPS device. You can do this by creating a separate process using that reads from the COM port and then communicates COM port info to Android over HTTP or directly over sockets. If you need to init the device or send AT commands, you can create two way communication between Android and this process. Most recently I used C# since the .NET framework on Windows has good support for COM ports. A number of years ago I used an open source Java library for similar work but was unable to locate the project when I last looked a few months ago. Shane On Sun, Apr 6, 2008 at 9:44 PM, Joe [EMAIL PROTECTED] wrote: I want to read data from a COM port. Is there any way to read data from COM port by using Android? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Resource ID Range?
The value 0 is for a null or invalid resource. All other integers are valid resource values. Fwiw, resource values are currently formatted as 0xpptt where pp is a package identifier, tt is a type identifier, and is the resource name in that package+type. But please don't count on that at this point, because it may change by 1.0. On Apr 6, 2:43 pm, jml307 [EMAIL PROTECTED] wrote: I was curious what the range was for the integers assigned to resources? Specifically will -1 ever be a valid value for a resource? In my code, I am passing a resource ID into a method and sometimes I don't have that ID so I want to provide a value that I can check against and know not to use. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and List Selector(Urgent)
For your first question, I think you can just create a layout with whatever views you need for a list item (perhaps just a single textview) and then add padding to that. Here's an example: ?xml version=1.0 encoding=utf-8? TextView xmlns:android=http://schemas.android.com/apk/res/android; android:id=@android:id/text android:layout_width=fill_parent android:layout_height=wrap_content android:paddingBottom=20sp /TextView Then just reference that as a the list item to use when you set the list adapter. As for the second question, there might be a way to do this with styles, but I don't know right now. You could programmatically do it by setting an OnItemClickListener for the list and then just make a setTextColor call on the TextView. Probably in your instance, the View that gets passed into onItemClick is the TextView. On Apr 6, 10:43 pm, Greg [EMAIL PROTECTED] wrote: Hello Android Champs 1 what i want is i want to give a margin or distance between the listview items Like A B A B 2 secondly i want to show the white textcolor on selection of an item of listview .. i have successfully changed the background color but unable to change the textcolor please help me out Waiting for your reply guys --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Starting my application from browser using MIME Type Intent
Thanks for your help, baldmountain! I saw your group thread about this issue as well. Too bad this feature doesn't work - it's very important to me as I'm sure to many others. Following your reply, I'm going to stop working on this issue and try to find a workaround, as I understand it is an inherent limitation of the current SDK. If anyone has any updates on this issue - they will be most welcomed! On Apr 3, 2:25 pm, baldmountain [EMAIL PROTECTED] wrote: I managed to get a bit farther. My intent filter looks like: !-- intent-filter action android:name=android.intent.action.VIEW / category android:name=android.intent.category.DEFAULT / data android:mimeType=text/plain / /intent-filter -- You can see it is commented out. It causes the browser to crash. I submitted a bug for this. See issue 341 in the issue tracker. It was marked Future Release. Oh, you'll also need to create an sdcard for downloads and the sdcard should have a directory named download. But until this is implemented your activity isn't going to get launched. On Apr 2, 2:37 pm, Amos [EMAIL PROTECTED] wrote: Hello, I'm trying to make the browser start my application after a file with a specific MIME content type is downloaded. I've followed some hints and tips from the forum - but have not succeeded so far. From the errors I'm getting I'm not sure if I'm doing something wrong - or if this feature is fully supported already. My Intent Filter is: intent-filter action android:name=android.intent.action.VIEW / category android:name=android.intent.category.DEFAULT / category android:name=android.intent.category.BROWSABLE / data android:mimeType=myapp/zzz / /intent-filter Has anyone managed to do something similar in m5-rc15? Thanks! Amos --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Length of text drawn in pixel?
You can use Paint.getTextWidths to get it On 4月7日, 下午1时57分, Joa [EMAIL PROTECTED] wrote: Is there a way to find out the length of text drawn to a Canvas (using drawText()) in pixel? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Is it possible to use multiple selection list?
Hi all, I need a list view that can handle the selection of multiple items at the same time. Is that possible? Thanks a lot. Regards, Stefano --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Is it possible to use multiple selection list?
It will be possible in a future SDK. In the meantime, you can use checkboxes. On Mon, Apr 7, 2008 at 1:09 AM, Semeria Stefano [EMAIL PROTECTED] wrote: Hi all, I need a list view that can handle the selection of multiple items at the same time. Is that possible? Thanks a lot. Regards, Stefano -- Romain Guy www.curious-creature.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Queries in IntentReceivers
Just call getContentResolver().query(). As the documentation for managedQuery() says, it is just a wrapper around the underlying query call that connects the returned cursor with the activity's lifecycle. Since you are not doing this from an activity, there is nothing useful about managedQuery(). On Apr 7, 12:24 am, Sashi [EMAIL PROTECTED] wrote: I have an IntentReceiver. Inside of onReceiveIntent(), I need to query a content provider. Normall, in an Activity, I'd just use managedQuery(...) which returns a Cursor. However, that is a member of Activity only. How can I make the same query inside of the IntentReceiver? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Can I read files from apk or res\drawable dir
Hello, My application needs to read some data from a file, every time it runs on android. I really don't know how to see the file from my sources, i mean new FileReader(... what ...). I actually did manage to solve the problem by copying the file with ./ adb push, into /data/misc. At this moment FileReader(/data/misc/file); works. But i really don't know how to submit my app, how will they run my app without pushing that file into /data/misc. Can you help me, please? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How notification for inserts and deletes works without ContentProvider
You could solve this by sending a bundle with the id of the newly created item to your listactivity and focus the list on this item when it recieves the bundle from the subactivity. The delete thing could also be solved in a similair way, but I agree that it would be better if this worked automatically. On Apr 7, 4:55 am, vl [EMAIL PROTECTED] wrote: I don't know what error you are talking about. If you create a listactivity and use a correctly implemented contentprovider (for example the Contacts content provider) the data in the list will updated automatically when records are added, deleted or changed. The error is related to notion of a selected item. Take NotesList demo application (Note pad) as an example. 1) Create few notes. 2) Navigate through the list using up/down keys. You can see that selected item is highlighted. 3) Click Enter. You'll see edit view. Do editing and exit it. The item you just worked with is still highlighted (but may be in a different position in the list). 4) Now execute delete operation. ERROR: There is no highlighted item, but if you press Enter - one of the items will be selected, so according to Android there is a selection. 5) Add a new item. ERROR: When control is returned from the editor, new item is not shown as highlighted. For applications with small number of items in a list it would not be a big problem, but for cases with big lists (someone on this site mentioned that list activities were designed for tens of thousands of items) it could be a very serious issue. List views are refreshed in my application too and I am not using content provider. Originally I thought that absence of content provider was the reason for incorrect behavior in respect to highlighted list items, but this is not the case. I still do not know how this problem could be resolved. I cannot find in Android appropriate notification mechanism between activities to support what I see as the important requirement. So from this point I have not found any advantage of using ContentProvider for my application. And support of joins in content providers is still a mystery for me (see one of the previous notes in this thread). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Annotations and reflection
Are reflection methods like java.lang.reflect.AccessibleObject.isAnnotationPresent() implemented? Here is my example: -- i have this simple annotation: import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface GSTestAnn { } -- i have this class: public class GSTest { @GSTestAnn public void annotated() { // empty } } -- and finally this block of code: GSTest test = new GSTest(); for (Method m : test.getClass().getMethods()) { if (m.isAnnotationPresent(GSTestAnn.class)) { log(is in : + m.getName()); } else { log(NOT in : + m.getName()); } } If i run this example outside Android, everything works and name of method annotated() is prefixed by is in in log. But if I run it inside Android, all methods (including annotated()) are prefixed with NOT in .. does it mean that it isn't implemented? (it's same for other reflection methods as well) Thanks for any advice, srakyi --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Is it possible to use multiple selection list?
Here is an example. http://code.google.com/p/sharepath Semeria Stefano 写道: Hi all, I need a list view that can handle the selection of multiple items at the same time. Is that possible? Thanks a lot. Regards, Stefano --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Invalidate() on child view does not work.
This is my problem. I have a main view, a TableLayout view, this view has other views as its children added to it. One of the child views is a custom view, MyView, that I created to draw graphics on it and to receive click events. The other children are all buttons. When I click on the MyView the MyView.invalidate() button is called so that MyView gets refreshed with the new graphics. What is supposed to happen after calling invalidate() is that the MyView.onDraw() method is supposed to be called but it is never called. After some experimenting I discovered that the only reliable way to get MyView.onDraw() to be called is for me to call the top view's invalidate() method, in this case the TableLayout view. Anybody has seen this problem before and know how to fix it. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Thank you all
My whole hearted thanks to the active member of this group for their contribution and question regarding android which helped me to solve problem, think differently and finally let me learned so many things. I have submitted my project to the Google and let's wait for the result.wish you all the best those who have submitted and going to submit. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Plz Help!!
Thanks On Apr 7, 2:13 am, Dan U. [EMAIL PROTECTED] wrote: I guess you might not know this, but you don't need to be using a Boolean. You should change it to lowercase boolean and get rid of all the messy t.booleanValue() calls. But, the reason you don't see logging output is the way you are using Log. You are actually trying to print an empty message (the second argument), and that means it won't show up in logcat output. If you are confused about the arguments to a log method, think of the first argument as a String that lets you group messages together (you can create a filter to filter them out of the general logcat output). Think of the second argument as what you actually want to see in the log. On Apr 6, 7:21 am,areslp[EMAIL PROTECTED] wrote: Boolean t = flags.get(position); Log.e( + position, getView_flag: + t.booleanValue()); if (t.booleanValue()==true) { Log.e(postion:true + position, ); flags.set(position, false); view.reset(); return view; }else if(t.booleanValue()==false){ Log.e(postion:false + position, ); return view; }else{ Log.e(postion:else + position, ); return view; } Log.e( + position, getView_flag: + t.booleanValue()):I can get the line's output ,it prints true(false) But I cant get Log's output in the if-else if-else block,and there is no error throw out,why? Thanks in advance!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Plz Help!!
yes,it's ugly, it's just for test:) On Apr 7, 3:16 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Woaw, this must be one of the worst pieces of code i have recently seen. On Apr 6, 4:21 pm,areslp[EMAIL PROTECTED] wrote: Boolean t = flags.get(position); Log.e( + position, getView_flag: + t.booleanValue()); if (t.booleanValue()==true) { Log.e(postion:true + position, ); flags.set(position, false); view.reset(); return view; }else if(t.booleanValue()==false){ Log.e(postion:false + position, ); return view; }else{ Log.e(postion:else + position, ); return view; } Log.e( + position, getView_flag: + t.booleanValue()):I can get the line's output ,it prints true(false) But I cant get Log's output in the if-else if-else block,and there is no error throw out,why? Thanks in advance!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Thank you all
Good Luck! On 4月7日, 下午6时20分, Shamim [EMAIL PROTECTED] wrote: My whole hearted thanks to the active member of this group for their contribution and question regarding android which helped me to solve problem, think differently and finally let me learned so many things. I have submitted my project to the Google and let's wait for the result.wish you all the best those who have submitted and going to submit. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Content Provider and notifying changes
Hmm it seems i have missed some stuff, there is: public final void registerContentObserver(Uri uri, boolean notifyForDescendents, ContentObserver observer) where notifyForDescendants specifies if this observer receives notifications for its descendant uris. I guess this is false for cursorAdapters as default though or i am making some other mistake. Going to decompile stuff and double check... On 7 Nisan, 15:03, wonderoid [EMAIL PROTECTED] wrote: Let's say i update a certain note in a database and it has a uri like the following: .../notes/2. Now when i notify a change in this uri using ContentResolver.notifyChange(uri); is it only cursors having a single item ../notes/2 that will be notified? If i have another cursor that holds a query for all the notes in the provider .../notes, (hence it includes note 2 too), is this going to receive the notification? Actually i have tried this and it does not seem to get any notification, so am i doing something wrong or do i have to explicitly notify that base uri too? (Using cursor adapters so content observers exist) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Can I read files from apk or res\drawable dir
Thank you very much. Hope this will do the job. On Apr 7, 12:51 pm, Dan U. [EMAIL PROTECTED] wrote: I noticed the title of your post mentioned res\drawable. If you simply wanted to load a file from there, you could do this: getResources().getDrawable(R.drawable.filename); If you wanted some other kinds of files. You could put them in res\raw and use this to get an InputStream: getResources().openRawResource(R.raw.filename); By putting the files in res\raw or res\drawable, you wouldn't need to push files to the emulator. They would be part of the apk. On Apr 7, 2:00 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, My application needs to read some data from a file, every time it runs on android. I really don't know how to see the file from my sources, i mean new FileReader(... what ...). I actually did manage to solve the problem by copying the file with ./ adb push, into /data/misc. At this moment FileReader(/data/misc/file); works. But i really don't know how to submit my app, how will they run my app without pushing that file into /data/misc. Can you help me, please? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How to use a (virtual) COM (Serial) Port with Android?
Hi there everyone, I'm just gettin' warm with Android and after years without writing a single line in Java I had a hard time today when I tried to figure out how one could establish communication via a serial port with Android. I didn't find a solution so far and that's why I'm here: Is there a possibility to use the device's Bluetooth to open a virtual COM port to read data from a connected device? Is this already possible with the emulator? If yes: How? If no: Will this feature be available in the near future? Greetings. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to use a (virtual) COM (Serial) Port with Android?
this is not supported in the emulator right now. as to whether this will be supported in the future ? I really don't know On Mon, Apr 7, 2008 at 4:18 PM, sfeige [EMAIL PROTECTED] wrote: Hi there everyone, I'm just gettin' warm with Android and after years without writing a single line in Java I had a hard time today when I tried to figure out how one could establish communication via a serial port with Android. I didn't find a solution so far and that's why I'm here: Is there a possibility to use the device's Bluetooth to open a virtual COM port to read data from a connected device? Is this already possible with the emulator? If yes: How? If no: Will this feature be available in the near future? Greetings. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] android:password first letter problem
Hi all, I have the following problem: I have an EditText with android:password=true. When I type in, the first letter allways appears instead of a dot. I have in the xml file: EditText android:id=@+id/mrs_login_user_psw_1_field android:layout_width=wrap_content android:layout_height=wrap_content android:maxLength=20 android:singleLine=True android:password=true/ What am I doing wrong? Thanx, George --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Is it safe to share a View among several layouts?
Thanks hackbod, for replying. As a well wisher, I must say the slowness of the Android UI really bothers me. It took 17 seconds to parse an XML file and load the UI widgets - a list of compound items. The same list loaded almost instantaneously - too fast to measure by hand, but less than half a second - using a Java Swing application. The parsing and loading code was identical - except that in Android one has to use the SAXParserFactory class, and in Swing, I could use XMLReaderFactory directly. I shall follow your advice and use the profiler but not immediately as I still have a lot of coding to do and am very nervous and stressed out :) thanks, Anil On Apr 7, 1:05 am, hackbod [EMAIL PROTECTED] wrote: Unless the other applications in the emulator are slow like this, there is something specific about what you are doing that is either slow itself or hitting some slow point in the OS. Have you tried running with the profiler to see where time is being spent? On Apr 5, 8:49 pm, Anil [EMAIL PROTECTED] wrote: The same operation in Java Swing is almost instantaneous. On Apr 4, 6:57 pm, Anil [EMAIL PROTECTED] wrote: 35x35 pixels. this is just the audio 'speaker' icon on a button. On Apr 4, 11:28 am, hackbod [EMAIL PROTECTED] wrote: On Apr 4, 5:44 am, Anil [EMAIL PROTECTED] wrote: No, it is a small image: 863 bytes The second time, I have already removed it from the layout, and am calling getImageResource again, so I am surprised it is much quicker. Resources are cached. The primary difference between the two runs is most likely image loading. Btw, it's not just the file size of the image that matters, but also the size of the bitmap it uncompresses 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Is it safe to share a View among several layouts?
There is definitely something wrong going on in your application and we'd be happy to assist. Just know that we test Android on actual devices every day and we never encountered such an impressive slowdown. On Mon, Apr 7, 2008 at 7:50 AM, Anil [EMAIL PROTECTED] wrote: Thanks hackbod, for replying. As a well wisher, I must say the slowness of the Android UI really bothers me. It took 17 seconds to parse an XML file and load the UI widgets - a list of compound items. The same list loaded almost instantaneously - too fast to measure by hand, but less than half a second - using a Java Swing application. The parsing and loading code was identical - except that in Android one has to use the SAXParserFactory class, and in Swing, I could use XMLReaderFactory directly. I shall follow your advice and use the profiler but not immediately as I still have a lot of coding to do and am very nervous and stressed out :) thanks, Anil On Apr 7, 1:05 am, hackbod [EMAIL PROTECTED] wrote: Unless the other applications in the emulator are slow like this, there is something specific about what you are doing that is either slow itself or hitting some slow point in the OS. Have you tried running with the profiler to see where time is being spent? On Apr 5, 8:49 pm, Anil [EMAIL PROTECTED] wrote: The same operation in Java Swing is almost instantaneous. On Apr 4, 6:57 pm, Anil [EMAIL PROTECTED] wrote: 35x35 pixels. this is just the audio 'speaker' icon on a button. On Apr 4, 11:28 am, hackbod [EMAIL PROTECTED] wrote: On Apr 4, 5:44 am, Anil [EMAIL PROTECTED] wrote: No, it is a small image: 863 bytes The second time, I have already removed it from the layout, and am calling getImageResource again, so I am surprised it is much quicker. Resources are cached. The primary difference between the two runs is most likely image loading. Btw, it's not just the file size of the image that matters, but also the size of the bitmap it uncompresses to. -- Romain Guy www.curious-creature.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview animation problem
Hi, This is because ListView caches its children in Bitmaps during a scroll to get better performance. You can try turning off the caching (see the documentation for XML attributes in ViewGroup and AbsListView). On Mon, Apr 7, 2008 at 7:05 AM, wonderoid [EMAIL PROTECTED] wrote: I have some custom animated icons in a listview. These items are animated by calling invalidate() on their onDraw() method (Just assume a simple animation, like setting a different background color on every draw). Now when i scroll the listview using keys all is fine; however when i scroll it with the mouse; icons stop animating and not even explicitly calling invalidate on them starts the animation again. Any ideas? ( I heard listview will be improved in a more touch-friendly way, but if anyone can show a dirtyquick fix i'd appreciate that.) -- Romain Guy www.curious-creature.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Annotations and reflection
Hi, I don't know about M5 but I can confirm you that annotations and isAnnotationPresent work great in the next SDK. I recently used this method successfully. On Mon, Apr 7, 2008 at 4:15 AM, srakyi [EMAIL PROTECTED] wrote: Are reflection methods like java.lang.reflect.AccessibleObject.isAnnotationPresent() implemented? Here is my example: -- i have this simple annotation: import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface GSTestAnn { } -- i have this class: public class GSTest { @GSTestAnn public void annotated() { // empty } } -- and finally this block of code: GSTest test = new GSTest(); for (Method m : test.getClass().getMethods()) { if (m.isAnnotationPresent(GSTestAnn.class)) { log(is in : + m.getName()); } else { log(NOT in : + m.getName()); } } If i run this example outside Android, everything works and name of method annotated() is prefixed by is in in log. But if I run it inside Android, all methods (including annotated()) are prefixed with NOT in .. does it mean that it isn't implemented? (it's same for other reflection methods as well) Thanks for any advice, srakyi -- Romain Guy www.curious-creature.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Confusing Problem about VideoView
The VideoView example works fine when play just a sigle mp4 file, But I wander if I can pause the current playing file and setpath to another file ? I tried but it failed. how should I do if I want to switch between different mp4 files while the previous one is not finished? I use the following code to set a new file to a videoview: if (mVideoView.isPlaying()) { mVideoView.pause(); mVideoView.stopPlayback(); } mVideoView.setVideoPath(X.mp4); mVideoView.setMediaController(mMediaController); Is there anything wrong? The result is the first runing file paused, and the second file can not run. when switch back to the previous one, it crashed (BTW, the videoview widget seems resource consuming, It can't work on my old T42 notebook with 1G memory, 1.7G cpu 1core, the application die often, but on T61 with 2 core CPU, it works just as expected...) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Confusing Problem about MediaPlayer
In Sample given by google There is a button to invoke a file. private void playVideo(Integer Media) { try { // If the path has not changed, just start the media player path = /data/room.mp4; // Create a new media player and set the listeners mp = new MediaPlayer(); mp.setDataSource(path); mp.setDisplay(holder.getSurface()); mp.prepare(); mp.setOnBufferingUpdateListener(this); mp.setOnCompletionListener(this); mp.setOnPreparedListener(this); mp.setAudioStreamType(AudioSystem.STREAM_MUSIC); Log.d(\n\nCREATE, mediaplayer); mp.start(); } catch (Exception e) { Log.e(TAG, error: + e.getMessage(), e); } } private OnClickListener mPlayListener = new OnClickListener() { public void onClick(View v) { playVideo(extras.getInt(MEDIA)); } }; When I copy the code directly to onCreate like the following program creshed...: public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.mediaplayer); mPreview = (SurfaceView) findViewById(R.id.surface); // Set the transparency getWindow().setFormat(PixelFormat.TRANSPARENT); // Set a size for the video screen holder = mPreview.getHolder(); holder.addCallback(this); try { // If the path has not changed, just start the media player path = /data/room.mp4; // Create a new media player and set the listeners mp = new MediaPlayer(); mp.setDataSource(path); mp.setDisplay(holder.getSurface()); mp.prepare(); mp.setOnBufferingUpdateListener(this); mp.setOnCompletionListener(this); mp.setOnPreparedListener(this); mp.setAudioStreamType(AudioSystem.STREAM_MUSIC); Log.d(\n\nCREATE, mediaplayer); mp.start(); } catch (Exception e) { Log.e(TAG, error: + e.getMessage(), e); } } There is no error information for debug. Anyone have the same problem? Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Is it safe to share a View among several layouts?
On Apr 7, 7:50 am, Anil [EMAIL PROTECTED] wrote: The same list loaded almost instantaneously - too fast to measure by hand, but less than half a second - using a Java Swing application. The parsing and loading code was identical - except that in Android one has to use the SAXParserFactory class, and in Swing, I could use XMLReaderFactory directly. You really need to understand: what you are running when your app is in the emulator, is an EMULATED versions of the ENTIRE operating system. That is, the only native x86 code that is being run is an ARM CPU emulator and the UI shell of the emulator. The ARM emulator is, in turn, running a complete ARM-based system, from the Linux kernel, up through libc, to the Dalkvik interpreter itself. Yes, your Java code is being emulated twice: first by the ARM emulator running the Dalvik code, then the Dalkvik code running your and the system's Java code. And that ARM emulator is emulating a big chunk of the ARM hardware, including things like the MMU. Posting things about how the Android emulator is running slower than some native Java code is simply not useful to anyone, because you are comparing apples to oranges. They are not the same thing at all. As Romain says, we can assure you that on actual hardware the system is running with reasonable performance keeping in mind that the performance is not going to be anything like running Java on your desktop, because the hardware is significantly less powerful. So the basic question is: is your application's UI running more slowly than other parts of the UI that are included with android? If so, then like I said there is some issue in your application or how it is using the platform, which can probably be significantly narrowed down if not discovered through the profiler. If you are just generally complaining about the overall performance, then a solution you might want to consider is to get a faster desktop machine. (Though there have been some known performance issues when running the emulator on at least certain windows machines. I'm not sure what the state of those issues 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: About Terms conditions to submit an application
Thank you for your comments. I have a better view. I will submit the interface for my application. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Is it safe to share a View among several layouts?
On Apr 7, 11:50 am, hackbod [EMAIL PROTECTED] wrote: On Apr 7, 7:50 am, Anil [EMAIL PROTECTED] wrote: That is, the only native x86 code that is being run is an ARM CPU emulator and the UI shell of the emulator. The ARM emulator is, in turn, running a complete ARM-based system, from the Linux kernel, up through libc, to the Dalkvik interpreter itself. Yes, your Java code is being emulated twice: first by the ARM emulator running the Dalvik code, then the Dalkvik code running your and the system's Java code. And that ARM emulator is emulating a big chunk of the ARM hardware, including things like the MMU. Ok, I did not realize that - thanks for educating me! So the basic question is: is your application's UI running more slowly than other parts of the UI that are included with android? If so, Hard to tell because the ApiDemos examples are fairly simple. So I shall run the profiler after I finish developing the basic app. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] intent-filter match on android:path ?
Any idea why this: application receiver android:name=.Foobar intent-filter action android:name=android.intent.action.VIEW/ data android:scheme=content / data android:path=/im/messagesBy/.* / . Isn't matching on messages like this: Intent { action=android.intent.action.VIEW data=content://im/messagesBy/1/1/serverwitness%40gmail.com launchFlags=4 extras=Bundle[{accountId=1, [EMAIL PROTECTED]/D2530546, providerId=1}] } Thanks, -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] New activity move in and out animation
Hi! How do you set in the styles that on activity load the new window moves in from right and when you finish the activity it fades out or moves right? My style has defined this way: ?xml version=1.0 encoding=utf-8? resources style name=CalculatorTheme item name=android:windowBackground@drawable/back_loader/ item item name=android:windowNoTitletrue/item item name=android:icon@drawable/icon/item item name=android:textColor@color/DefaultText/item /style /resources And activities are started using: Intent i = new Intent(this, scicalc.class); startSubActivity(i,1); I can't find the parameter for setting this thing! Thanks in advance Jack --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Escaping values in SQL Queries
Hi all When using the SQLite functions in the Android API is there a way to escape special character in a string before using it in a query? I am a little worried about forming queries using code such as ... FIELD=\ + value + \ ... in case the value contains special characters. Not escaping values properly can result in SQL Injection Vulnerabilities is data is from untrusted sources, and we certainly would not want that! Does the whereArgs in the update method call get escaped automatically? Does this apply to Strings passed to ConentValues as well? Thanks Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] dynmatically create menuitem
Hi There, As you know, we create a menuitem at onCreateOptionsMenu method, However, when the view content has been changed, for example, first the Screen is blank, no view is added,and we display only one menuitem called Add a Button, After fullfill this function, I want to add a menuitem Delete a Button when A button-view added to screen and focus is on. so when the user click menu, it will show Add a Button,Delete aButton. How to implement this function, which method should we override it? Thanks~~ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: android:password first letter problem
I have the issue that you mentioned ~~ Did you get any solution? Thanks~ On Apr 7, 1:10 pm, David Given [EMAIL PROTECTED] wrote: goro wrote: Hi all, I have the following problem: I have an EditText with android:password=true. When I type in, the first letter allways appears instead of a dot. I have in the xml file: IIRC, when in password mode, an EditText will always show you the last character in clear (presumably for T9 text entry). Is this what you're seeing? -- David Given [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Unable to start receiver - Please help - I am stuck here .......
Hi, I am having a weird problem with an Intentreceiver. I got Unable to start receiver error. Can somebody help me, the deadline is really really near and this is the last thing to finish my project :)) Thanks !!! This is my code: ** public class HangXmpp extends Activity { IXmppSession mXmppSession = null; EditText mUsernameField; Button mSendButton; String mUsernameLocal; @Override protected void onCreate(Bundle icicle) { bindXmppService(); } @Override protected void onDestroy() { super.onDestroy(); unbindService(mConnection); } private void bindXmppService() { bindService((new Intent()).setComponent( com.google.android.xmppService.XmppConstants.XMPP_SERVICE_COMPONENT),null, mConnection, 0); } private Intent getIntentToSend() { Intent intent = new Intent(HangXmppReceiverB.ACTION_UPDATE); intent.putExtra(help, YES); return intent; } private ServiceConnection mConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { IXmppService xmppService = IXmppService.Stub.asInterface(service); try { mXmppSession = xmppService.getDefaultSession(); mUsernameLocal = mXmppSession.getUsername(); } catch (DeadObjectException ex) { showMessage(getText(R.string.found_stale_xmpp_service)); } mSendButton.setEnabled(true); } public void onServiceDisconnected(ComponentName className) { // This is called when the connection with the service has been // unexpectedly disconnected -- that is, its process crashed. mXmppSession = null; mSendButton.setEnabled(false); } }; private View.OnClickListener mOnClickListener = new View.OnClickListener() { try { mXmppSession.sendDataMessage(username, getIntentToSend()); } catch (DeadObjectException ex) { showMessage(getText(R.string.found_stale_xmpp_service)); mXmppSession = null; bindXmppService(); } } finish(); } }; } public class HangXmppReceiverB extends IntentReceiver { static final String ACTION_UPDATE = code.google.hangDroid.HangXmppReceiver.ACTION_UPDATE_DATA; public void onReceiveIntent(Context context, Intent intent) { Intent Myintent = new Intent(); NotificationManager nm; Bundle bundle = intent.getExtras(); // // This log you can see // Log.v(HangDroid,intent.toString()); if (intent.getAction().equals(ACTION_UPDATE)) { nm = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE); nm.notifyWithText(123, Sorry, but the Challenger dont want to play with you, NotificationManager.LENGTH_LONG, null); } } } ** Manifiest File receiver class=.HangXmppReceiverB intent-filter action android:value=code.google.hangDroid.HangXmppReceiver.ACTION_UPDATE_DATA/ /intent-filter /receiver .. LOGCAT . I/ActivityManager( 551): Displayed activity {code.google.hangDroid/ code.google.hangDroid.HangPlay}: 2122 ms I/ActivityManager( 551): Done launching {code.google.hangDroid/ code.google.hangDroid.HangPlay}: 2139 ms D/ActivityManager( 551): Stopping: HistoryRecord{4018f718 {code.google.hangDroid/code.google.hangDroid.HangDroig}} I/ActivityManager( 551): Starting activity: Intent { comp={code.google.hangDroid/code.google.hangDroid.HangXmpp} } D/ActivityThread( 1143): Performing launch of ActivityRecord{40160eb8 {code.google.hangDroid/code.google.hangDroid.HangXmpp}} D/xmppSrv ( 612): [XmppService] getDefaultSession: return [EMAIL PROTECTED] I/ActivityManager( 551): Displayed activity {code.google.hangDroid/ code.google.hangDroid.HangXmpp}: 247 ms I/ActivityManager( 551): Done launching {code.google.hangDroid/ code.google.hangDroid.HangXmpp}: 303 ms D/ActivityManager( 551): Stopping: HistoryRecord{4012f238 {code.google.hangDroid/code.google.hangDroid.HangPlay}} D/ActivityManager( 551): Resuming: HistoryRecord{4012f238 {code.google.hangDroid/code.google.hangDroid.HangPlay}} D/xmppSrv ( 612): [DataMsgProvider] parseExtension: got (help,YES) V/HangDroid( 1143): Intent { action=code.google.hangDroid.HangXmppReceiver.ACTION_UPDATE_DATA comp={code.google.hangDroid/code.google.hangDroid.HangXmppReceiverB} [EMAIL PROTECTED] } D/dalvikvm( 1143): Exception java/lang/RuntimeException from Looper.java:76 not caught locally D/dalvikvm( 1143): Exception java/lang/RuntimeException from ZygoteInit.java:1176 not caught locally D/AndroidRuntime( 1143): Shutting down VM W/dalvikvm( 1143): threadid=3: thread exiting
[android-developers] Re: how to build the sample code from command line?
Hi, You can use the activityCreator.py scripthttp://code.google.com/android/intro/installing.html#otheridesfor building existing projects. The existing java/resource files will not be overrwritten. For example, to build ApiDemos follow the steps below: $ cd android_sdk/samples/ApiDemos $ ../../tools/activityCreator.py com.google.android.samples $ ant Buildfile: build.xml Thanks, Megha On Mon, Apr 7, 2008 at 1:09 PM, monkey.jsun [EMAIL PROTECTED] wrote: All the tutorials have been talking about building sample code from Eclipse. I wonder if there is an easy way to build them from command line. It is not obvious how to achieve this with activityCreator.py script. Cheers. Jun --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: how to build the sample code from command line?
I've built some Maven plugins to build with Android. http://code.google.com/p/masa/ I don't use Eclipse either. Just type 'mvn install' and it will build the app and install into the emulator. In the trunk version, there is also an option for deploying directly to a JVending server http://code.google.com/p/masa/, which you can use for testing OTA delivery. Shane On Mon, Apr 7, 2008 at 1:09 PM, monkey.jsun [EMAIL PROTECTED] wrote: All the tutorials have been talking about building sample code from Eclipse. I wonder if there is an easy way to build them from command line. It is not obvious how to achieve this with activityCreator.py script. Cheers. Jun --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: startSearch
Just for clarity... this page may help. http://code.google.com/android/reference/android/app/SearchManager.html Kenny On Mar 30, 2:51 pm, ScottG [EMAIL PROTECTED] wrote: To answer my own question, put the following in the AndroidManifest description of the main activity: !-- This metadata entry causes .app.SearchQueryResults to be the default context -- !-- whenever the user invokes search while in this Activity. -- meta-data android:name=android.app.default_searchable android:value=.app.SearchQueryResults / On Mar 30, 2:17 pm, ScottG [EMAIL PROTECTED] wrote: When the SearchInvoke demo application executes startSearch the Android search window is immediately positioned at Search Demo (as opposed to Contacts, for example). When I call startSearch the search window is positioned at Contacts and I have to click to my search window. How does SearchInvoke get the search window to open up immediately at Search Demo rather than Contacts? Any insight greatfully appreciated. Cheers, Scott --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Is there a way to set the minimum size of a window?
So many questions lately... I've got a WebView inside of a Window (using the dialog theme). It works fine as long as the website is loaded quickly. In that case, the WebView resizes the window just correcly. But it seems that if it takes a while to load the page, the WebView forgets to resize the window. So I'd like to at least set the minimum size of the window as a workaround. Is there a way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Retrieving the location provider gps causes a NullPointerException in LocationManager.createProvider
The permissions are: uses-permission android:name=android.permission.ACCESS_GPS / uses-permission android:name=android.permission.ACCESS_ASSISTED_GPS / uses-permission android:name=android.permission.ACCESS_LOCATION/ Anything missing? Dan U. wrote: have you set proper uses-permission settings in androidmanifest.xml? On Apr 6, 5:36 pm, NTR [EMAIL PROTECTED] wrote: I even tried running emulator -wipe-data again, but it didn't help... NTR wrote: When I try using the gps provider, I get the following: ERROR/AndroidRuntime(3253): Caused by: java.lang.NullPointerException ERROR/AndroidRuntime(3253): at android.location.LocationManager.createProvider(LocationManager.java: 61) ERROR/AndroidRuntime(3253): at android.location.LocationManager.getProvider(LocationManager.java:119) ERROR/AndroidRuntime(3253): at net.lbns.mobileclient.util.LocationUtil.getLocationProvider(LocationUtil.java: 21) Code: public static LocationProvider getLocationProvider(Application app) { try { LocationManager locationManager = getLocationManager(app); return locationManager.getProvider(gps); } catch (SecurityException e) { return null; } } public static LocationManager getLocationManager(Application app) { return (LocationManager) app.getSystemService(Context.LOCATION_SERVICE); } The application is retrieved by using getApplication() of a sub- activity. Any help? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Radio buttons' and checkboxes' text goes behind the buttons themselves?
Really? Sounds odd. What about the other issues? Romain Guy wrote: And, if I have a horizontal LinearLayout and put an element in the middle of it, with horizontal FILL_PARENT, the elements on the right of it won't be shown. For workaround, I've set the horizontal span to WRAP_CONTENT, but weight to 1.0f. It's not a workaround, it is how it is supposed to work. -- Romain Guy www.curious-creature.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] More than one searchable per activity
Hi, Does any one know if there is a way to define more than one searchable for a single activity? An example (although probably not very useful in this case) would be allowing search for both Name and Type for the Contact activity. I have tried putting two meta-data tag in the manifest, but only the last defined tag showed up in the search bar. Kenny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: dynmatically create menuitem
Here is a full example for your question: http://code.google.com/p/sharepath see buddy.java plz On 4月8日, 上午4时51分, hackbod [EMAIL PROTECTED] wrote: To change the menus each time they are displayed, implement Activity.onPrepareOptionsMenu(). On Apr 7, 12:45 pm, Android-Berry [EMAIL PROTECTED] wrote: Hi There, As you know, we create a menuitem at onCreateOptionsMenu method, However, when the view content has been changed, for example, first the Screen is blank, no view is added,and we display only one menuitem called Add a Button, After fullfill this function, I want to add a menuitem Delete a Button when A button-view added to screen and focus is on. so when the user click menu, it will show Add a Button,Delete aButton. How to implement this function, which method should we override it? Thanks~~ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Database query NULL exception
Could you please advise what is wrong with this piece of code. After clikcing on button Change Password (confirmButton). I get the Application error An error has occurred in ... near null:syntax error. Please help. public class password extends Activity { private SQLiteDatabase db; private EditText pwd1; private EditText pwd2; private int passset = 1; /** Called when the activity is first created. */ class Row extends Object { public String password; public long rowId; } public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.pass_change); if(passset == 1){ // ask for pass Intent i = new Intent(this, passverify.class); startSubActivity(i, 0); pwd1 = (EditText) findViewById(R.id.pass1); pwd2 = (EditText) findViewById(R.id.pass2); Button confirmButton = (Button) findViewById(R.id.pass_change); Button cancelButton = (Button) findViewById(R.id.cancel); // populateFields(); confirmButton.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { String password1 = pwd1.getText().toString(); String password2 = pwd2.getText().toString(); if (password1.equals(password2)){ try { db = openDatabase(sms, null); } catch (FileNotFoundException e1) { db = null; } db.execSQL(create table password (rowid integer primary key autoincrement, + password text not null); Row row = new Row(); Cursor c = db.query(true, password, new String[] { rowid, password}, null, null, null, null, null); if (c.count() 0) { c.first(); row.rowId = c.getLong(0); row.password = c.getString(1); c.close(); ContentValues args = new ContentValues(); args.put(password, password1); db.update(password, args, rowid= + row.rowId, null); } else { //row.rowId = -1; //row.password = null; c.close(); /*ContentValues initialValues = new ContentValues(); initialValues.put(password, password1); db.insert(password, null, initialValues); */ db.execSQL(insert into password values('+password1+')); } } //db.close(); setResult(RESULT_OK); finish(); } } ); cancelButton.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { setResult(RESULT_OK); finish(); } } ); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Database query NULL exception
Have you tried using Log to print out the values you are using in your SQL queries? I bet something there is null. Do you have the stack trace to tell you what line in the code is causing the problem? On Apr 7, 6:24 pm, Sawan007 [EMAIL PROTECTED] wrote: Could you please advise what is wrong with this piece of code. After clikcing on button Change Password (confirmButton). I get the Application error An error has occurred in ... near null:syntax error. Please help. public class password extends Activity { private SQLiteDatabase db; private EditText pwd1; private EditText pwd2; private int passset = 1; /** Called when the activity is first created. */ class Row extends Object { public String password; public long rowId; } public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.pass_change); if(passset == 1){ // ask for pass Intent i = new Intent(this, passverify.class); startSubActivity(i, 0); pwd1 = (EditText) findViewById(R.id.pass1); pwd2 = (EditText) findViewById(R.id.pass2); Button confirmButton = (Button) findViewById(R.id.pass_change); Button cancelButton = (Button) findViewById(R.id.cancel); // populateFields(); confirmButton.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { String password1 = pwd1.getText().toString(); String password2 = pwd2.getText().toString(); if (password1.equals(password2)){ try { db = openDatabase(sms, null); } catch (FileNotFoundException e1) { db = null; } db.execSQL(create table password (rowid integer primary key autoincrement, + password text not null); Row row = new Row(); Cursor c = db.query(true, password, new String[] { rowid, password}, null, null, null, null, null); if (c.count() 0) { c.first(); row.rowId = c.getLong(0); row.password = c.getString(1); c.close(); ContentValues args = new ContentValues(); args.put(password, password1); db.update(password, args, rowid= + row.rowId, null); } else { //row.rowId = -1; //row.password = null; c.close(); /*ContentValues initialValues = new ContentValues(); initialValues.put(password, password1); db.insert(password, null, initialValues); */ db.execSQL(insert into password values('+password1+')); } } //db.close(); setResult(RESULT_OK); finish(); } } ); cancelButton.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { setResult(RESULT_OK); finish(); } } ); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Are you satisfied or disappointed with the level of support from Google, for Android?
That's important for the Android team and for the Open Handset Alliance and its members, that's important for Google. That's also important for the developer community and for the end users. Hello Jean-Baptiste, I suggest that the aim be for the phones to come out in 2009. If everyone is patient, then that will be a proof of cooperation. The Android Team doesn't needs phones for 2008. Neither does the OHA. And there can be more Developer Challenges. More Developer Challenges would appear to be important in two ways. To perfect Android and also for Google promotion. ATT seeks to depart more away from Google apps which is reasonable for them. However, Google has the Cloud and that Cloud can come out in creative ways through a couple more Developer Challenges. At the risk of being melodramatic, Android is the most important piece of software in human history. I really don't think it should be rushed. Everyone should be patient and that Patience will pay off. - Juan On Mar 29, 12:28 pm, Jean-Baptiste Queru [EMAIL PROTECTED] wrote: (Notice: I'm a Google Software Engineer working on Android). One aspect which I hope is reasonably clear in everybody's minds is that getting devices available is really at the top of the priority list for everyone involved in Android. That's important for the Android team and for the Open Handset Alliance and its members, that's important for Google. That's also important for the developer community and for the end users. From that point of view, every day that passes without devices out there hurts the entire Android ecosystem, and therefore has a high cost. Because of that, whenever anyone has to choose between doing something that directly helps ship those first devices and something that doesn't directly help, the latter option has to carry a very high value in order to outweigh for the cost of delaying the first devices. That's why the SDK isn't as polished as it could be, that's why Google employees aren't as present on those forums as they could be: it would distract from the primary goal of shipping devices in 2008. It might sound surprising to many, but Google only has a finite number of people who are currently familiar enough with Android to be able to make a significant difference on either the ship date or the SDK and the developer community. It takes time and it takes money to grow a team, Google has a significant amount of money but remains careful about how they spend it like any well-managed company, and they can't do anything about time: even by having people work hard, there's always a limit to how much work any single person can achieve every day. All that explains why you're not seeing dozens of engineers spending several hours every day answering questions and helping people on the forums, or preparing a new SDK every other week: at the end of the timeline toward the first devices, that would result in delays that would be counted in weeks or even months. Having to choose is painful, because we'd all like to get the best of both worlds. You can't have your (proverbial) cake and eat it too, and right now we're a bitstuck between a (proverbial) rock and a (proverbial) hard place. Back to the issue of the SDK, I think that you've put the finger on one of one of the aspects that are hard to balance: how early and how often should it be released. Too early, and developers get some software that is too unstable and too far from the final product to be valuable. Not early enough, and developers don't have time to get familiar with it, provide valuable feedback and have applications ready for the first device. Too often, and developers will spend too much time chasing porting their code from one release to another and the whole ecosystem will be confused about what works and what doesn't in every release. Not often enough, and some developers will bestuckfor weeks on bugs that may have been fixed but be unavailable. And, like I said earlier, early and often have a negative impact on the ship date. During the software development cycle of a framework, you're likely to see 3 phases: bringup, unstable, and stabilization. During the bringup phase, the software improves quickly, but it is too rough and too far from its final shape to be valuable to many people - this is a phase that typically sees frequent releases to a very small number of close partners. During the unstable phase, the framework is large enough and is used by enough applications that it can't change quite as quickly as during the bringup, but it is still getting some very significant changes. This is the phase during which the release strategy changes from frequent limited releases to infrequent broad releases. This is the phase that M3 and M5 came from (as an example, you've all seen how the UI had changed between M3 and M5). Finally, there's a stabilization phase, where the framework gets fewer and fewer changes and gets closer and
[android-developers] Re: Call out to the community about the poor quality of Android's error messaging
On Apr 5, 12:23 pm, acopernicus [EMAIL PROTECTED] wrote: Sadly the source isn't located at that page, but if someone has access to the source code, then please send me the link to it. ... but until then, we need to discover it ourselves by reading through the code. Anthony Here it is: *reading through the code.* LOL happy reading :D http://code.google.com/p/android/downloads/list --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Call out to the community about the poor quality of Android's error messaging
Thanks Anil. I was hoping to get the Java source code for classes like the MediaPlayer, LinearLayout, such. Much appreciate the pointer to the Emulator code though. Anthony --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Listview and List Selector(Urgent)
thanks Dan i have done it like this mText.setTextColor(new ColorStateList( new int[][] { new int[] { android.R.attr.state_selected}, new int[1], }, new int[] { Color.rgb(255, 255, 255), Color.BLACK, } )); but there is a problem i want to show a white background border on selecting a listview item ..how can i do this ?? On Apr 7, 11:36 am, Dan U. [EMAIL PROTECTED] wrote: For your first question, I think you can just create a layout with whatever views you need for a list item (perhaps just a single textview) and then add padding to that. Here's an example: ?xml version=1.0 encoding=utf-8? TextView xmlns:android=http://schemas.android.com/apk/res/android; android:id=@android:id/text android:layout_width=fill_parent android:layout_height=wrap_content android:paddingBottom=20sp /TextView Then just reference that as a the list item to use when you set the list adapter. As for the second question, there might be a way to do this with styles, but I don't know right now. You could programmatically do it by setting an OnItemClickListener for the list and then just make a setTextColor call on the TextView. Probably in your instance, the View that gets passed into onItemClick is the TextView. On Apr 6, 10:43 pm, Greg [EMAIL PROTECTED] wrote: Hello Android Champs 1 what i want is i want to give a margin or distance between the listview items Like A B A B 2 secondly i want to show the white textcolor on selection of an item of listview .. i have successfully changed the background color but unable to change the textcolor please help me out Waiting for your reply guys --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Change ListView Item height?
Hi, Can anyone show me how I would go about changing the height of the items in a ListView? Also is there a way to pad the actual text list? I want to put a background and make the text (and more importantly the divider ) not as wide as the background. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: TextView Question
Thanks for u r replay. I try this... Regards, Baskar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] View Activity Communicaton
I have been programming for android since January, and I must say, that I still don't get how the communication between Views and Activities is accomplished successfully. The whole design on this communication is fuzzy at least for me. NOTE: using M3 currenlty. Examples: Activities can have menus, creating when onCreateOptionsMenu( Menu menu ) is called Later we can get the menu selection by implementing onOptionsItemSelected( Menu.Item item ). So, inside and Activity, we have access to user actions/input in the form of a menu, and hence we can react to it, for example, by launching another activity (typical usage). This works, because we are in the context of the activity. NOTE: This is what I'm using now, so that I could keep on developing until I find a solution to my problem (next). Now if, you look at the View object, it's the only one to have user input handlers, like: onMotionEvent( MotionEvent event ) ( or onTouchEvent for M5), and onKeyDown( int keyCode, KeyEvent event ) ! An Activity doesn't have those ! So, how can we handle user input, and react accordingly ? If we call intent.startActivity() from within a View , we get an Application Error, with the following description: An error has occurred in process XXX calling startActivity() from outside of an Activity context requires the NEW_TASK_LAUNCH flag. is this really what you want ? The explanation, stating that a flag is required is fine ! But how am I to know the answer to the question ? (is this really what you want ?) http://code.google.com/android/reference/android/content/Intent.html#NEW_TASK_LAUNCH If I force the Flag, I will enter into further configuration problems or limitations, due to how we MUST setup the Activity launchMode (http://code.google.com/android/reference/android/ R.attr.html#launchMode) Which means, that I will have several simultaneous tasks for every menu option, which is not what was wanted. I can possibly set my lauchMode to singleTask, but is this really what I want ? I'm just trying to do a simple common thing, react to user input by launching a specific sub activity of the application, like in a menu kind of way. I know that there is the concept of subActivity in M5, that probably helps (not sure though), but this should be easy to do, even in M3 and apparently it's not ! Either I'm missing something, or I haven't still got it, how this is supposed to work. And having Documentation only for M5 stuff, doesn't help much either. Enlightnment on this subject and the View/Activity communcation/user input duality would be real nice. I needed this to work to finish my Contest entry! :( Or else I have to keep using the general Menu, instead of my game Menu, which doesn't quite cut it for a game application. NOTE: I'm trying NOT to break the rest of my app, by Porting the remaining stuff to M5. I have an early version that I had ported to M5, but I went back due to some stuff not working on M5, so not really an option. I also don't expect a new SDK Release now so close to the contest deadline, which could fix a lot of things, but could also bring a whole lot of new bugs too. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Extracting interface address of android emulator
Hi! How do I extract all the interface address attached to the emulator. The address which is being retrieved for now is the loopback address. My application logic requires the IP address to be retrieved, as it based on P2P communication. Any suggestions. Regards Nitin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Any generic logic for intent identification to be used by existing applications
Hi! Is there a way in android to extend the intent identification logic for existing applications. Say for example i type in the rss feed url or an http url in the phone application or something similar. So can I extend the identification logic such that the application executes a parser defined by my code, and then depending upon the identified intent fires the activity which handles the intent. Regards Nitin www.hsc.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: bitmap image changed. but why?
You are doing something really strange! First you setup a bitmao as your canvas bitmap = Bitmap.createBitmap(100, 100, true); Canvas canvas = new Canvas(bitmap); But later, you use your canvas ( which uses your bitmap as it's buffer) and you draw on it, using itself, i.e. you feedback the same bitmap canvas.drawBitmap(bitmap, 10, 10, null); This is shure to fail, since the copy behaviour is not defined how it should behave in case you are copying it to itself. Use different bitmaps, one for canvas, and another for whatever you are drawing. TIP: if you set thePixels(...) of your bitmap (buffer) you don't need to draw those same pixels after, since they are already there ! On 8 abr, 04:20, Gibson [EMAIL PROTECTED] wrote: hi all, I wrote following code. class MyView extends View { Bitmap bitmap; public MyView(Context context) { super(context); Drawable drawable = context.getResources().getDrawable(R.drawable.icon); bitmap = Bitmap.createBitmap(100, 100, true); Canvas canvas = new Canvas(bitmap); drawable.setBounds(0, 0, 100, 100); drawable.draw(canvas); } @Override protected void onDraw(Canvas canvas) { Paint paint = new Paint(); paint.setARGB(255, 255, 255, 255); canvas.drawRect(0, 0, screenWidth, screenHeight, paint); canvas.drawBitmap(bitmap, 10, 10, null); int[] imagedata = new int[100 * 100]; bitmap.getPixels(imagedata, 0, 100, 0, 0, 100, 100); bitmap.setPixels(imagedata, 0, 100, 0, 0, 100, 100); invalidate(); try { Thread.sleep(100); } catch (InterruptedException e) { } } int screenWidth, screenHeight; @Override protected void onSizeChanged(int i, int j, int k, int l) { screenWidth = i; screenHeight = j; super.onSizeChanged(i, j, k, l); } } These code just retrieve the pixel data and then put them back. But why i got different result on the screen. It seems like the retrieve method change some pixel? Can anybody help me with this please? Thanks. BR Gibson --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: View Activity Communicaton
Another Example: How do we call our activity finish method, from our activity view class ? Inside an Activity context, we can just call finish(); Inside a view, apparently we can't get a reference to the Activity that contains us (the view), and even if there is a way to get the reference, we can't probably call it directly, due to UI threading issues. So, do we send a message ? How ? How do we get the reference to the Handler defined inside our Activity, to be able to call myHandler.sendMessage(...) ? I think the UI handling code is complex and cumbersome to work with. I agree that probably should use messaging, since this helps to decouple the several application parts, but the current API, is not very helpful, in making the common message usage simple. Any help on this would be great too. Thanks On 8 abr, 06:22, Rui Martins [EMAIL PROTECTED] wrote: I have been programming for android since January, and I must say, that I still don't get how the communication between Views and Activities is accomplished successfully. The whole design on this communication is fuzzy at least for me. NOTE: using M3 currenlty. Examples: Activities can have menus, creating when onCreateOptionsMenu( Menu menu ) is called Later we can get the menu selection by implementing onOptionsItemSelected( Menu.Item item ). So, inside and Activity, we have access to user actions/input in the form of a menu, and hence we can react to it, for example, by launching another activity (typical usage). This works, because we are in the context of the activity. NOTE: This is what I'm using now, so that I could keep on developing until I find a solution to my problem (next). Now if, you look at the View object, it's the only one to have user input handlers, like: onMotionEvent( MotionEvent event ) ( or onTouchEvent for M5), and onKeyDown( int keyCode, KeyEvent event ) ! An Activity doesn't have those ! So, how can we handle user input, and react accordingly ? If we call intent.startActivity() from within a View , we get an Application Error, with the following description: An error has occurred in process XXX calling startActivity() from outside of an Activity context requires the NEW_TASK_LAUNCH flag. is this really what you want ? The explanation, stating that a flag is required is fine ! But how am I to know the answer to the question ? (is this really what you want ?) http://code.google.com/android/reference/android/content/Intent.html#... If I force the Flag, I will enter into further configuration problems or limitations, due to how we MUST setup the Activity launchMode (http://code.google.com/android/reference/android/ R.attr.html#launchMode) Which means, that I will have several simultaneous tasks for every menu option, which is not what was wanted. I can possibly set my lauchMode to singleTask, but is this really what I want ? I'm just trying to do a simple common thing, react to user input by launching a specific sub activity of the application, like in a menu kind of way. I know that there is the concept of subActivity in M5, that probably helps (not sure though), but this should be easy to do, even in M3 and apparently it's not ! Either I'm missing something, or I haven't still got it, how this is supposed to work. And having Documentation only for M5 stuff, doesn't help much either. Enlightnment on this subject and the View/Activity communcation/user input duality would be real nice. I needed this to work to finish my Contest entry! :( Or else I have to keep using the general Menu, instead of my game Menu, which doesn't quite cut it for a game application. NOTE: I'm trying NOT to break the rest of my app, by Porting the remaining stuff to M5. I have an early version that I had ported to M5, but I went back due to some stuff not working on M5, so not really an option. I also don't expect a new SDK Release now so close to the contest deadline, which could fix a lot of things, but could also bring a whole lot of new bugs too. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: TextView Question
sorry not work... my main class used Textview. IntentReceiver used to another class. i call some string in IntentReceiver to main class function with string .. Logcat print that string. But not update textview only display nullpointer exception.. Regards, Baskar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---