Re: [android-developers] Re: Question on showing contacts with all numbers
So i checked out the code, which I think you meant, but it seems to be using spinners. My goal is to reach the following in a listActivity, i.e present all the data as a 'flat' sctructure. Is there anyone that can help me out on this one? ContactName number number number ContactName number number ContactName number etc.. etc.. Jiri On 08/04/2010 15:20, nubh bhargava wrote: I think I have posted the whole source code in earlier topic, just check thanks NUBH -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe, reply using remove me as the subject.
[android-developers] Question on showing contacts with all numbers
Hello, I am struggling on how to display all the contacts and all their phonenumbers in one ListView. Because the persons and their phonenumbers are in two seperate dbase tables I need to do two queries. First one, is to get the user _ID the second one is lookup the phones tabel and based on that _ID get the numbers. Using a Cursor and a ListActivity with a single query is not that difficult, but what to do in this case where I need to do sub queries. I tried building my own datasctructure, but that is to slow and to expensive to do every time. How do I go about this. The end result would look like this, where each number is separately click-able. ContactName number number number ContactName number number ContactName number etc.. etc.. Thank you. Jiri -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe, reply using remove me as the subject.
Re: [android-developers] Re: Question on showing contacts with all numbers
Hello NUBH, did u mean this post ? http://groups.google.com/group/android-developers/browse_thread/thread/6844d4d5e7fe4f17/1354dd88444f6528?show_docid=1354dd88444f6528 Thank you, Jiri On 08/04/2010 15:20, nubh bhargava wrote: I think I have posted the whole source code in earlier topic, just check thanks NUBH -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe, reply using remove me as the subject.
Re: [android-developers] Send email in background
See this: http://groups.google.com/group/android-developers/browse_thread/thread/9c7bca0a1b6957a9 Jiri On 05/04/2010 15:58, Mark Murphy wrote: Is there and accepted way to send an email in the background? You would need to integrate your own email client library (e.g., JavaMail), as there is no way to send email in Android natively without user intervention. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe, reply using remove me as the subject.
[android-developers] Re: Help with contacts/numbers data to listView.
Is there someone who could help me out? Jiri On 02/04/2010 14:25, jiri wrote: Hello List, I am looking for a solution to a problem where I have to query all users and then for each user I query for her numbers. Offcourse I can build a strcuture first, but that has proven to be quit slow. Building a strcuture and then placing it in a listview seems like a detour. Now I would like to create a CustomCursor, where I want to implement my own moveToNext() mehtod. The implementation needs to identify if it is currently at a 'contactname' and if so, the next time it is called, it should create a sub cursor that can go through the 'contact' s phonenumbers. My question, can somebody point me to some resources where I can study how to do this, or some sample code. Advice is also welcome offcourse . The end result I am trying to achive is a ListActivity that show ContactNames as a non-clickable seperator and then all the numbers of that user. Like so: contact name number number contact name number Thank you, Jiri -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe, reply using remove me as the subject.
Re: [android-developers] Installing apps to Nexus One device
Settings/applications/development Did u choose usb debugging there? On 31 Mar 2010 08:47, oriharel ori.ha...@gmail.com wrote: Hi, Im running Win XP 32 bit, SP3. I have Nexus one device. and I develop on Eclipse. I'm trying to... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe, reply using remove me as the subject.
[android-developers] Question on Expandable list
Hello, is it possible to use an expandable listview but have it by default that all groups are not collapsed. I am looking for a way to create something like this. name contact _ home -xxx work xx-xxx-xx name contact home fax etc. Or is there an easier way to do this Regards, Jiri -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe, reply using remove me as the subject.
[android-developers] Help with contacts/numbers data to listView.
Does someone know how to get a 'flat' map / list of the contacts and there phone numbers. I am currently using this to build a datastructure, so I can display it in a lIstView, which is not really fast. The code shows that I do two queries. Would it be possible to do this with one query so that I end up with a just one cursor. The structure ideally would be: contact name number number contact name number This would then allow me with a custom listView Adapter to display the data and make the names non clickable. code public ListContactInfo getContacts(Context ctx) { // TODO Auto-generated method stub String[] projection = new String[] { Contacts.People._ID, Contacts.People.NAME, Contacts.People.NUMBER }; ContentResolver resolver = ctx.getContentResolver(); Cursor cur = resolver.query(Contacts.People.CONTENT_URI, null, null, null, Contacts.People.DEFAULT_SORT_ORDER); String name = start_name_identitiy; ArrayListContactInfo contacts = new ArrayListContactInfo(); if (cur.getCount() 0) { while (cur.moveToNext()) { ContactInfo info = new ContactInfo(); String id = cur.getString(cur.getColumnIndex(People._ID)); String dname = cur.getString(cur.getColumnIndex(People.DISPLAY_NAME)); info.name = dname; Cursor pCur = resolver.query(Contacts.Phones.CONTENT_URI, null, Contacts.Phones.PERSON_ID + = ?, new String[] { id }, null); int i = 0; int pCount = pCur.getCount(); String[] phoneNum = new String[pCount]; String[] phoneType = new String[pCount]; while (pCur.moveToNext()) { phoneNum[i] = pCur.getString(pCur.getColumnIndex(Contacts.Phones.NUMBER)); //phoneType[i] = pCur.getString(pCur.getColumnIndex(Contacts.Phones.TYPE)); if(phoneNum[i] != null) { // info.numbers.add( dname ); info.numbers.add( phoneNum[i] ); } i++; } if( info.numbers.size() 0 ) contacts.add(info); } } return contacts; } !code Thank you. Jiri -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe, reply using remove me as the subject.
[android-developers] Help with contacts/numbers data to listView.
Hello List, I am looking for a solution to a problem where I have to query all users and then for each user I query for her numbers. Offcourse I can build a strcuture first, but that has proven to be quit slow. Building a strcuture and then placing it in a listview seems like a detour. Now I would like to create a CustomCursor, where I want to implement my own moveToNext() mehtod. The implementation needs to identify if it is currently at a 'contactname' and if so, the next time it is called, it should create a sub cursor that can go through the 'contact' s phonenumbers. My question, can somebody point me to some resources where I can study how to do this, or some sample code. Advice is also welcome offcourse . The end result I am trying to achive is a ListActivity that show ContactNames as a non-clickable seperator and then all the numbers of that user. Like so: contact name number number contact name number Thank you, Jiri -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe, reply using remove me as the subject.
[android-developers] Getting contact phone numbers in a custom data layout.
Hello, i want to build a list view that shows all the contacts and their phone numbers. I have this working but I don't like the following. If a user has one contact that holds multiple phone number ( home, work etc) the cursor I receive will list every phone number with each duplicate name. I am aiming for a representation of the phone numbers like this: __ Name contact home:xxx-xx- work:xxx-xx-xxx etc.. _ Name contact home:xxx-xxx __ Name contact etc... What is the easiest/best/most efficient way to achieve this. I geuss I would have to make custom row layout for a the listview, and then keep in mind that there can be more labels. The big thing I am really not sure on how to do is, how to create the underlayin data structure. Does android already provide a way of getting the data layed-out for me as described? My code to get the contact is as follows: code Cursor contactsCursor = this.managedQuery( android.provider.Contacts.Phones.CONTENT_URI, null, null, null,null); this.setListAdapter(new MyContactsAdapter(this, contactsCursor)); /code MyContactsAdapter is simply used to fill the fields in my custom row layout xml Thank you for your help. Jiri -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
[android-developers] Getting contact phone numbers in a custom data layout.
Hello, i want to build a list view that shows all the contacts and their phone numbers. I have this working but I don't like the following. If a user has one contact that holds multiple phone number ( home, work etc) the cursor I receive will list every phone number with each duplicate name. I am aiming for a representation of the phone numbers like this: __ Name contact home:xxx-xx- work:xxx-xx-xxx etc.. _ Name contact home:xxx-xxx __ Name contact etc... What is the easiest/best/most efficient way to achieve this. I geuss I would have to make custom row layout for a the listview, and then keep in mind that there can be more labels. The big thing I am really not sure on how to do is, how to create the underlayin data structure. Does android already provide a way of getting the data layed-out for me as described? My code to get the contact is as follows: code Cursor contactsCursor = this.managedQuery( android.provider.Contacts.Phones.CONTENT_URI, null, null, null,null); this.setListAdapter(new MyContactsAdapter(this, contactsCursor)); /code MyContactsAdapter is simply used to fill the fields in my custom row layout xml Thank you for your help. Jiri -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
Re: [android-developers] 3D Physics Engine For Android Demo
Sorry to be off topic, but can somebody also point me to a 'decent' _2d_ physics engine. I seen a few, but i was wondering what the general consensus is about the 'most' reliable one in terms of steady/continues development. Cheers, Jiri On 15/03/2010 15:25, Kevin S. wrote: I've completed my first Android application. It as 3D demo with a physics engine. It uses the phone's accelerometer so that you can shake the world by moving the phone around. There are options to adjust things like gravity, friction, and elasticity. The physics engine is a 100% Java port of the open source JigLib physics engine. However, I only have a Motorola Droid, and I don't know if it will work on any other phone. The project is set to use Android 1.6. Before I put it in the market, I was hoping to get some feedback from the developer community here. If anybody is interested in 3D stuff or physics simulation, you can give the app a try. The link is on the follow page. There is a screen shot there so you can get an idea of what the app is. http://www.pieintheskysoftware.com/menuitem-resources-pie-3d-physics-1-0.html -Kevin -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Windows Phone and XNA. Nightmare is real. What we do with that ?
Does this framework support simple 2d physics and collision detection and/or elastic collision? Jiri On 10/03/2010 01:11, Mario Zechner wrote: While it's not nearly as full featured as XNA i started working on something similar to XNA. It allows you to develop your games mostly on the desktop and deploying it to your Android device with just a couple of lines that instantiate a special Activity subclass. It's based on OpenGL and allows developing 2D and 3D games. I just finished writting all the java doc for it and am constantly adding new features to it. It's called libgdx and can be found at http://code.google.com/p/libgdx/. I also started blogging about it lately and will continue so adding sample codes for specific problems. You can find that blog at http://www.badlogicgames.com. An introduction to it can be found at http://apistudios.com/hosted/marzec/badlogic/wordpress/?p=274. A series of small tutorials wil follow this week and next week. The whole thing is LGPL so that there's no problem including it in commercial apps. It's far from being perfect of course but i think the base functionality and ease of use can kill some of the burden a fresh android game developer has to overcome. I'm open for suggestions and features you want to see in there! On 9 Mrz., 22:35, Piotrpiotr.zag...@gmail.com wrote: Hello, At my daily job I work as WinMo C++ developer, so I had enough time to become hater of that platform ;) But now, M$ is coming with new Windows Phone. As I suspected, they will abandon awful Win32/MFC native coding and all applications, will be now managed - run in CLR sandboxes on top of 15 years old Win32 kernel. Main coding language will be C# with .NET framework - Java rival. WinMo always was terrible phone OS, but now, more interesting is, that Windows Phone will support XNA framework: http://www.youtube.com/watch?v=LQv_3fwopo8 This is full gaming framework with C# interfaces and support for 2D/3D graphics, animation, sprites, net play, game sound, controllers, etc.. XNA greatly improves creating games, because it gives a developer an ready to use game abstraction layer. To the point; Android needs game framework, like XNA. Maybe it should be written as NDK library, ready to link with your own application. This library could load, manage and draw sprites, backgrounds, make simple physics, etc.. Why ? To create games faster, easier. At this time, you must be very skilled to create simple platformer with 2 bkgs and 5 sprites. Our devices have even 1GHz CPU's and animation can be STILL too slow ! I'm tired of the same logical bricks/ball/falling diamonds games over and over. What do you think ? Is there any chance, that Google will work on something like that ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] HTC tester needed
Seems to work fine on a Nexus One. I added several words and they all show up as hints when writing an sms. JIri On 17/03/2010 22:06, Adrian Vintu wrote: Hi all, I ran into a problem and I need an HTC tester badly. I developed an app for managing the user dictionary on Android. The homepage is http://udm.adrianvintu.com Thing is, it works great, except for the HTCs. I think the HTC is not using the standard custom dictionary :( Tech: I am using the standard way to add custom words - UserDictionary.Words.addWord(context, word, frequency, app_id) I need an HTC owner to make a short test for me. Steps: 1. install UDM 2. go to Edit and add a test word like: TESTESTEST 3. go to SMS screen 4. start writing TESTE and see if the TESTESTEST comes up in the suggestion bar. 5. let me know if the word appears in the suggestion bar I will be very grateful to who can help me with this issue. Thank you, BR, Adrian Vintu http://adrianvintu.com PS you must not use any custom keyboard software, except the official on from HTC, of course. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Creating first game
This might be helpfull. http://www.anddev.org/2d_tutorial-t3120.html Jiri veel plezier. ;) On 08/03/2010 20:26, Marlo wrote: Greetings (i'm Dutch and only 14 so please don't not my English), I'm currently starting to develop a game for Android since my mobile phone runs Android but i do not know how to start. i want to make a game where you can draw blocks and circles wich you can move around and create a building out of them. could someone help me how to make that with eclipse? prethanks Marlo -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Gps sorting question
Ok, so if I use plain simple trigonometry there is some inaccuracy. I can live with that. Thank you Frank Frank Weiss wrote: It's that simple unless you want to account for latitude compression or obstacles. Latitude compression is usually negligible if the latitude bounds are small (0.2 degrees), otherwise use great circle computation, which involves more calculation. Most nearness calculations are done as the bird flies, but such calculations are not true if the path is limited to roadways or land, such as for cars, walking, or crossing rivers via bridges. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Gps sorting question
How does one calculate the sorting of gps data in an order of close - far. So when I have a list of geopoints, and I know my own location, how do I sort that data based on the closest by points. Can I consider each geo point data as x and y positions and then do some trigonometry on the points relative to my reference point, or is that to simple ? Jiri -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: How to set a default item in a spinner drop down list
Is this any help? http://thinkandroid.wordpress.com/2010/01/13/retrieving-spinner-values/?utm_source=feedburnerutm_medium=feedutm_campaign=Feed%3A+PlanetAndroidCom+%28Planet+Android%29 Jiri Sasikumar S wrote: See this link http://www.androidpeople.com/android-spinner-default-value/ you will get the answer. On Jan 26, 6:09 pm, MMC2 m...@mmc2.com.au wrote: How can I use code to set a default item in a spinner drop down 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Question on NotificationManager, setLatestEventInfo() and custom view.
Hello, I am creating a notification that displayes the progress of downloading files. Because I use a custom layout to be displyed in the expanded view. This custom view has a progressbar. I first make a call to the notification manager that will show the progress bar as being indeterminate and display a text 2 / 10 for instance. Then when the downloading starts i only want to update the prgress bar. code private void showNotification(String tickertxt, String displayTxt , int total , int progress , Boolean indeterminate) { NotificationManager notifMgr = (NotificationManager) this.getSystemService(Service.NOTIFICATION_SERVICE); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, MainMenu.class), 0); // construct the Notification object. Notification notif = new Notification(); notif.flags = Notification.FLAG_ONGOING_EVENT | Notification.FLAG_ONLY_ALERT_ONCE; notif.tickerText = tickertxt; notif.icon = R.drawable.icon; RemoteViews nmView = new RemoteViews( getPackageName(), R.layout.custom_notification_layout); nmView.setProgressBar(R.id.progressbar, total, progress, indeterminate); nmView.setTextViewText(R.id.TextView01, displayTxt); notif.contentView = nmView; notif.contentIntent = contentIntent; notifMgr.notify(R.layout.custom_notification_layout, notif); } /code So the first call i make when downloads are being prepared is: showNotification(download... , n / n files , 1 , 1 , false) then when downloading starts: showNotification(download... , n / n files , class.getCurrent() , class.getTotal() , true) What is bothering me is that I call the second call quit a lot and thus in the showNotification() a lot of objects are instantiated. In the docs it talks about setLatestEventInfo() but this (afaik) cannot be applied when using a custom view. Is this the way it is or is there a better technique. Jiri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] formatting text, before adding to textview
Hello list, If I have a string resource, for instance: Hello world and I want to have world be colored differently when i put it to a TextView. How do I do this? Jiri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: formatting text, before adding to textview
Thank you, so I would first have to set the string to the field and then retrieve it again using getText and then style it. That seems a bit of a way around. Well if thats how they made it, then thats how I will use it :) Or do I misunderstand it? Jiri skink wrote: On Oct 22, 4:57 pm, Jiri jiriheitla...@googlemail.com wrote: Hello list, If I have a string resource, for instance: Hello world and I want to have world be colored differently when i put it to a TextView. How do I do this? Jiri Jiri, use setSpan method pskink --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: formatting text, before adding to textview
Ok, i will look into that then. I allready thought it was a bit strange. Thanx a lot J nEx.Software wrote: You don't have to set the text first. There is nothing stopping you from creating a Spannable string and feeding that to setText(). I do the same thing using SpannableStringBuilder. On Oct 22, 10:27 am, Jiri jiriheitla...@googlemail.com wrote: Thank you, so I would first have to set the string to the field and then retrieve it again using getText and then style it. That seems a bit of a way around. Well if thats how they made it, then thats how I will use it :) Or do I misunderstand it? Jiri skink wrote: On Oct 22, 4:57 pm, Jiri jiriheitla...@googlemail.com wrote: Hello list, If I have a string resource, for instance: Hello world and I want to have world be colored differently when i put it to a TextView. How do I do this? Jiri Jiri, use setSpan method pskink --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] confused about service
If i have a service tag in my manifest, does that mean that the service class gets instantiated, and if so do I then still need to send an intent from an activity to have it started? Jiri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: GC question.
Thank you both, that was what I needed to know. J Mark Murphy wrote: Actually, the OP's example is final, not static. Final references cannot be pointed to null, as they cannot be modified. However, they are also not static, so they should be garbage collected once the containing object (an activity in this case) itself is garbage collected. Static references remains on memory until the process where your activity is running is destroyed. So, in order to avoid memory leaks, point the reference to null in onDestroy() Regards, Felipe Silveira On Thu, Sep 24, 2009 at 10:58 AM, Jiri jiriheitla...@googlemail.com wrote: I have a simple question, in my ctivity i define a static private as so: private final FileFetcher ff = new FileFetcher(); what happens when this activity is destroyed, is the reference to the FileFetcher completly gone, and can everything be marked for GC? Or would it better to write private FileFetcher ff; and the in my onCreate instantiate the FileFetcher and nullify it in the onDestroy method? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] GC question.
I have a simple question, in my ctivity i define a static private as so: private final FileFetcher ff = new FileFetcher(); what happens when this activity is destroyed, is the reference to the FileFetcher completly gone, and can everything be marked for GC? Or would it better to write private FileFetcher ff; and the in my onCreate instantiate the FileFetcher and nullify it in the onDestroy method? Jiri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Please, some layout help.
Hello list, i think i need some help with a layout issue. I have three views, two TextViews (header and footer) and in between a ListView. They are rendered good, in portait mode. When i go into landscape mode, the ViewList is gone. Switching back to portait mode and the ViewList is still goneHere is my xml. ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_width=fill_parent android:layout_height=wrap_content TextView android:id=@+id/header android:layout_width=fill_parent android:layout_height=wrap_content android:gravity=top android:text=HEADER / LinearLayout android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent android:layout_below=@+id/header android:layout_above=@+id/footer ListView android:id=@+id/ListView01 android:layout_width=wrap_content android:layout_height=fill_parent android:divider=@null android:fadingEdge=none /ListView /LinearLayout TextView android:id=@+id/footer android:layout_alignParentBottom=true android:layout_width=fill_parent android:layout_height=wrap_content android:text=FOOTER / /RelativeLayout Any ideas why this is happening? Thnx Jiri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] What happens when more activities 'listen' to the same intent?
Intents can start activity's, what happens if two or more activities listen to the same intent, i.e. the both have an intenfilter defined with the same android:name? How is the decisive process being performed? Jiri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Unable to start service intent
Should it be : service android:name=.MyService instead of service android:name=.service.MyService because the package @name allready includes the service Jiri Mark Murphy wrote: Honest wrote: hello, I tried to create service by following code but in logcat i got following error Unable to start service intent The following is my manifest.xml file. ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.saltriver.service android:versionCode=1 android:versionName=1.0 application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.ServiceExample android:label=@string/app_name intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity /application service android:name=.service.MyService intent-filter /intent-filter /service uses-sdk android:minSdkVersion=3 / uses-permission android:name=android.permission.READ_FRAME_BUFFER/ uses-permission /manifest Is your service named com.saltriver.service.service.MyService? You might try spelling out the full java package on your service element to see if it clears up your problem. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to style part of TextView
I thought that it would be easier to style the first text field tfield 1 = John says: tfield 2 = this is what he says but come to think of it, one field would indeed be easier and probably sufficient. Jiri skink wrote: On Aug 17, 9:18 pm, Jiri jiriheitla...@googlemail.com wrote: I am quit new to Android, but as far as I know you could make a custom view. Take a linearLayout and add two textfields. Something like this. LinearLayout where orientation is horizontal. |--| | TextView | TextView | |__| Create a custom adapater that extends BaseAdapter and override the getView method where this method then returns your custom view and populates the fields. Set this adapter to be your ListView adapter in the activity. ListView sounds ok here but why custom view with two TextViews? you can use simple TextView as your ListView rows pskink --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How To Keep ListView Header From Scrolling With ListView Content
I think you can create a layout, listview_layout.xml LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=fill_parent android:paddingLeft=10dip android:paddingRight=10dip android:paddingTop=100dip android:orientation=vertical android:gravity=center_horizontal !-- this will be the header then -- TextView / ListView android:id=@id/android:list android:layout_width=fill_parent android:layout_height=fill_parent android:background=#22 android:layout_weight=1 android:drawSelectorOnTop=false/ /LinearLayout in the onCreate you will have to set: this.setContentView(R.layout.listview_layout); This is how I would do it, but i am really a newby, so if anyone has a better suggestion, lets hope they speak up :) Jiri chinchin wrote: Hello Guys, I've written the following but I cannot figure out how to add the non scrolling header Item. If I only extent an Activity then I cannot override the onListItemClick method. This is why I have written it to use the ListActivity class. Any help would be greatly appreciated, here is my code so far: public class HelloListAdapter extends ListActivity { private ListView lv; private TextView tv; private ListAdapter la; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); tv = new TextView(this); tv.setText(Hello Text, Top of List); lv = (ListView) getListView(); lv.addHeaderView(tv); la = (ListAdapter) new ArrayAdapterString(this, android.R.layout.simple_list_item_1, COUNTRIES); lv.setAdapter(la); } static final String[] COUNTRIES = new String[] { Afghanistan, Albania, Algeria, American Samoa, Andorra, Angola, Anguilla, Antarctica, Antigua and Barbuda, Argentina }; } On Jul 31, 1:49 pm, Atif atif.gul...@gmail.com wrote: I have similar issue with TableLayout. There must be some mechanism to define non scrolling header row. If I took out my header row from ScrollView+TableLayout and define it in new layout than the columns are not aligned. Regards, Atif On Jun 26, 3:35 am, Mike michaeldouglaskra...@gmail.com wrote: I use the same view for my rows as I do my table header, so in order for them to size correctly (make sure the columns in the header line up with the column in the rows), they have to be within the same container to have the same width, correct? That's all I meant by needing to be in the same ViewGroup. - Mike On Jun 25, 9:54 am, Marco Nelissen marc...@android.com wrote: On Thu, Jun 25, 2009 at 8:46 AM, Mike michaeldouglaskra...@gmail.comwrote: Thanks guys. This does work provided the ListView and the header View are within the same parent ViewGroup. Can you give an example of when they would not be? I would, however, like to request that the ListView be enhanced with two new methods: voidaddHeaderView(View v, Object data, boolean isSelectable, boolean scrollsWithContent) void addFooterView(View v, Object data, boolean isSelectable, boolean scrollsWithContent) This would allow a dev to leave management of the headers and footers entirely with the ListView and provide the ability to have sticky headers and footers that are owned by the ListView. What's the advantage of this over putting your headerview above the ListView in a LinearLayout? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Determining Who Passed an Intent to You
COuld you maybe use intent.getComponent() and then use the packageManager its getReceiverInfo(componentName); http://developer.android.com/reference/android/content/pm/PackageManager.html#getReceiverInfo(android.content.ComponentName,%20int) Not sure if this is what you need, or if it is the best solution. Jiri Jonathan Herriott wrote: I was wondering if there is a way to determine who passed an intent to my application. For example, I have a service, that I want to act differently depending on who passed the intent (for security reasons). I'm trying to sandbox each calling application, so they only have access to their data stored in my application. For it to be secure, I cannot trust any application to be truthful about the identifying data it is passing into my service. Therefore, I need some system way of identifying who sent the intent in a way that the calling application cannot change that information. I don't know if it is possible, but I can't find anything in the Intent class, and I was wondering if there may be another structure which does what I want it to. If it is not possible, I would like to get some type of mechanism to do this in the roadmap. Thanks, Jonathan Herriott --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to style part of TextView
I am quit new to Android, but as far as I know you could make a custom view. Take a linearLayout and add two textfields. Something like this. LinearLayout where orientation is horizontal. |--| | TextView | TextView | |__| Create a custom adapater that extends BaseAdapter and override the getView method where this method then returns your custom view and populates the fields. Set this adapter to be your ListView adapter in the activity. Have a look here: http://developerlife.com/tutorials/?p=327 Jiri fhucho wrote: Hi, I want to include a chat feature into my application. But I don't know what widget should I use for the chat - now I use TextView but I have two problems: 1) In the TextView there will be lines like John: Hi, how're you doing?. I want the text John to have blue color, how can I do that? 2) When a new message arrives I want the chat to scroll automatically. What do you think is the simplest way to implement chat according to my requirenments? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Question on Seekbar - clipping of thumb
I am using a SeekBar which has a android:thumb set. It works fine,but the thumb gets clipped on the left and right side, by the canvas clip bounds. Is there some way to avoid this. Jiri GPU wrote: Hi , Can anyone tell ,what are the steps to add a new attribute for ViewGroup I added a attr in framework/core/res/value/attr.xml under declare-styleable name=ViewGroup but its not reflecting in R.java after building. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Simply touching screen reduces fps
Could someone please post a snippet on how to do this? Jiri Dianne Hackborn wrote: And the solution is NOT to increase your thread priority so you can better fight with the system. You will get better results by putting in the sleep so you aren't fighting. On Thu, Aug 13, 2009 at 3:32 PM, Justin (Google Employee) j...@google.com mailto:j...@google.com wrote: The recommendation for this is to sleep in the touch event handler. The system will send you touch events as fast as you can process them. If you artificially decrease this by sleeping in the handler, you will allow more processing time for other threads which are theoretically running your computations for screen updates. Cheers, Justin Android Team @ Google On Aug 10, 9:38 am, sahn0 dmitry.sk...@gmail.com mailto:dmitry.sk...@gmail.com wrote: Yes, it is. Try SpriteMethodTest, set 100 sprites, select OpenGL / Use VBO, let it run for a while. You will get something around 20ms / 50 fps. Now run it second time, and simply touch screen while test is running. You will get something around 35ms / 29 fps. So it is 15 ms difference. As I understand, the answer is simple - it is that dispatcher thread running with THREAD_PRIORITY_URGENT_DISPLAY priority. Setting THREAD_PRIORITY_URGENT_DISPLAY priority (will it work on non- ADP firmware?) on renderer thread yields 30 ms / 33 fps. Are there any other workarounds? -- Dianne Hackborn Android framework engineer hack...@android.com mailto:hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: ListView if I don't wan use xml, but programatic... how??
Maybe this pdf will provide some insights. http://commonsware.com/Android/excerpt.pdf Jiri Wesley Sagittarius wrote: hi all, can any one show me a simple example how can I create ListView using code, not xml... and add item into list and remove item in the list anyway I wan??? wesley. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Good practise
Thnx Kaj, well it is not really an app. I am exploring Android and Java, coming from an AS3 backgound. I havent even begun to look inot threads. But to answer your question. The app is just drawing dots to the canvas and one button is moving them all x+=1. I wanted to find out how to deal with this in Android. 1. use an intent that all the newly created dots are listenening to. 2. use a model and register this to listen to an intent. When it responds, it goes through the dots and updates them. Jiri Kaj Bjurman wrote: You haven't told us how many dots that you have, but I do think it sounds like an odd design. What kind of application is it? How often are they moved? How many dots do you have? What do they represent? I might of course be wrong here, but this sounds a bit like a common problem that I often see in people who are starting with game programming and is using e.g. one thread per bullet or what ever they have that is moving. On 11 Aug, 20:10, Jiri jiriheitla...@googlemail.com wrote: Thanx Yusuf, your advice is right, i should optimise later. I have to admit i am just started exploring Java and the android API, so hence the sloppyness. The main point is, that being so new, i have to post these kind of questions to take away some insecurity on choices i make. If I understand your point correctly, it is not bad practice what i did. I just need to optimize... Using a dotmanager, isnt it more expensive to go through all the dots an update them. I can imagine by using the architecture as is and not implement another structure, this would be faster. Any ideas on that? Jiri Yusuf T. Mobile wrote: Code first for simplicity then optimize if/as needed. That being said (well, more like pontificated, sorry), a simpler design would be to aggregate all your dots into a DotManager. This would listen and draw all the dots as needed. Aggregation works if all the dots are similar enough that their code can be centralized, and if I understand your problem correctly (all dots listen for the same event and then they all move), my brilliant and royalty-free design would be appropriate. Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 11, 9:13 am, jiriheitla...@googlemail.com jiriheitla...@googlemail.com wrote: I was wondering if the following is considered good practice. I am creating mulitple Dot instance. A Dot instance is a value object containing x,y, color, diameter fields. I draw each created Dot to a view: code canvas.drawCircle( dot.getX(),dot.getY(),dot.getDiameter (),paint); /code Now i want all the Dots to listen to a certain event, lets say that i want to click a button and move all the Dots. What i do is in the Dot constructor i add this code: code IntentFilter intentFilter = new IntentFilter (org.dadata.demo.SEND_TO_REACTOR); Appcontext.registerReceiver(this, intentFilter); ... @Override public void onReceive(Context context, Intent intent) { this.x += 5; } /code Then from my button i send the intent : code intent.setAction(org.dadata.demo.SEND_TO_REACTOR); getApplicationContext().sendBroadcast(intent); View.invalidate(); /code I am wondering if someone could give me some feedback on this. Is it expensive for instance, and are there better ways to achive the same. Thank you, Jiri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: canvas.save() / restore() , what is this?
Thanks Jeff, not sure if i understand it correctly. I come from an AS3 background and tf matrixes i understand. So if i would scale the canvas via a matrix and then draw stuff on it, this stuff is then scaled when drawn. if i then after the scaling do a restore() all is 100% scaled again? Or is that the matrix is resetted but the drawn stuff remains how it was before calling the restore()? jiri Jeff Sharkey wrote: Think of it as checkpointing the transformation matrix and clip rectangle of your Canvas at a known place in time. This is useful when rendering children views that may leave them in an unknown state. (You can restore back to the checkpointed state when children are done drawing.) Here's an example from ViewGroup: final int restoreTo = canvas.save(); [perform some drawing that might change the transformation matrix or clip rectangle] canvas.restoreToCount(restoreTo); j On Thu, Aug 13, 2009 at 3:04 AM, Jirijiriheitla...@googlemail.com wrote: Could someone explain to me the canvas.save() and restore(). I come from a flash background, and this is a new concept for me. Reading the documentation is not helpfull. Jiri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Simply touching screen reduces fps
I see, thanks a lot. Jiri Streets Of Boston wrote: E.g. when you handle the ACTION_MOVE in your touch-handler, just do a Thread.sleep(20) before your method returns. If you don't have a touch-handler in your app, just register one and only do the Thread.sleep(20) when handling the ACTION_MOVE. On Aug 14, 3:32 am, Jiri jiriheitla...@googlemail.com wrote: Could someone please post a snippet on how to do this? Jiri Dianne Hackborn wrote: And the solution is NOT to increase your thread priority so you can better fight with the system. You will get better results by putting in the sleep so you aren't fighting. On Thu, Aug 13, 2009 at 3:32 PM, Justin (Google Employee) j...@google.com mailto:j...@google.com wrote: The recommendation for this is to sleep in the touch event handler. The system will send you touch events as fast as you can process them. If you artificially decrease this by sleeping in the handler, you will allow more processing time for other threads which are theoretically running your computations for screen updates. Cheers, Justin Android Team @ Google On Aug 10, 9:38 am, sahn0 dmitry.sk...@gmail.com mailto:dmitry.sk...@gmail.com wrote: Yes, it is. Try SpriteMethodTest, set 100 sprites, select OpenGL / Use VBO, let it run for a while. You will get something around 20ms / 50 fps. Now run it second time, and simply touch screen while test is running. You will get something around 35ms / 29 fps. So it is 15 ms difference. As I understand, the answer is simple - it is that dispatcher thread running with THREAD_PRIORITY_URGENT_DISPLAY priority. Setting THREAD_PRIORITY_URGENT_DISPLAY priority (will it work on non- ADP firmware?) on renderer thread yields 30 ms / 33 fps. Are there any other workarounds? -- Dianne Hackborn Android framework engineer hack...@android.com mailto:hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them.- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: canvas.save() / restore() , what is this?
Ok, i see I think coming from flash I think to much in timelines and frames. In Java there is offcourse no such thing, so i understand ( i think ) why one needs to sometimes revert back to previous canvas state. Thnx for clearing that up. Jiri Streets Of Boston wrote: Before you call save() on the canvas, your canvas is in a certain state (clip region/transformation matrix/etc). Then you call save() and all this info is saved away somewhere. Then other code (e.g. paints of child-views) can modify this canvas anyway they like. Then when control is returned back to your code, just call restore (level) on the canvas to get your old saved state back. // do some drawing/clipping/scaling/etc on my canvas ... ... int level = canvas.save(); letSomeOtherCodeDoSomeDrawing(canvas); // after this, the canvas could be in any (unknown) state // restore to my known state, as it was just before // calling letSomeOtherCodeDoSomeDrawing canvas.restoreToCount(level); // do some more drawing/clipping/scaling etc on the canvas ... On Aug 14, 10:55 am, Jiri jiriheitla...@googlemail.com wrote: Thanks Jeff, not sure if i understand it correctly. I come from an AS3 background and tf matrixes i understand. So if i would scale the canvas via a matrix and then draw stuff on it, this stuff is then scaled when drawn. if i then after the scaling do a restore() all is 100% scaled again? Or is that the matrix is resetted but the drawn stuff remains how it was before calling the restore()? jiri Jeff Sharkey wrote: Think of it as checkpointing the transformation matrix and clip rectangle of your Canvas at a known place in time. This is useful when rendering children views that may leave them in an unknown state. (You can restore back to the checkpointed state when children are done drawing.) Here's an example from ViewGroup: final int restoreTo = canvas.save(); [perform some drawing that might change the transformation matrix or clip rectangle] canvas.restoreToCount(restoreTo); j On Thu, Aug 13, 2009 at 3:04 AM, Jirijiriheitla...@googlemail.com wrote: Could someone explain to me the canvas.save() and restore(). I come from a flash background, and this is a new concept for me. Reading the documentation is not helpfull. Jiri- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Scope issue - newby question
you are right. Cheers! Jiri Mark Murphy wrote: Jiri wrote: I think it is a scoping issue, but I cant seem to find how to solve it. I would appreciate some help. public class SliderTest extends Activity { private HorizontalSlider slider; public TextView pView; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); slider = (HorizontalSlider) this.findViewById(R.id.slider); pView = (TextView) findViewById(R.id.label); slider.setOnChangeListener( new OnProgressChangeListener() { public void onProgressChanged(View v, int progress) { /// CRASHES HERE , it seems pView is not know here!! /// tried this SliderTest.this.pView String myString = Integer.toString(progress); pView.setText( myString ); } }); } } If it compiles, you do not have a scope problem. More likely, pView is null. You can determine this by checking the Java stack trace, available from adb logcat, DDMS, or the DDMS perspective in Eclipse. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: receiver enabled=false , problems after instantiation to set to listen
If you don't want android instantiating a component, there is no reason to declare it in a manifest. Thank you for the clear answer. And yes it should have been ComponentName(org.dadata.demo,.model.Dots); Jiri Dianne Hackborn wrote: If you don't want android instantiating a component, there is no reason to declare it in a manifest. If you just want to listen for broadcasts while other code of yours is running, just write your class deriving from BroadcastReceiver, and instantiate it and hand that instance to Context.registerReceiver(). On Wed, Aug 12, 2009 at 3:08 AM, Jiri jiriheitla...@googlemail.com mailto:jiriheitla...@googlemail.com wrote: Hello List, in my manifest I set an custom object Dots that extends a BroadcastReceiver to receive a certain broadcast string. receiver android:name=.model.Dots android:enabled=false intent-filter action android:name=org.dadata.demo.receiverTest / /intent-filter /receiver I dont want Android to instantiate the object for me hence the enable=false. In the Activity a new Dots is created Dots dots = new Dots() How do i now make the Dots start listening to the broadcasting. I tried this, but it doesnt work and it also feels much to complicated.. ComponentName cName = new ComponentName(org.dadata.demo,org.dadata.demo.Dots); PackageManager pm = this.getPackageManager(); pm.setComponentEnabledSetting(cName , PackageManager.COMPONENT_ENABLED_STATE_ENABLED , PackageManager.DONT_KILL_APP); Is there a workable easy way to do this? Thank you, Jiri -- Dianne Hackborn Android framework engineer hack...@android.com mailto:hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: receiver enabled=false , problems after instantiation to set to listen
One more question. In my Activity.onDraw method I have this: Dots dotModel = new Dots(); IntentFilter iFilter = new IntentFilter(); iFilter.addAction(org.dadata.demo.ON_UPDATE); this.registerReceiver(dotModel, iFilter); Then later in a click handler I wrote this: Intent intent = new Intent(); intent.setAction(org.dadata.demo.ON_UPDATE); getApplicationContext().sendBroadcast(intent); Is there some way to externalise the now hardcoded string: org.dadata.demo.ON_UPDATE so i can access it from anywhere and reducing the risk of typed errors? Jiri Dianne Hackborn wrote: If you don't want android instantiating a component, there is no reason to declare it in a manifest. If you just want to listen for broadcasts while other code of yours is running, just write your class deriving from BroadcastReceiver, and instantiate it and hand that instance to Context.registerReceiver(). On Wed, Aug 12, 2009 at 3:08 AM, Jiri jiriheitla...@googlemail.com mailto:jiriheitla...@googlemail.com wrote: Hello List, in my manifest I set an custom object Dots that extends a BroadcastReceiver to receive a certain broadcast string. receiver android:name=.model.Dots android:enabled=false intent-filter action android:name=org.dadata.demo.receiverTest / /intent-filter /receiver I dont want Android to instantiate the object for me hence the enable=false. In the Activity a new Dots is created Dots dots = new Dots() How do i now make the Dots start listening to the broadcasting. I tried this, but it doesnt work and it also feels much to complicated.. ComponentName cName = new ComponentName(org.dadata.demo,org.dadata.demo.Dots); PackageManager pm = this.getPackageManager(); pm.setComponentEnabledSetting(cName , PackageManager.COMPONENT_ENABLED_STATE_ENABLED , PackageManager.DONT_KILL_APP); Is there a workable easy way to do this? Thank you, Jiri -- Dianne Hackborn Android framework engineer hack...@android.com mailto:hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] canvas.save() / restore() , what is this?
Could someone explain to me the canvas.save() and restore(). I come from a flash background, and this is a new concept for me. Reading the documentation is not helpfull. Jiri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: button press on custom drawable
Maybe this will help you: http://www.anddev.org/tinytutcustom_button_backgrounds-better_imagebutton-t4298.html regards, Jiri Atif wrote: The default button turns yellow|orange when it is pressed. I just replaced the background through Drawable given below. But now it stop changing the color on press. Sure I have to provide another drawable (lets call it pressedButton) for that. But how and on which even I should apply this pressedButton Drawable. Thanks ?xml version=1.0 encoding=utf-8? shape xmlns:android=http://schemas.android.com/apk/res/android; android:shape=rectangle gradient android:startColor=#FF505050 android:centerColor=# android:endColor=#FF505050 / padding android:left=5dp android:top=5dp android:right=5dp android:bottom=5dp / /shape -- Best Regards, Atif Gulzar I Unicode, ɹɐzlnƃ ɟıʇɐ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: button press on custom drawable
Cool, let me know if u run into problems. Jiri Atif Gulzar wrote: Thanks Jiri, That is exactly what I was looking for. Thanks again. -- Best Regards, Atif Gulzar I ◘◘◘◘ Unicode, É¹É zlnƃ ÉŸÄ±Ê‡É On Wed, Aug 12, 2009 at 12:52 PM, Jiri jiriheitla...@googlemail.com mailto:jiriheitla...@googlemail.com wrote: Maybe this will help you: http://www.anddev.org/tinytutcustom_button_backgrounds-better_imagebutton-t4298.html regards, Jiri Atif wrote: The default button turns yellow|orange when it is pressed. I just replaced the background through Drawable given below. But now it stop changing the color on press. Sure I have to provide another drawable (lets call it pressedButton) for that. But how and on which even I should apply this pressedButton Drawable. Thanks ?xml version=1.0 encoding=utf-8? shape xmlns:android=http://schemas.android.com/apk/res/android;    android:shape=rectangle    gradient android:startColor=#FF505050 android:centerColor=#        android:endColor=#FF505050 /    padding android:left=5dp android:top=5dp android:right=5dp        android:bottom=5dp / /shape -- Best Regards, Atif Gulzar I ◘◘◘◘ Unicode, É¹É zlnƃ ÉŸÄ±Ê‡É --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] receiver enabled=false , problems after instantiation to set to listen
Hello List, in my manifest I set an custom object Dots that extends a BroadcastReceiver to receive a certain broadcast string. receiver android:name=.model.Dots android:enabled=false intent-filter action android:name=org.dadata.demo.receiverTest / /intent-filter /receiver I dont want Android to instantiate the object for me hence the enable=false. In the Activity a new Dots is created Dots dots = new Dots() How do i now make the Dots start listening to the broadcasting. I tried this, but it doesnt work and it also feels much to complicated.. ComponentName cName = new ComponentName(org.dadata.demo,org.dadata.demo.Dots); PackageManager pm = this.getPackageManager(); pm.setComponentEnabledSetting(cName , PackageManager.COMPONENT_ENABLED_STATE_ENABLED , PackageManager.DONT_KILL_APP); Is there a workable easy way to do this? Thank you, Jiri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Good practise
Thanx Yusuf, your advice is right, i should optimise later. I have to admit i am just started exploring Java and the android API, so hence the sloppyness. The main point is, that being so new, i have to post these kind of questions to take away some insecurity on choices i make. If I understand your point correctly, it is not bad practice what i did. I just need to optimize... Using a dotmanager, isnt it more expensive to go through all the dots an update them. I can imagine by using the architecture as is and not implement another structure, this would be faster. Any ideas on that? Jiri Yusuf T. Mobile wrote: Code first for simplicity then optimize if/as needed. That being said (well, more like pontificated, sorry), a simpler design would be to aggregate all your dots into a DotManager. This would listen and draw all the dots as needed. Aggregation works if all the dots are similar enough that their code can be centralized, and if I understand your problem correctly (all dots listen for the same event and then they all move), my brilliant and royalty-free design would be appropriate. Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 11, 9:13 am, jiriheitla...@googlemail.com jiriheitla...@googlemail.com wrote: I was wondering if the following is considered good practice. I am creating mulitple Dot instance. A Dot instance is a value object containing x,y, color, diameter fields. I draw each created Dot to a view: code canvas.drawCircle( dot.getX(),dot.getY(),dot.getDiameter (),paint); /code Now i want all the Dots to listen to a certain event, lets say that i want to click a button and move all the Dots. What i do is in the Dot constructor i add this code: code IntentFilter intentFilter = new IntentFilter (org.dadata.demo.SEND_TO_REACTOR); Appcontext.registerReceiver(this, intentFilter); ... @Override public void onReceive(Context context, Intent intent) { this.x += 5; } /code Then from my button i send the intent : code intent.setAction(org.dadata.demo.SEND_TO_REACTOR); getApplicationContext().sendBroadcast(intent); View.invalidate(); /code I am wondering if someone could give me some feedback on this. Is it expensive for instance, and are there better ways to achive the same. Thank you, Jiri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: no classfiles specified and Conversion to Dalvik format failed with error 1
Check this: http://www.anddev.org/viewtopic.php?p=22705 You have to simply reload the project in Eclipse. Click on the project in the Package explorer on the left and press F5(reload) On 15 čvn, 02:12, xerberus bastian.seiff...@gmail.com wrote: Hi Guys, I have a working(Released) project that needs some updating. The Project was created with SDK 1.1 on Windows and Ecplise 3.4. A couple months ago i moved away from Windows to Mac and installed all tools on the mac including Android SDK 1.1. Everything was working fine at that time. I never bothered compiling the project against SDK 1.5 as the program was running fine on a 1.5 Device. But now i need to do some changes and installed SDK 1.5, following the installation guideline (http://developer.android.com/sdk/1.5_r1/ upgrading.html#UpdateYourProjects). So I build my project against SDK 1.1 (as suggested) and failed with the following error messages : - no classfiles specified - Conversion to Dalvik format failed with error 1 I receive the same error if I compile with SDK 1.5 (clean + build). First i thought there is something wrong with my code but could not find anything. After that I tried the example JetBoy and received the same error. Using Fix Project Properties was without effect for booth projects. I am kind of clueless right know and happy for any suggestion --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Widget opening a dialog instead of the browser...
Hello, I'm trying to create my first widget for Android according to the SimpleWiktionary example. In this example is shown how to open a web browser after tapping on the widget. Can somebody explain me how to open and other activity then the browser, for example a Dialog? Best regards, Jiri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Widget design in Gimp
I have been facing the same problem. First I wanted to create my own widget background but then I have downloaded one of the examples of the background from this site (http://developer.android.com/guide/ practices/ui_guidelines/widget_design.html). Then I have used the draw9patch utility (part of the Android SDK - http://developer.android.com/guide/developing/tools/draw9patch.html) to allow stretch the picture in any different size with correct proportion. Using this utility you don't have to have precise size of the background image because it will be resized as required. This way, I have got the same look and feel of the widget background what original Google widgets have. Cheers, Jiri On May 11, 3:31 pm, Jose de Paula Eufrasio Junior jose.jun...@gmail.com wrote: So, I was reading this thread:http://groups.google.com/group/android-discuss/browse_thread/thread/7... Does anyone here use Gimp to adjust the widget sizes and shadow? Or I am really limited to Photoshop? -- José de Paula Eufrásio Júnior (coredump) MCSO, GRC Professionalhttp://core.eti.br --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How to refresh ListView?
Hello, I'm facing to one problem with ListView. I would like to refresh the ListView every time I change the base data. Please see the following example: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapterObject(this, android.R.layout.simple_list_item_1, mStrings)); new Timer().scheduleAtFixedRate(new TimerTask() { public void run() { Log.d(TAG, running timer: num= + num); mStrings[0] = Unpdate + num; num++; /** refresh the ListView - HOW??? **/ //TestList.this.getListView().invalidateViews(); //TestList.this.getListView().refreshDrawableState(); // what else??? } }, 5000, 2000); } Can somebody give me a hint how to implement this feature? Best regards, Jiri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Shipping a European dev phone to the US?
I'm interested in buying the Android Dev Phone 1, which I'd mainly use in Finland and elsewhere in Europe. This means that I'd need to get the version that uses the Finnish GSM and UMTS band, and of course comes with a 230V charger. I'll be visiting the US over the holidays, so it'd be very convenient (read: probably faster and cheaper) for me to get the phone shipped to a friend's place and pick it up from there. So my question is, is it possible to get the European version of the phone shipped to an US address? Thanks, -Jiri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---