[android-developers] Re: Convert from Byte array to Pdf format
You better use this : File dir = Environment.getExternalStorageDirectory(); String filename = test.pdf; File f = new File(dir, filename); f.createNewFile(); OutputStream outStream = new FileOutputStream(f); ... outStream.close(); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] ExpandableListView advice
Thanks for the feedback. I have done more research and optimized the code so that scrolling is lot smoother. On Friday, June 8, 2012 3:27:06 AM UTC+10, TreKing wrote: as soon as I receive an item, I have to immediately add it, sort it and display it. Use a collection data structure that maintains sorting and is optimized for inserting new elements. Adding an item to an ArrayList and then sorting *each time* is asking for slowness. So how can I properly implement the 'getGroupView' function so that it has the correct convertView of my item at any given time? Updating the convertView is what you're supposed to be doing, as it can and will contain data from rows that no longer visible and thus eligible for recycling. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] ExpandableListView advice
The same thing I have expanding list view my doubt I solved. Regards Jagadeesh Sent from my HTC - Reply message - From: Ash anan...@gmail.com To: android-developers@googlegroups.com Subject: [android-developers] ExpandableListView advice Date: Fri, Jun 8, 2012 11:51 am Thanks for the feedback. I have done more research and optimized the code so that scrolling is lot smoother. On Friday, June 8, 2012 3:27:06 AM UTC+10, TreKing wrote: as soon as I receive an item, I have to immediately add it, sort it and display it. Use a collection data structure that maintains sorting and is optimized for inserting new elements. Adding an item to an ArrayList and then sorting *each time* is asking for slowness. So how can I properly implement the 'getGroupView' function so that it has the correct convertView of my item at any given time? Updating the convertView is what you're supposed to be doing, as it can and will contain data from rows that no longer visible and thus eligible for recycling. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] How to resize width fragment
Hi everyone! I have layout same as: LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=fill_parent android:background=@color/WHITE android:orientation=horizontal fragment android:id=@+id/fragMenu android:layout_width=200dp android:layout_height=match_parent android:background=@color/GREY class=com.viettel.vinamilk.view.main.ListFrag / FrameLayout android:id=@+id/fragDetail android:layout_width=0px android:layout_height=match_parent android:layout_weight=1/ /LinearLayout I would like to resize fragment (id = fragMenu) when runing app. Who can help me! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Can't copy and paste Eclipse(Helios) to Windows
Some applications, like Skype click-to-call, interferes with the normal copy-paste in Eclipse. If you have this installed, or other recent installed apps, try to uninstall them. I've got a partner that recently had the same problem and solved it this way. On Thu, Jun 7, 2012 at 11:14 AM, David Olsson zooklu...@gmail.com wrote: Copy the directory and not the project? Should be in your workspace, check the properties for where the projects are. On a second note, what are you trying to do? Also, please don't spam the list for something it is not meant to be used for. On Thu, Jun 7, 2012 at 10:03 AM, Live Happy livehap...@gmail.com wrote: Cannot copy and paste directories from Eclipse(Helios) to Windows.also cannot do drag and drop how i can solve this 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 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] best practice in extending classes
when i extend internal classes or core classes like View.OnClickListener or ArrayAdapter - do i have to manually take care of all objects inside to prevent memory leaks? like in overriding the onStop() or onDestroy() methods and setting objects to null? thx -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] sync adapter contact appear in visible group
my application add contact by sync contact adapter to the phone and the contact are in invisible group didn't appear in the phone list but when i made selction to the phone contact who are in visible group the contact of my application appear in the selection even they are not in the phone contact list why i used this syntax android:userVisible=false in the xml contact where is the wrong can someone help me with that please thanx on adavance -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] TabHost Problem
Yes, I did check, On Wed, Jun 6, 2012 at 8:40 PM, Justin Anderson magouyaw...@gmail.comwrote: Have you verified that? Have you tried debugging your code to make sure that you are refreshing properly? Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Wed, Jun 6, 2012 at 12:12 AM, naseem Rafique naseem.ra...@gmail.comwrote: Hi Justin, Thanks for sparing some time. I do refresh all memory objects infect first I nullify them and re populate from server. On Tue, Jun 5, 2012 at 7:35 PM, Justin Anderson magouyaw...@gmail.comwrote: The problem is most likely in your Profile class... You need to refresh it when you log in. Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Tue, Jun 5, 2012 at 7:21 AM, naseem Rafique naseem.ra...@gmail.comwrote: Hi folks, I am working on an app in which I need to show three Tabs, on Logout I want to show remove these abs and on login I want to show these tabs with new user's data who just logged in. For this I used *On Logout:* * * this.tabHost.clearAllTabs(); *On Login:* * * * *intent = new Intent(this, Profile.class); spec = mTabHost.newTabSpec(Profile).setIndicator(Profile,res.getDrawable(R.drawable.ic_launcher)).setContent(intent); mTabHost.addTab(spec); But it doesn't show my contents of new user, but show old contents. Any one, any thoughts. Thanks, Sam. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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]
Hi all, I am using tesseract ocr for converting image to text.while passing the image ,i didn't get recognized text.Any one help on this. Thanks, vijay.k -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: instance count violation
thanks a lot for the answers. i also came up with the solution to ignore this error. :) On Thursday, June 7, 2012 12:39:58 PM UTC+2, marcin kolonko wrote: hi, i have an app with two classes: *SelectItemActivity** extends **AbstractListActivity,* and * AbstractListActivity extends Activity* * * (~20 lines of code each) - not much to screw up i thought... links to pastebin: *AbstractListActivity* : http://pastebin.com/iKEa3d3a *SelectItemActivity : *http://pastebin.com/UC01gvTg *Menu*: http://pastebin.com/vjL1r28q now, when i click on the button in the actionbar, switch to landscape and then back to portrait, the app crashes and i get this error: *android.os.StrictMode$InstanceCountViolation: class ch.futurecom.MeetingMaid.view.SelectItemActivity; instances=2; limit=1* * * does anyone have a clue what's going on? thx -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: best practice in extending classes
as of now, i set all class members to null, but do nothing inside classes i extended, like listeners or adapters or anonymous classes. would that be enough? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: best practice in extending classes
as of now, i set all class members to null, but do nothing inside classes i extended, like listeners or adapters or anonymous classes. would that be enough? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Printing PDF in Android
Android does not have any printing support at this time. On Fri, Jun 8, 2012 at 1:44 AM, RAJESH RAJARAM rajeshrajar...@gmail.com wrote: Hi I have pdf document in my sdcard, I have to print the document from the android mobile. About this i didn't have any idea. Is it possible? This there any API in Android? and Advise and Idea's please. Rajesh Rajaram -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training... At Your Office: http://commonsware.com/training -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Data interchange with a PHP server
Hi there, I need to interchange data between my Android app, written in Java using eclipse, and an Apache HTTP server through some PHP scripts. What is the best way to do so? I do not know if there is some bultin functions yet on API that could make the communication easier than directly using sockets and parsing strings. Thanks a lot in advance, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Printing PDF in Android
Android support Google Cloud print facility. please reffer the url https://developers.google.com/cloud-print/docs/android On Fri, Jun 8, 2012 at 3:55 PM, Mark Murphy mmur...@commonsware.com wrote: Android does not have any printing support at this time. On Fri, Jun 8, 2012 at 1:44 AM, RAJESH RAJARAM rajeshrajar...@gmail.com wrote: Hi I have pdf document in my sdcard, I have to print the document from the android mobile. About this i didn't have any idea. Is it possible? This there any API in Android? and Advise and Idea's please. Rajesh Rajaram -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training... At Your Office: http://commonsware.com/training -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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]
Hi all, Could anyone tell me the way to extract text from image in android. Thanks, vijay.k -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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]
On Fri, Jun 8, 2012 at 9:22 AM, Vijay Krishnan vijay.vijay...@gmail.com wrote: Could anyone tell me the way to extract text from image in android. The same way you extract text from image anywhere else: use OCR. There is no OCR capability as part of the Android OS, so you will need a third-party solution, most likely an expensive commercial one. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training... At Your Office: http://commonsware.com/training -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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]
what about tesseract? On Fri, Jun 8, 2012 at 7:01 PM, Mark Murphy mmur...@commonsware.com wrote: On Fri, Jun 8, 2012 at 9:22 AM, Vijay Krishnan vijay.vijay...@gmail.com wrote: Could anyone tell me the way to extract text from image in android. The same way you extract text from image anywhere else: use OCR. There is no OCR capability as part of the Android OS, so you will need a third-party solution, most likely an expensive commercial one. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training... At Your Office: http://commonsware.com/training -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Re: Data interchange with a PHP server
There is an HTTP client on Android. When you talk about parsing strings, what structure do you have? There are facilities for handling JSON and XML. On Friday, June 8, 2012 6:48:22 AM UTC-4, Fran wrote: Hi there, I need to interchange data between my Android app, written in Java using eclipse, and an Apache HTTP server through some PHP scripts. What is the best way to do so? I do not know if there is some bultin functions yet on API that could make the communication easier than directly using sockets and parsing strings. Thanks a lot in advance, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers]
On Fri, Jun 8, 2012 at 9:35 AM, Vijay Krishnan vijay.vijay...@gmail.com wrote: what about tesseract? http://en.wikipedia.org/wiki/Tesseract -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training... At Your Office: http://commonsware.com/training -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: best practice in extending classes
That should take care of itself. Initially only the Android system has a reference to that object of an internal class type (e.g. and Activity object. That reference is effectively a bridge. (Call it 'refB'). The object of an Android internal type can in turn have references to other objects but as soon as Android cuts that bridge all those other objects become unreachable and fair game for garbage collection. Where you get in trouble is if you give 'refB' to another object so that it is no longer a bridge. So, for instance don't give a reference of your activity to a service. Listeners are not a problem since the when you register the listener it is the widget that has a reference to the listener (not the listener having a reference to the widget) On Friday, June 8, 2012 5:18:57 AM UTC-4, marcin kolonko wrote: as of now, i set all class members to null, but do nothing inside classes i extended, like listeners or adapters or anonymous classes. would that be enough? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Data interchange with a PHP server
Hi, For JS it is clear that JSON will be faster, but what is the better choose in Java for Android? I mean, is it JSON parsed faster than XML on Dalvik? And for the authentication I used to use PHP sessions and cookies when developing web pagers. Will be this also the prefered way to do it with the Android HTTP client? The other way I am considering is to give the client a token from the server after authentication and pass it in every POST or GET request to the server. This has the disadvantage of having to take care of passing it in every request, but on the other hand avoiding cookies should made the code simpler and easier to debug. Regards, On 08/06/12 15:59, Chris Mawata wrote: There is an HTTP client on Android. When you talk about parsing strings, what structure do you have? There are facilities for handling JSON and XML. On Friday, June 8, 2012 6:48:22 AM UTC-4, Fran wrote: Hi there, I need to interchange data between my Android app, written in Java using eclipse, and an Apache HTTP server through some PHP scripts. What is the best way to do so? I do not know if there is some bultin functions yet on API that could make the communication easier than directly using sockets and parsing strings. Thanks a lot in advance, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Changing hosts file on an Android device
Hi there, When I develop a dynamic web site I used to change the /etc/hosts file on my linux boxes and the equivalent on Windows ones to test the site on different browsers, so I add a line in the way of: 192.168.1.21devel.mysite.com So when I put http://devel.mysite.com on a browser, it connects to my development Apache server. So what I'd like to do it is the same on my Android device, I think I cannot edit /etc/hosts file on it at least while it is not rooted, but if there is other way to do this it will be enough. I know there are complexer ways to do this, like setting up a DNS server on my own network and give it through DHCP to the device when its connected to my WIFI access point, but I rather like to do it in a simpler manner if there is any... I use Eclipse for development, so if there is a chance to do something via DDMS or using command line tools like adb, it will be welcomed. Best regards, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Changing hosts file on an Android device
On Fri, Jun 8, 2012 at 11:12 AM, Francisco M. Marzoa Alonso fmmar...@gmail.com wrote: Hi there, When I develop a dynamic web site I used to change the /etc/hosts file on my linux boxes and the equivalent on Windows ones to test the site on different browsers, so I add a line in the way of: 192.168.1.21 devel.mysite.com So when I put http://devel.mysite.com on a browser, it connects to my development Apache server. So what I'd like to do it is the same on my Android device, I think I cannot edit /etc/hosts file on it at least while it is not rooted, but if there is other way to do this it will be enough. That's right, you'll need root to do this.. typically mods do this sort of thing to disable ads across the system... I know there are complexer ways to do this, like setting up a DNS server on my own network and give it through DHCP to the device when its connected to my WIFI access point, but I rather like to do it in a simpler manner if there is any... Hmm.. That's also right, you can't really modify the system internals without root or firmware mods, but, as you note, setting up DNS, etc... Wait, why are you doing this again? Is this something you want to work just for your development device, or do you want it to work across apps? kris -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] device loack/unlock callback at native layer
any one have idea about how and where we can get callback for device lock and when it get unlock. at app level using receiver (ACTION_SCREEN_ON, ACTION_SCREEN_OFF) we get handle it but how at native layer. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] device loack/unlock callback at native layer
any one have idea about how and where we can get callback for device lock and when it get unlock. at app level using receiver (ACTION_SCREEN_ON, ACTION_SCREEN_OFF) we get handle it but how at native layer. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Android DPI problems
If I insert a picture will it come through on these posts? I am so confused as to why this isn't showing up correctly on phones that say they have a normal screen From: android-developers@googlegroups.com [mailto:android-developers@googlegroups.com] On Behalf Of Dianne Hackborn Sent: Thursday, June 07, 2012 4:28 PM To: android-developers@googlegroups.com Subject: Re: [android-developers] Android DPI problems You shouldn't be thinking about dpi at all. You will currently encounter devices with only 5 densities: 120, 160, 213, 240, 320. Every device will have one of those densities; 217dpi and 220dpi are not valid densities. You will care about this pretty much only for your graphics, though the platform will scale your graphics if it does. This is also relevant for text sizes and units used in layouts, but in those cases you just use sp or dp units and it is taken care of for you. So for your layouts you should basically not care about densities at all, just do your layouts in dp units as if you were on a medium density screen and let the platform take care of it for you. I strongly discourage the use of other units like in and mm -- many devices do not report the correct true physical density, so you unfortunately can't count on them working correctly. Fortunately you shouldn't need to, because 99% of the time you want to be operating in density units not true dpi. On Thu, Jun 7, 2012 at 12:44 PM, Tommy Hartz droi...@gmail.com wrote: Hey everyone, I am a little confused on something. I have created multiple layouts for different screen sizes. The problem I run into is that on my HTC Inspire I have a normal screen with ~217dpi, on the droid X it reports to have a normal screen but it has ~220 dpi. When I run my app it pulls the right layout but the images on the screen have huge spaces in between them yet on my HTC everything appears how it should. How can I avoid this issue? It is incredibly frustrating. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com mailto:android-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Android DPI problems
Post your layout, maybe we can spot something ... On Friday, June 8, 2012 5:09:15 PM UTC+1, Tommy wrote: If I insert a picture will it come through on these posts? I am so confused as to why this isn’t showing up correctly on phones that say they have a “normal” screen *From:* android-developers@googlegroups.com [mailto: android-developers@googlegroups.com] *On Behalf Of *Dianne Hackborn *Sent:* Thursday, June 07, 2012 4:28 PM *To:* android-developers@googlegroups.com *Subject:* Re: [android-developers] Android DPI problems You shouldn't be thinking about dpi at all. You will currently encounter devices with only 5 densities: 120, 160, 213, 240, 320. Every device will have one of those densities; 217dpi and 220dpi are not valid densities. You will care about this pretty much only for your graphics, though the platform will scale your graphics if it does. This is also relevant for text sizes and units used in layouts, but in those cases you just use sp or dp units and it is taken care of for you. So for your layouts you should basically not care about densities at all, just do your layouts in dp units as if you were on a medium density screen and let the platform take care of it for you. I strongly discourage the use of other units like in and mm -- many devices do not report the correct true physical density, so you unfortunately can't count on them working correctly. Fortunately you shouldn't need to, because 99% of the time you want to be operating in density units not true dpi. On Thu, Jun 7, 2012 at 12:44 PM, Tommy Hartz droi...@gmail.com wrote: Hey everyone, I am a little confused on something. I have created multiple layouts for different screen sizes. The problem I run into is that on my HTC Inspire I have a normal screen with ~217dpi, on the droid X it reports to have a normal screen but it has ~220 dpi. When I run my app it pulls the right layout but the images on the screen have huge spaces in between them yet on my HTC everything appears how it should. How can I avoid this issue? It is incredibly frustrating. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] onTouch, onFling and an ImageButton in a ListView topped with NullPointerExeption
hi, in a row of a *ListView *i have a *TextView *and an *ImageButton* on an *ListView *instance i have a *GestureDetector *and a extended * SimpleOnGestureListener*, on the ImageView instance i have called setFocusable(false). now, the swipe is registered when the start is not on the *ImageButton*, and everything works. but when i start the swipe on the *ImageButton*, i get a NullPointerExeption. the exeption happens in the *onFling()* method of *SimpleOnGestureListener*, because ne *MotionEvent *e1 is null. is there a way *ImageButton* can continue to be a button, but propagate the event up? here are links to pastebin where you can see the classes: adapter: http://pastebin.com/djgYebcb activity with gesturedetector: http://pastebin.com/4x6Tq7Yb main.xml: http://pastebin.com/WkEje1h7 row.xml: http://pastebin.com/2YTmwGju thx -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Problem with Bluetooth after NFC Handover
Hi all, Thank you! I followed Vijay's reply to use Java reflection regarding Android Bluetooth Profiles (A2DP and Headset) classes, I use SDK 15 (4.0.3), which still keeps connect() methods hidden. I also tried to follow Raunaque's advice, but no success with RFCOMM socket although I used correct UUID (Service Discovery Failure exception). I try again more attentive. A solution for pairing I will look next is using bluez via DBus. I've tried this approach on Linux from command-line d-bus utilities (http:// zitzlinux.wordpress.com/2011/02/28/connecting-bluetooth-devices-from- command-line/) and got headset paired, I hope it can be done programmatic in Android. Best regards, Alexei On 30 май, 04:51, Raunaque Quaiser rmquai...@gmail.com wrote: Please check the SDK of Android Framework if it support the Headset Bluetooth class. Check for the UUID you are using to pair the headset with Nexus. Each BT class profile has unique ID . If the UUID is not correct it will not pair even if the SDK supports BT headset profile , Raunaque On Wed, May 30, 2012 at 2:17 AM, vijay Badawadagi vijaybadawad...@gmail.com wrote: try to connect via reflection, can solve the problem like below m = mmDevice.getClass().getMethod(createInsecureRfcommSocket, new Class[]{int.class}); tmp = (BluetoothSocket)m.invoke(mmDevice, Integer.valueOf(1)); Thanks Vijay On Tue, May 29, 2012 at 12:54 PM, Alexei Tchervinsky alexey.tchervin...@gmail.com wrote: Hi all, I have NFC-enabled headset Nokia BH-505 and NFC-enabled smartphone Samsung Nexus S. I am writing Android Java application to connect the devices via NFC for later Bluetooth connection, NFC Static Handover pass ok, but Bluetooth connect() from phone to headset fails with Service Discovery Failure exception. Does anybody have a similar experience to discuss my problem in more details? Any help will be greatly appreciated. Thanks in advance, Alexei -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Printing PDF in Android
On Fri, Jun 8, 2012 at 2:44 AM, RAJESH RAJARAM rajeshrajar...@gmail.com wrote: Hi I have pdf document in my sdcard, I have to print the document from the android mobile. About this i didn't have any idea. Is it possible? This there any API in Android? and Advise and Idea's please. There are several vendor-supplied printing apps for Android. If you have a printer from HP, take a look at https://play.google.com/store/apps/details?id=com.hp.android.print -- The flames are all long gone, but the pain lingers on -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] PNG file won't display in ImageView when src is set programatically
I have a png file in my res/drawable-ldpi folder. I'm working in Eclipse with the emulator, but I've tried this on my 2.2.1 Android phone and I get the same behavior. I have an ImageView and I want to set the src programatically, based on a database call. If I just put src=@drawable.norusdpyr in the Activity's XML file, the file displays fine. BUT, if I put String imageresource = R.drawable. + parsedData[4].toString(); chart.setImageURI(Uri.parse(imageresource)); where parsedData[4].toString() = nor_usdpyr I don't see anything. I've also tried String imageresource = android.resource:// + getPackageName() + /R.drawable. + parsedData[4].toString(); chart.setImageURI(Uri.parse(imageresource)); and InputStream is = getClass().getResourceAsStream(/drawable/ + parsedData[4].toString()); chart.setImageDrawable(Drawable.createFromStream(is, )); and String imageresource = R.drawable. + parsedData[4].toString(); File file = new File(imageresource); chart.setImageDrawable(Drawable.createFromPath(file.getAbsolutePath())); and Context context = getApplicationContext(); int ResID = context.getResources().getIdentifier(imageresource, drawable, com.KnitCard.project); chart.setImageResource(ResID); finally even, chart.setImageURI(Uri.parse(android.resource:// + getPackageName() + /R.drawable.nor_usdpyr)); None of these work. What am I doing wrong? Thanks! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Eclipse dev/debug on different machine than where Android device is connected?
This should help http://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb-over-tcp On Thursday, June 7, 2012 10:01:31 PM UTC-4, SChaser wrote: Good. But how do I do that? From Eclipse? My normal Eclipse debugging method is simple: 1)Set a breakpoint or two 2) Debug As-Android Application 2a)... magic happens Eclipse arranges for the app to be installed and run with its debugger attached 3) Voila. I'm there. How to I set up Eclipse to do this via TCP/IP? Thanks! On Jun 7, 5:52 pm, lbendlin l...@bendlin.us wrote: you can do debugging via TCP/IP, no need for a USB connection. On Thursday, June 7, 2012 4:23:28 PM UTC-4, SChaser wrote: I would like to be able to debug (using Eclipse) an Android app when the device is USB connected to a different machine. Is this possible, and if so, how? Reason: I'd like to have a single machine that contains my Android development environment, but be able to access it (via Remote Desktop for windows) from remote machines which would have the Android device plugged in. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] PNG file won't display in ImageView when src is set programatically
On Jun 8, 2012, at 8:38 PM, Melanie Peterson wrote: Context context = getApplicationContext(); int ResID = context.getResources().getIdentifier(imageresource, drawable, com.KnitCard.project); chart.setImageResource(ResID); Is it totally out of question to choose correct resource id programmatically (instead of using db values as-is)? int resId = -1; if (parsedData[4].equals(norusdpyr)) { resId = R.drawable.norusdpyr; } // ...etc, etc…. chart.setImageResource(resId); Asking since you're referring to resource drawables only which may be easier to handle in this way. E.g. you get to choose error image for situations you receive a value from db there's no existing image resource for. -- H -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] LocalSocketAddress.Namespace.FILESYSTEM (?!)
I'm confused by the FILESYSTEM namespace. According to the docs, in Android's implementation of unix domain sockets these names refer to names in the Linux abstract (non- filesystem) UNIX domain namespace. But then there's a FILESYSTEM namespace, which implies that some of them could be non-abstract and be implemented in the file system, which is what I need. Anyone know for sure which it is? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Enabling accessibility in a WebView
Hi, I've been taking a look at accessibility in an app I work on. Most things are working well, but I was wondering if there was a way to enable support for TalkBack and KickBack in a WebView on any given activity or fragment. I know that the system Browser app supports screen reading when accessibility is enabled on a device, but this doesn't seem to do anything for pages loaded into a WebView. I've even tried the same page both in the browser and the WebView, but only the browser had accessibility working. If it's not possible to turn this on for a WebView, it is possible to implement the accessibility methods to get this working? It didn't seem apparent to me that this was possible based on the API docs. Thanks! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Repeat background
Den måndagen den 28:e maj 2012 kl. 11:38:01 UTC+2 skrev Kristoffer: Hello. Iam using a small image and repeats it as a background in my app, this is how i do it. bgrepeat.png backgroundrepeat.xml i have them in the drawable folder. This is how the .xml look like. bitmap xmlns:android=http://schemas.android.com/apk/res/android; android:src=@drawable/bgrepeat android:tileMode=repeat android:dither=true / And i just call in in xml like this. android:background=@drawable/backgroundrepeat If i run this on my Galaxy S2 then the background repeats and looks good, but if i try on a tablet (galaxy 8.9) then it does not repeat it just zooms the bgrepeat.png file, and same result in emulator on my pc. I need to know that this will work on most devices, and why it doesent work on every device.. bug? Any idees? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] How to resize width fragment
On Fri, Jun 8, 2012 at 2:15 AM, Huynh Ngoc Bang hnbang1...@gmail.comwrote: I would like to resize fragment (id = fragMenu) when runing app. What have you tried thus far? - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en