[android-developers] Re: alphabetic scrollview navigator
I didn't see a redirect bug -- but gmail failed to include the final ')' in the link, so the anchor survived, but failed. So what is it with these redirects, anyway? It's always sending me to some random locale -- fr one day, de today. Fortunately -- they're all in English. I'm using Chrome, on Windows 7. On Feb 2, 5:44 pm, Jason Proctor jason.android.li...@gmail.com wrote: thanks! btw is the documentation redirect bug there for everyone? i reported it, no response yet. that URL takes me back to the top of AbsListView.html, as the anchor fails to survive the redirect to -- http://developer.android.com/intl/zh-CN/reference/android/widget/AbsL... (with the intl/zh-CN) kinda irritating... http://developer.android.com/reference/android/widget/AbsListView.htm...) On Tue, Feb 2, 2010 at 5:37 PM, Jason Proctor jason.android.li...@gmail.com wrote: is the scrollview with the alphabetic list on the right and annotated scrolling a standard component? or is there any support for implementing it? sorry i've not had chance to take a look in the 2.0 API... thanks -- jason.vp.engineering.particle -- You received this message because you are subscribed to the Google 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 -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- jason.vp.engineering.particle -- You received this message because you are subscribed to the Google 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: TabActivity with scroll
Thanks very much for your ideas folks. Hc - its a cool tabhost you've made! :) Thanks a lot, and I'm sure it will be very useful for a requirement of always fitting in within the screen. Unfortunately, my requirement is such that I do not want to reduce the width of each tab as the number of tabs increases :( Beth - thanks a lot for the suggestion..I'll try it out..it might give a nice look. In the meantime, I've made a tabhost of my own with a ScrollView such that it scrolls when the tabs cover a width more than the page width. Cheers, Priyanka On Dec 8 2009, 7:25 am, hc honch...@gmail.com wrote: Hi guys, I made a scrollable tabhost with a scrollview. Made it open source and it's available herehttp://code.google.com/p/mobyfactory-uiwidgets-android On Dec 8, 7:47 am, Beth emez...@gmail.com wrote: Hi Priyanka, You might implement this functionality using a gallery, a list widget that scrolls sideways. In the Gallery adapter, you can set up each Gallery item as a TextView with a CompoundDrawable icon displayed above the text. A visual 'tab' outline could be set into the background of each item in the list. It's just a possibility if you really want more than 3 or 4 tabs. Regards, Beth On Dec 7, 10:53 am, Mark Murphy mmur...@commonsware.com wrote: I want to use a TabActivity with 6 or 7 or more tabs. However, I do not want to clutter my screen with so many tabs together. Hence, I'd like to be able to show, say, 3 tabs on the screen, and to be able to scroll to the other tabs. How may I achieve this? The built-in tab system does not support this concept. I recommend using fewer tabs, dividing your functionality into multiple activities. -- Mark Murphy (a Commons Guy)http://commonsware.com Android App Developer Books:http://commonsware.com/books.html- 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: TabActivity with scroll
Thanks very much for your ideas folks. Hc - its a cool tabhost you've made! :) Thanks a lot, and I'm sure it will be very useful for a requirement of always fitting in within the screen. Unfortunately, my requirement is such that I do not want to reduce the width of each tab as the number of tabs increases :( Beth - thanks a lot for the suggestion..I'll try it out..it might give a nice look. In the meantime, I've made a tabhost as Mark suggested - such that the fourth tag gives a list of the remaining functionalities, and the user might go to them through this tab. I had made a tabhost which used to scroll when number of tabs occupied a width greater than the screen width, but then the look was not very intuitive(we decided we don't want users to scroll in a tab) - hence we discarded the idea of scrollable tabs. Cheers, Priyanka On Dec 8 2009, 7:25 am, hc honch...@gmail.com wrote: Hi guys, I made a scrollable tabhost with a scrollview. Made it open source and it's available herehttp://code.google.com/p/mobyfactory-uiwidgets-android On Dec 8, 7:47 am, Beth emez...@gmail.com wrote: HiPriyanka, You might implement this functionality using a gallery, a list widget that scrolls sideways. In the Gallery adapter, you can set up each Gallery item as a TextView with a CompoundDrawable icon displayed above the text. A visual 'tab' outline could be set into the background of each item in the list. It's just a possibility if you really want more than 3 or 4 tabs. Regards, Beth On Dec 7, 10:53 am, Mark Murphy mmur...@commonsware.com wrote: I want to use a TabActivity with 6 or 7 or more tabs. However, I do not want to clutter my screen with so many tabs together. Hence, I'd like to be able to show, say, 3 tabs on the screen, and to be able to scroll to the other tabs. How may I achieve this? The built-in tab system does not support this concept. I recommend using fewer tabs, dividing your functionality into multiple activities. -- Mark Murphy (a Commons Guy)http://commonsware.com Android App Developer Books:http://commonsware.com/books.html- 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: Vertex arrays vs. VBOs
Robert Green has mentioned VBOs being fast for his uses a couple times on this list, I think. Might be worth searching those posts out. Not actual usage, but I saw them mentioned in some docs recently. It's for a newer version of OpenGL ES, but this ImgTec document recommends VBOs, for example: http://www.imgtec.com/factsheets/SDK/POWERVR%20SGX.OpenGL%20ES%202.0%20Application%20Development%20Recommendations.1.1f.External.pdf ImgTec's PowerVR SGX design is in the Droid Qualcomm also recommends VBOs: http://www.brewconference.com/brew_2007/pdf/Prog-401_Dorbie_v05.pdf Although that presentation is for BREW, not Android, and skips over their MSM7200 design which is in the G1. The differences in the documents are interesting. ImgTec recommends interleaving all the data for a vertex together. Qualcomm recommends tightly packed instead. ImgTec recommends always using an indexed triangle list. Qualcomm recommends triangle strips, stitching them together with degenerate triangles for screen aligned quads. On Feb 2, 8:10 pm, Peter Eastman peter.east...@gmail.com wrote: I was wondering if anyone has experience with the relative performance of vertex arrays vs. vertex buffer objects? On a desktop computer, you expect VBOs to be much faster since the data can be stored in video memory. But hand held devices don't usually have separate video memory, so I'd expect little or no difference between them. How do they actually work in practice? Peter -- You received this message because you are subscribed to the Google 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 Generate Android Testing Report in HTML Automatically
I do not like android instrumentation framework, and switched to mocking everything android. JMockIt seems to be a right tool ( jmock has problems with finals and concrete classes) -- You received this message because you are subscribed to the Google 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: Suspicious TCP RST packets while device is sleeping.
Well, I don't grok NAT enough to conclude that it's wrong. But I don't see why they'd do it -- unless they're trying to minimize traffic. Seems kinda trivial -- and likely more than offset by the later attempted transmit. I'm not sure what problem you're trying to solve. It can certainly happen that one side thinks a connection is open while the other thinks it's closed. The recipient sends a RST, the sender gets a connection reset and life goes on. Is it the delay in discovering the disconnect that's the issue? On Feb 2, 7:43 pm, Dan Sherman impact...@gmail.com wrote: Hey Bob, Thanks a lot for the response :) After a few more hours tonight working on the problem, I've got a bit more information to present. From everything I'm seeing, it looks like the issue has to do with NAT'ing at the network level (tmobile I'd imagine). The connection is definitely NAT'd, the client sees itself as one outgoing IP (14.130.xxx.xxx) and port, and the server sees an incoming connection from a different IP/port (208.54.xxx.xxx). My best guess is that tmobile is killing the connections at the NAT level after not seeing traffic running on it for a certain period of time (5 minutes in this case). This wouldn't be a problem, as you said, a reconnect works just fine. And in fact, the higher-level long-lived session control is already in place, and the client reconnects/etc properly when sensing a disconnect. The problem comes in based on _how_ the NAT is killing the connection. Keeping a wake-lock on device to prevent sleeping, and watching TCPdump on both sides shows the server receiving a RST packet, but no RST packet is sent to the client. The client sits there, assuming the connection is still active, indefinitely. The second it tries to do something (user-prompted, or via a ping timer), it sends a PSH packet to the server, and the server responds with a RST (it closed the connection when it got the RST from the NAT). Obviously if the NAT were to send RSTs both directions, this wouldn't be a problem, the client would notice the disconnect, and reconnect. But from everything I can tell, it notifies the server, and leaves the client completely unaware that the connection has been dropped... I understand that the NAT needs to clear out old/stale connections, but sending a RST uni-directionally seems a bit incorrect to me... Any ideas? - Dan On Tue, Feb 2, 2010 at 10:25 PM, Bob Kerns r...@acm.org wrote: This is expected behavior. TCP connections time out if the connection is lost, or either side dies. That way, you don't have systems drowning in dead connections. The RST packet is telling you that the server has forgotten about the connection. The client may even report it directly, if it realizes that it hasn't heard from the server, so you may get a connection reset error even without seeing an actual RST from the server. The default timeout is usually 5 minutes, which squares with your observations. In general, you should not try to solve your problem by increasing the timeout, but rather by reestablishing the connection, and maintaining long-lived sessions at a higher level. I'd recommend, if possible, dropping your AlarmManager ping task, in favor of reopening your connection. You'll consume less resources -- including battery. If you want to minimize the cost of reopening connections, you can send a ping whenever you happen to wake up, reopening if necessary. But that doesn't scale that well -- you'll be able to have more simultaneous clients if you strike a suitable balance between keeping connections alive, and the cost of reopening them. For rare interactions, you can support more clients if you open connections on actual need, and close them promptly when not needed. It all depends on exactly what you're trying to optimize, and the environment in which you're operating. The only constant is -- you can't DEPEND on keeping connections alive. View it as an optimization, rather than how your application works. And then make sure it is actually an optimization! So often, optimizations are a waste of a developer's time. I'd also recommend avoiding thinking about TCP at the level of packets (or segments), RST, etc., if at all possible. Unless you're trying to diagnose a flaky router, or issues with radio connectivity, or things at a similar level, it's better to focus at a higher level, at least at the socket level -- is it opening, established, closed, reset? On Feb 2, 1:05 am, Dan Sherman impact...@gmail.com wrote: Hey guys, trying to track down a rather elusive problem here... I've been playing around with long-standing TCP connections to a server. The client opens a TCP connection to the server, sets a timeout at a reasonably long period (30 minutes), and adds an AlarmManager task to ping the server every 15 (a ping is just a junk packet the server responds to with an
Re: [android-developers] Re: Forcibly using 3G or CDMA network even though wi-fi is available.
-- MMS cannot be sent over wi-fi.Carriers network is mandatory to send/recv. The MMSC need to identify from/to the message coming going and it wont be possible while using wi-fi. So its required to switch to 3g or CDMA even if wi-fi is available. 2010/2/3 Dongjoon Lee sky...@gmail.com The application needs to get some information from operator's server. And operator want us to make use operator's network, not wifi, even though wifi is available. It's very difficult to find solution. May I need to search alternative way. Anyway, thanks for your advice. Best regards, Dongjoon. On 1월15일, 오후7시17분, Jens dunkingbikk...@gmail.com wrote: For the same reason you added the feature that allows the MMS application to switch to a specific APN even when WiFi is available. lots of mobile apps require you to go through a specific APN - for billing purposes amongst other things. Dongjoon: You could check if the same crazed hack that allows the MMS application to work can be used by you? Br Jens On 14 Jan, 19:07, Dianne Hackborn hack...@android.com wrote: Sorry, I don't believe you can. Why do you want to do this? On Thu, Jan 14, 2010 at 12:39 AM, Dongjoon Lee sky...@gmail.com wrote: Hello. My question is, as you can see the title, can i use3gnetwork even though wi-fi is available? i heard wi-fi priority is higher than3gor cdma. can i change that priority in specific application? this is one of requirement of the project. if anybody has an answer, plz help me. thanks in advance. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubs-cr...@googlegroups.comandroid-developers%252bunsubs-cr...@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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Why are my SharedPreferences suddenly deleted, after I updated my game in the Market?
Hi! Why are my SharedPreferences suddenly deleted, after I updated my game in the Market? Here is the logcat: W/ApplicationContext( 1465): Attempt to read preferences file /data/ data/digle.de.LeonardFrog/shared_prefs/Highscore.xml without permission E/ApplicationContext( 1465): Couldn't rename file /data/data/ digle.de.LeonardFrog/shared_prefs/Highscore.xml to backup file /data/ data/digle.de.LeonardFrog/shared_prefs/Highscore.xml.bak E/ApplicationContext( 1465): Couldn't create directory for SharedPreferences file /data/data/digle.de.LeonardFrog/shared_prefs/ Highscore.xml Greetings, Martin -- You received this message because you are subscribed to the Google 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] Cant find the solution for this GLSurfaceView error
Hi all, I have a code for GLSurfaceView which runs fine with sdk 1.5. I am trying to use it in the sdk 2.0 I am getting following error - *Application called a GL11 Pointer method with an Indirect Buffer* This is the line at which the error is coming, *gl.glVertexPointer(3, GL10.GL_FLOAT, 0, slicesBuffers[i]); *Please anybody explains me why this error comes how to solve it? or any other suggestion is also good for me. Thanks, SaT -- You received this message because you are subscribed to the Google 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: Regarding Tv out in Android
Hi, Is this possible in Android? Can anyone help me? I need it. Thanks Regards, Raghavendra K. On Feb 2, 2:53 pm, Dilip Dilip dileep2m...@gmail.com wrote: Hi All, Is there any TV out feature in Android. Is anyone working on it ? Thanks and Regards, Dileep -- You received this message because you are subscribed to the Google 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 get a remote logcat on error?
Hi! I have a game in the market and with flurry analytics, I receive all my errors. Here are some of them: 01/31/10 01:47:39 PM PST0 class java.lang.IllegalArgumentException parameter must be a descendant of this view 02/02/10 12:40:41 PM PST0 class java.lang.IllegalThreadStateExceptionThread already started. 01/26/10 09:25:36 PM PST0 class java.lang.NullPointerException 1.0 (beta) uncaughtAndroid 02/01/10 05:26:27 PM PST0 class java.lang.OutOfMemoryError bitmap size exceeds VM budget1.3 (beta) uncaughtAndroid 01/29/10 10:23:10 AM PST0 class java.lang.RuntimeException Adding window failed 1.0 (beta) uncaughtAndroid 01/29/10 08:19:05 AM PST0 class java.lang.RuntimeException Unable to start activity ComponentInfo{digle.de.LeonardFrog/ digle.de.LeonardFrog.AHighscore}: java.lang.NullPointerException 1.0 (beta) uncaughtAndroid 01/27/10 01:09:35 AM PST0 class java.lang.VerifyError digle.de.LeonardFrog.AHighscore 1.0 (beta) uncaught Android I want to solve them but I need a logcat. There is the application aLogcat in the Market, which displays the logcat on the mobile, but I need the logcat of my users without telling them to download this app, because many people are lazy and won't do it. How can I get this logcat? Is there maybe a library, which sends me the logcat on error? Greetings, Martin -- You received this message because you are subscribed to the Google 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: Why are my SharedPreferences suddenly deleted, after I updated my game in the Market?
Did you change/add a sharedUserId in your manifest? On Feb 3, 3:40 am, Martin google-gro...@digle.de wrote: Hi! Why are my SharedPreferences suddenly deleted, after I updated my game in the Market? Here is the logcat: W/ApplicationContext( 1465): Attempt to read preferences file /data/ data/digle.de.LeonardFrog/shared_prefs/Highscore.xml without permission E/ApplicationContext( 1465): Couldn't rename file /data/data/ digle.de.LeonardFrog/shared_prefs/Highscore.xml to backup file /data/ data/digle.de.LeonardFrog/shared_prefs/Highscore.xml.bak E/ApplicationContext( 1465): Couldn't create directory for SharedPreferences file /data/data/digle.de.LeonardFrog/shared_prefs/ Highscore.xml Greetings, Martin -- You received this message because you are subscribed to the Google 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: Cant find the solution for this GLSurfaceView error
The buffer needs to be direct so that it isn't moved around in memory. You can do this by creating it using ByteBuffer.allocateDirect. You can see examples in demos: http://developer.android.com/intl/de/resources/samples/ApiDemos/src/com/example/android/apis/graphics/TriangleRenderer.html On Feb 3, 4:04 am, satish bhoyar getsatonl...@gmail.com wrote: Hi all, I have a code for GLSurfaceView which runs fine with sdk 1.5. I am trying to use it in the sdk 2.0 I am getting following error - *Application called a GL11 Pointer method with an Indirect Buffer* This is the line at which the error is coming, *gl.glVertexPointer(3, GL10.GL_FLOAT, 0, slicesBuffers[i]); *Please anybody explains me why this error comes how to solve it? or any other suggestion is also good for me. Thanks, SaT -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Help needed with parsing some XML data !
Actually this is the code for the second approach : /* Create a URL we want to load some xml-data from. */ URL url = new URL(http://www.myserver.com/xmlstream;); /* Get a SAXParser from the SAXPArserFactory. */ SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); /* Get the XMLReader of the SAXParser we created. */ XMLReader xr = sp.getXMLReader(); /* Create a new ContentHandler and apply it to the XML-Reader*/ ExampleHandler myExampleHandler = new ExampleHandler(); xr.setContentHandler(myExampleHandler); /* Parse the xml-data from our URL. */ xr.parse(new InputSource(url.openStream())); /* Parsing has finished. */ And the error I get is : At line 40, column 23: not well-formed (invalid token) which is around this XML line : Country ID=2 CName=Åland eilanden/ So where should I specifiy its an ISO-8859-1 ? Also I have been debugging the app, but I actually cannot see the stacktrace, could you please direct me on how to show it on NetBeans ? Every time I try to look at the exception thrown I will see several variables but StackTrace will be null... On 3 feb, 06:17, Bob Kerns r...@acm.org wrote: While I would expect your second approach to work, it's important to note that IT IS NOT REQUIRED TO WORK. The XML standard does not require XML processors to support anything other than UTF-8 or UTF-16. In this day and age, I would STRONGLY discourage use of anything other than UTF-8, or, rarely, UTF-16. Another factor to consider is how you're getting access to those characters. You must do this one of two ways: 1) Using a Reader set to read 8859-1 -or- 2) Using an input stream, giving the raw bytes to the parser, letting it decode the 8859-1 characters. You WILL FAIL (and this is probably your problem, would be my guess) if you try to read using a Reader that's expecting UTF-8. A stacktrace should show which problem you have. On Feb 2, 6:42 am, MobDev developm...@mobilaria.com wrote: Hi, I am downloading a xml-type file from a webserver which starts out with : ?xml version=1.0 encoding=iso-8859-1 ? afterwards I get a list with loads of countries, some countries do contain some letters like é and á. I have tried to extract the data of the xml in two ways : 1 - simply download the whole thing into a String, which will result in those characters being seen as something like [] or on the Android emulator (and device) I will see a triangle with a ? in it... 2 - fetch the list with the SAXParser and XMLReader which will just throw an exception telling me that there is some content error... specifically at the line where the first country is with such a character... So is there some way to get this to work ? Can I read the iso-8859-1 encoded xml into the Parser ? Or is there some way to encode/decode the received data into something actually usable ? Any idea where the problem might be ? Thanks in advance for any hints, tips, code or explanation :D -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Bug? Invalidate causing unnecessary redraws.
It seems that adding a 1 pixel (1px) view stops this happening. On Feb 2, 11:55 pm, Romain Guy romain...@android.com wrote: Note that the bug is not due to an overlap of theinvalidateregion, it looks like the entire parent redraws in certain conditions. On Tue, Feb 2, 2010 at 3:45 PM, Romain Guy romain...@android.com wrote: This is a known issue that will be fixed in a future release. On Tue, Feb 2, 2010 at 12:47 PM, Keean Schupke keean.schu...@googlemail.com wrote: When I have two views directly next to each other in a layout, invalidating one causes _both_ to redraw. If I separate them with a one pixel margin (or a View used as a one pixel separator) invalidating one no longer causes the other to also be invalidated. This looks like an off-by-one bug in the core android View hierarchy. Can anyone comment on whether this is deliberate or whether it is a bug? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: reg AttributeSet
Figured out there is an internal implementation of XmlResourceParser. It works for compiled resources only. Are there any plans in the roadmap of coming up with an AttributeSet implementation for non-compiled files as well ? On Feb 2, 7:02 pm, priyanka 2priya...@gmail.com wrote: Hello, I'd like to use a non-compiled file (that I get dynamically from my server) in order to fetch the AttributeSet for a component. To put it another way - I'd like to create an AttributeSet at runtime. Is that possible? If the only way to do this is by implementing the AttributeSet interface, then can you please give me some pointers on how to go about it? I thought I might use XmlResourceParser class probably, but I am unable to create an object of XmlResourceParser at runtime with a non- compiled file. I am working on Android 2.0.1. I don't mind even if I have to use a newer SDK(2.1) in order to achieve this. Please feel free to ask for clarifications in case I haven't put across my point clearly. Thanks a lot, Priyanka -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Using WifiManager to connect to a network
I can't help with your protocol question, but the reason why specifying the SSID isn't working is because it needs to be a quoted value, e.g. wifiConfig.SSID = \test\; Neil On Feb 2, 8:30 pm, Daniel Rolph d...@rolph.com wrote: After digging around a little, I was able to put together the code to programmatically connect to an open network/AP. For some reason, specifying the SSID causes the code not to connect. WifiConfiguration wifiConfig = new WifiConfiguration(); wifiConfig.BSSID = 00:0C:41:F5:B0:08; wifiConfig.priority = 1; wifiConfig.allowedKeyManagement.set(KeyMgmt.NONE); wifiConfig.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP); wifiConfig.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN); wifiConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE); wifiConfig.status=WifiConfiguration.Status.ENABLED; WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); int netId = wifi.addNetwork(wifiConfig); wifi.enableNetwork(netId, true); I am curious about the behavior of the network activity that I am seeing. The N1 is constantly broadcasting Probe Requests. The Access Point is sending out Probe Responses. When I enable the network with the SDK, the N1 sends out a Probe Response with the SSID of the AccessPoint (probably determined from the Probe Response). The N1 then sends out an Association Request to the AP and negotiates the connection. Why can't I initiate an Association Request to the AP prior to receiving the AP Probe Response? Basically, I would like to already have the AP defined in my WifiConfiguration and be sending Association Requests prior to being in range of the AP. Is this possible or am I constrained by the protocol? Thank you very much! Dan On Feb 1, 2010, at 8:21 AM, Daniel Rolph wrote: Hello everyone, I am using a Nexus One with 2.1 SDK. I am having problems with a module in my application connecting programmatically to a network/AP. The code snippet that I am using is: WifiConfiguration wifiConfig = new WifiConfiguration(); wifiConfig.BSSID=00:0C:41:F5:B0:08; wifiConfig.SSID=test; WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); wifi.setWifiEnabled(true); int netId = wifi.addNetwork(wifiConfig); wifi.enableNetwork(netId, true); Monitoring the network, I see probe requests transmitting from the device, but I do not see an Authentication/Association request to the access point that I specify in the BSSID. Ultimately, I will perform a scan to determine valid AP BSSIDs, but for testing, I simply want to connect to a test AP which is in close proximity to my Nexus One. I have set the appropriate permissions in my manifest xml and am not seeing any negative log statements from adb. Any pointers or suggestions with using WifiManager to perform this action would be very appreciated. Thank you very much! Dan -- You received this message because you are subscribed to the Google 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: Why are my SharedPreferences suddenly deleted, after I updated my game in the Market?
No, I even don't know how to use sharedUserId's. Here is my Manifest: ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=digle.de.LeonardFrog android:versionCode=4 android:versionName=1.3 (beta) application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.LeonardFrog android:label=@string/app_name android:screenOrientation=portrait intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity activity android:name=.AGame android:label=@string/app_name android:screenOrientation=portrait /activity activity android:name=.AOptions android:label=@string/app_name android:screenOrientation=portrait /activity activity android:name=.AHighscore android:label=@string/app_name android:screenOrientation=portrait /activity activity android:name=.AInfo android:label=@string/app_name android:screenOrientation=portrait /activity meta-data android:name=ADMOB_PUBLISHER_ID android:value=*** / /application uses-sdk android:minSdkVersion=2 / !-- AdMob SDK permissions -- uses-permission android:name=android.permission.INTERNET / uses-permission android:name=android.permission.ACCESS_COARSE_LOCATION / /manifest Greetings! Martin On 3 Feb., 10:38, Lance Nanek lna...@gmail.com wrote: Did you change/add a sharedUserId in your manifest? On Feb 3, 3:40 am, Martin google-gro...@digle.de wrote: Hi! Why are my SharedPreferences suddenly deleted, after I updated my game in the Market? Here is the logcat: W/ApplicationContext( 1465): Attempt to read preferences file /data/ data/digle.de.LeonardFrog/shared_prefs/Highscore.xml without permission E/ApplicationContext( 1465): Couldn't rename file /data/data/ digle.de.LeonardFrog/shared_prefs/Highscore.xml to backup file /data/ data/digle.de.LeonardFrog/shared_prefs/Highscore.xml.bak E/ApplicationContext( 1465): Couldn't create directory for SharedPreferences file /data/data/digle.de.LeonardFrog/shared_prefs/ Highscore.xml Greetings, Martin -- You received this message because you are subscribed to the Google 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 change language settings
Hi We can change language options manually,But How to change the language settings on android phone through application Can u give me sample code -- You received this message because you are subscribed to the Google 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: RssFeed Update
Hi, Have you used partial wake lock? I got the similar problem in my app. I fixed it by using wake lock. Following is my code snippet. May be this will help you. PowerManager.WakeLock wl; try { PowerManager pm = (PowerManager) context .getSystemService(Context.POWER_SERVICE); wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, Nyros); if (wl != null) wl.acquire(); //do your stuff here } catch (Exception ex) { } finally { if (wl != null) wl.release(); } Thanks Regards, Raghavendra 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: getting the serial number
Hey, thanks Worked fine on G2. This is the code i used: #include sys/system_properties.h char buf[32]; buf[0] = 0; __system_property_get(ro.serialno,buf); Interestingly enough, i also tried this: char buf[2048]; if ((in = open(/proc/cpuinfo, O_RDONLY)) 0) debug(can't open); // 2mb at least, or some litebase tests will just skip over. else { if (read(in, buf, sizeof(buf)) 4) debug(can't read); else close(in); and it outputs: can't read Processor : ARMv6-compatible processor rev 2 (v6l) BogoMIPS : 383.38 Features : swp half thumb fastmult edsp java CPU implementer: 0x41 CPU architecture: 6TEJ CPU variant: 0x1 CPU part : 0xb36 CPU revision : 2 Hardware : sapphire Revision : 0080 Serial : The interesting thing is that Serial is 0! cheers, guich -- You received this message because you are subscribed to the Google 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 get a remote logcat on error?
Or is there another possibility to debug my game, while it is in the market? How can I intercept all the errors in my code to find out how I can solve them? If nobody has an answer to this, I have to put a try { ... } catch (Exception e) { /* send this exception and line number over internet to me */ } on EVERY line of code? For example: @Override public void onCreate(Bundle savedInstanceState) { try { DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); Global.screen_width = dm.widthPixels; Global.screen_height = dm.heightPixels; Global.screen_width_factor = 320/Global.screen_width; Global.screen_height_factor = 480/Global.screen_height; } catch (Exception e) { /* send exception - METRICS */ } try { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); this.getWindow().setFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN ); } catch (Exception e) { /* send exception - window */ } try { setContentView(R.layout.main); } catch (Exception e) { /* send exception - contentview */ } try { //Sound starten SharedPreferences prefs = getSharedPreferences(options, 0); Global.bgmusic=prefs.getBoolean(music, true); Global.soundeffects=prefs.getBoolean(soundeffects, true); } catch (Exception e) { /* send exception - start sound */ } try { b_start = (Button) findViewById(R.id.b_start); b_start.layout(120*Global.screen_width_factor, 55*Global.screen_height_factor, (120+buttonwidth)*Global.screen_width_factor, (55+buttonheight)* } catch (Exception e) { /* send exception - startbuttoncreated */ } and so on or is there a better solution? Greetings, Martin On 3 Feb., 10:11, Martin google-gro...@digle.de wrote: Hi! I have a game in the market and with flurry analytics, I receive all my errors. Here are some of them: 01/31/10 01:47:39 PM PST 0 class java.lang.IllegalArgumentException parameter must be a descendant of this view 02/02/10 12:40:41 PM PST 0 class java.lang.IllegalThreadStateException Thread already started. 01/26/10 09:25:36 PM PST 0 class java.lang.NullPointerException 1.0 (beta) uncaught Android 02/01/10 05:26:27 PM PST 0 class java.lang.OutOfMemoryError bitmap size exceeds VM budget 1.3 (beta) uncaught Android 01/29/10 10:23:10 AM PST 0 class java.lang.RuntimeException Adding window failed 1.0 (beta) uncaught Android 01/29/10 08:19:05 AM PST 0 class java.lang.RuntimeException Unable to start activity ComponentInfo{digle.de.LeonardFrog/ digle.de.LeonardFrog.AHighscore}: java.lang.NullPointerException 1.0 (beta) uncaught Android 01/27/10 01:09:35 AM PST 0 class java.lang.VerifyError digle.de.LeonardFrog.AHighscore 1.0 (beta) uncaught Android I want to solve them but I need a logcat. There is the application aLogcat in the Market, which displays the logcat on the mobile, but I need the logcat of my users without telling them to download this app, because many people are lazy and won't do it. How can I get this logcat? Is there maybe a library, which sends me the logcat on error? Greetings, Martin -- You received this message because you are subscribed to the Google 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] answer call using acceptCall() of Phone.java
Hey i got a function acceptCall() by which android receive call. the path is android.internal.telephony.Phone.java. Now you gays please tell me can i use it answer a call programmetically. Please you got any idea about it then share with me . or if you have any other idea about answering auto call then you can help me also. -- You received this message because you are subscribed to the Google 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] concept of user name
Hi, Is there a concept of user name in Android? Windows Mobile lets you enter a description of the owner of the phone; Palm OS has the concept of user name. But i couldn't find anything about this in Android. best, guich -- You received this message because you are subscribed to the Google 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: Cant find the solution for this GLSurfaceView error
Oh thanks .. got it On Wed, Feb 3, 2010 at 3:13 PM, Lance Nanek lna...@gmail.com wrote: The buffer needs to be direct so that it isn't moved around in memory. You can do this by creating it using ByteBuffer.allocateDirect. You can see examples in demos: http://developer.android.com/intl/de/resources/samples/ApiDemos/src/com/example/android/apis/graphics/TriangleRenderer.html On Feb 3, 4:04 am, satish bhoyar getsatonl...@gmail.com wrote: Hi all, I have a code for GLSurfaceView which runs fine with sdk 1.5. I am trying to use it in the sdk 2.0 I am getting following error - *Application called a GL11 Pointer method with an Indirect Buffer* This is the line at which the error is coming, *gl.glVertexPointer(3, GL10.GL_FLOAT, 0, slicesBuffers[i]); *Please anybody explains me why this error comes how to solve it? or any other suggestion is also good for me. Thanks, SaT -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: VerifyError - how can I solve this error?
On my mobile, I do NOT have the VerifyError! This is strange. I just get the Error-Messages from Flurry-Analytics from people, who downloaded my game in the market, so I think that these error-messages come from a specific Android OS? What does it mean that some part of a class failed verification? Which verification? Greetings, Martin On 2 Feb., 00:19, fadden fad...@android.com wrote: On Jan 30, 3:16 am, Martin google-gro...@digle.de wrote: I am analyzing my game with flurry-analytics and some people, who play my game, receive the Exception java.lang.VerifyError in my Highscore- Activity. What do I have to do to solve this error? To figure this out you really need to see the log message associated with the failure. Verification errors generally mean that some part of a class failed verification, and as a result the entire class has been rejected by the VM. It should be 100% repeatable. The logcat output will tell you in great detail what went wrong and where. Are the failures always associated with a specific version of the Android OS? -- You received this message because you are subscribed to the Google 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: TableLayout, Rotating
While I am at it: How can I enforce equal width on table columns? Is there a way to do in in layout/*.xml or do I have to render the content of my table programatically (getting screen dimensions, and creating the content of the table calls with computed width) Regards, Holger -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Help needed with parsing some XML data !
Btw I also have tried this instead : try { URL url = new URL(http://www.myserver.com/xmlstream;); URLConnection conn = url.openConnection(); InputStream is = conn.getInputStream(); Xml.parse(is, Xml.Encoding.ISO_8859_1, new ExampleHandler ()); } catch (Exception e) { throw new RuntimeException(e); } This time it wont just crash but for example if I print the output (through Log) I get Found attribute : Ã…land eilanden and Found attribute : Albanië instead of Albanié So any input on this ? On 3 feb, 10:44, MobDev developm...@mobilaria.com wrote: Actually this is the code for the second approach : /* Create a URL we want to load some xml-data from. */ URL url = new URL(http://www.myserver.com/xmlstream;); /* Get a SAXParser from the SAXPArserFactory. */ SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); /* Get the XMLReader of the SAXParser we created. */ XMLReader xr = sp.getXMLReader(); /* Create a new ContentHandler and apply it to the XML-Reader*/ ExampleHandler myExampleHandler = new ExampleHandler(); xr.setContentHandler(myExampleHandler); /* Parse the xml-data from our URL. */ xr.parse(new InputSource(url.openStream())); /* Parsing has finished. */ And the error I get is : At line 40, column 23: not well-formed (invalid token) which is around this XML line : Country ID=2 CName=Åland eilanden/ So where should I specifiy its an ISO-8859-1 ? Also I have been debugging the app, but I actually cannot see the stacktrace, could you please direct me on how to show it on NetBeans ? Every time I try to look at the exception thrown I will see several variables but StackTrace will be null... On 3 feb, 06:17, Bob Kerns r...@acm.org wrote: While I would expect your second approach to work, it's important to note that IT IS NOT REQUIRED TO WORK. The XML standard does not require XML processors to support anything other than UTF-8 or UTF-16. In this day and age, I would STRONGLY discourage use of anything other than UTF-8, or, rarely, UTF-16. Another factor to consider is how you're getting access to those characters. You must do this one of two ways: 1) Using a Reader set to read 8859-1 -or- 2) Using an input stream, giving the raw bytes to the parser, letting it decode the 8859-1 characters. You WILL FAIL (and this is probably your problem, would be my guess) if you try to read using a Reader that's expecting UTF-8. A stacktrace should show which problem you have. On Feb 2, 6:42 am, MobDev developm...@mobilaria.com wrote: Hi, I am downloading a xml-type file from a webserver which starts out with : ?xml version=1.0 encoding=iso-8859-1 ? afterwards I get a list with loads of countries, some countries do contain some letters like é and á. I have tried to extract the data of the xml in two ways : 1 - simply download the whole thing into a String, which will result in those characters being seen as something like [] or on the Android emulator (and device) I will see a triangle with a ? in it... 2 - fetch the list with the SAXParser and XMLReader which will just throw an exception telling me that there is some content error... specifically at the line where the first country is with such a character... So is there some way to get this to work ? Can I read the iso-8859-1 encoded xml into the Parser ? Or is there some way to encode/decode the received data into something actually usable ? Any idea where the problem might be ? Thanks in advance for any hints, tips, code or explanation :D -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Showing List of image in AbsoluteLayout
Hi, I have to display 10 images(which will be taken form url) and related Text Both imageUrl and text will come from XML parsing. My Question is how we can display image into scrollable format -- You received this message because you are subscribed to the Google 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] Showing List of image in AbsoluteLayout
Hi, I have to display 10 images and related Text i want to display into AbsoluteLayout and all 10 image should be in scrollable format as ListView. My Question is How we can Display all the image in ListView format.is there any way to put listView into absolute View. I m giving my xml plz help me. Any kind of help will be appreciated ?xml version=1.0 encoding=utf-8? AbsoluteLayout id=@+id/widget0 android:layout_width=fill_parent android:layout_height=fill_parent xmlns:android=http://schemas.android.com/apk/res/android; android:background=#ffb33155 ImageView android:background=@drawable/image1 android:layout_x=0px android:layout_y=-8px android:layout_height=wrap_content android:layout_width=wrap_content /ImageView ImageView android:layout_x=0px android:layout_y=-8px android:layout_height=wrap_content android:layout_width=wrap_content android:background=@drawable/ star /ImageView TextView android:layout_x=0px android:clickable=true android:focusableInTouchMode=true android:textColor=# android:background=#bbb33155 android:layout_y=202px android:layout_height=40px android:textSize=30px android:text=Hello This is Text View android:layout_width=fill_parent /TextView /AbsoluteLayout Best Pankaj Nigam 9702861411 -- You received this message because you are subscribed to the Google 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: Splitting connections?
Well, you' have to modify your routing tables. I see there's /system/ bin/route, and it worked to add a default gateway, running as root. You WILL have to be root; if you haven't rooted your phone, you will need to. /system/bin/route seems to lack many of the normal features -- the BusyBox one seems more complete. Depending on your environment, your network administrators may not be happy with you if you do this. In some scenarios, they might even be justified -- but then you shouldn't have access with your phone in the first place. I'd be happy to hear there's a saner way to do this, but I don't think there is. Usually, you'd just turn off WiFi, but that won't work if you need both from the same app at the same time! On Feb 2, 9:42 am, Eric Crump synesthe...@gmail.com wrote: I have an app that runs on a closed network with no internet access. I connect to it through wifi. My app also uses Google Maps. Is there a way to make the MapView still pull from my 3G connection while the rest of the app uses the wifi? The issue is once connected to the wifi, maps tries to pull from the internet and can't get there so my MapView is always blank. -- You received this message because you are subscribed to the Google 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] NullPoinerException in XML
Hi all, In the below XML, I'm getting NullPointerException. What is the reason behind that? I also want scroll bars in th same XML. How to do that? ? xml version=*1.0* encoding=*utf-8*? ? xml version=*1.0* encoding=*utf-8*? TabHost xmlns:android=*http://schemas.android.com/apk/res/android* android:id =*@+id/my_tabhost* android:layout_width =*fill_parent* android:layout_height =*fill_parent* android:background =*#ff* TabWidget android:id=*@android:id/tabs* android:layout_width=*fill_parent* android:layout_height=*65px*/ FrameLayout android:id=*@android:id/tabcontent* android:layout_width=*fill_parent* android:layout_height=*200px* android:paddingTop=*65px* TableLayout android:id=*@+id/TableLayout01* android:layout_width=*fill_parent* android:layout_height=*fill_parent* xmlns:android=*http://schemas.android.com/apk/res/android* TableRow TextView android:id=*@+id/lbl1* android:layout_width=*wrap_content* android:layout_height=*wrap_content* android:layout_column=*0* **android:layout_marginTop=*10dip* android:text=*@string/lbl1*/ Spinner android:id=*@+id/spinner* android:layout_width=*fill_parent* android:layout_height=*wrap_content* android:drawSelectorOnTop=*true* android:prompt=*@string/planet_prompt*/ / TableRow / TableLayout / FrameLayout / TabHost Warm Regards, Chirayu Dalwadi -- You received this message because you are subscribed to the Google 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] concept of user name
Is there a concept of user name in Android? Windows Mobile lets you enter a description of the owner of the phone; Palm OS has the concept of user name. But i couldn't find anything about this in Android. The device itself does not really track this anywhere. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] how to identify the views part of the current screen
Hi All, Can anyone give an idea how to identify the views part of the active screen[i.e current running activity on the phone]. E.g after launching uiEditContactActivity,how can I identify the views [ several fields, buttons etc] part of that screen. I am trying to modify monkey, such that for creating a contact, it should launch Edit Contacts Activity and fill the respective views [name, number etc]. Thanks, Ganesh -- You received this message because you are subscribed to the Google 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: Cant find the solution for this GLSurfaceView error
hi lance, please can u suggest me some good links or books regarding drawing cylinder some polygons. thanks, satish On Wed, Feb 3, 2010 at 3:13 PM, Lance Nanek lna...@gmail.com wrote: The buffer needs to be direct so that it isn't moved around in memory. You can do this by creating it using ByteBuffer.allocateDirect. You can see examples in demos: http://developer.android.com/intl/de/resources/samples/ApiDemos/src/com/example/android/apis/graphics/TriangleRenderer.html On Feb 3, 4:04 am, satish bhoyar getsatonl...@gmail.com wrote: Hi all, I have a code for GLSurfaceView which runs fine with sdk 1.5. I am trying to use it in the sdk 2.0 I am getting following error - *Application called a GL11 Pointer method with an Indirect Buffer* This is the line at which the error is coming, *gl.glVertexPointer(3, GL10.GL_FLOAT, 0, slicesBuffers[i]); *Please anybody explains me why this error comes how to solve it? or any other suggestion is also good for me. Thanks, SaT -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Help needed with parsing some XML data !
Well, you found one way to get the encoding in there. A few more: InputSource.setEncoding(iso-8859-1) new InputStreamReader(stream, iso-8859-1); I'd argue that it should have gotten it from the ?xml... encoding=iso-8859-1? -- I'm a bit surprised it didn't. But it's something I'd never rely on if I know the encoding. Anyway, re: your problem below. It's probably working right, up to the point of the log statement. The log stream is probably taking those bytes, and then later they're being interpreted as UTF-8. or it's taking the characters from the string, and interpreting them as UTF-8 (via String.getBytes()) and passing them off to a log stream that doesn't know about UTF-8. Try logging to a file. Or better yet, create test cases, and verify the correct operation of your code via test suite, rather than via log statements. But if you have any control or influence over the server -- fix the problem there. ISO-8859-* should be of purely historical interest in interpreting old documents. The first draft of ISO-10646 came out nearly 20 years ago, and UTF-8 has been around for nearly 18 years. The world is international. It's time to put a stake in the heart of these national encodings. On Feb 3, 2:55 am, MobDev developm...@mobilaria.com wrote: Btw I also have tried this instead : try { URL url = new URL(http://www.myserver.com/xmlstream;); URLConnection conn = url.openConnection(); InputStream is = conn.getInputStream(); Xml.parse(is, Xml.Encoding.ISO_8859_1, new ExampleHandler ()); } catch (Exception e) { throw new RuntimeException(e); } This time it wont just crash but for example if I print the output (through Log) I get Found attribute : Ã…land eilanden and Found attribute : Albanië instead of Albanié So any input on this ? On 3 feb, 10:44, MobDev developm...@mobilaria.com wrote: Actually this is the code for the second approach : /* Create a URL we want to load some xml-data from. */ URL url = new URL(http://www.myserver.com/xmlstream;); /* Get a SAXParser from the SAXPArserFactory. */ SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); /* Get the XMLReader of the SAXParser we created. */ XMLReader xr = sp.getXMLReader(); /* Create a new ContentHandler and apply it to the XML-Reader*/ ExampleHandler myExampleHandler = new ExampleHandler(); xr.setContentHandler(myExampleHandler); /* Parse the xml-data from our URL. */ xr.parse(new InputSource(url.openStream())); /* Parsing has finished. */ And the error I get is : At line 40, column 23: not well-formed (invalid token) which is around this XML line : Country ID=2 CName=Åland eilanden/ So where should I specifiy its an ISO-8859-1 ? Also I have been debugging the app, but I actually cannot see the stacktrace, could you please direct me on how to show it on NetBeans ? Every time I try to look at the exception thrown I will see several variables but StackTrace will be null... On 3 feb, 06:17, Bob Kerns r...@acm.org wrote: While I would expect your second approach to work, it's important to note that IT IS NOT REQUIRED TO WORK. The XML standard does not require XML processors to support anything other than UTF-8 or UTF-16. In this day and age, I would STRONGLY discourage use of anything other than UTF-8, or, rarely, UTF-16. Another factor to consider is how you're getting access to those characters. You must do this one of two ways: 1) Using a Reader set to read 8859-1 -or- 2) Using an input stream, giving the raw bytes to the parser, letting it decode the 8859-1 characters. You WILL FAIL (and this is probably your problem, would be my guess) if you try to read using a Reader that's expecting UTF-8. A stacktrace should show which problem you have. On Feb 2, 6:42 am, MobDev developm...@mobilaria.com wrote: Hi, I am downloading a xml-type file from a webserver which starts out with : ?xml version=1.0 encoding=iso-8859-1 ? afterwards I get a list with loads of countries, some countries do contain some letters like é and á. I have tried to extract the data of the xml in two ways : 1 - simply download the whole thing into a String, which will result in those characters being seen as something like [] or on the Android emulator (and device) I will see a triangle with a ? in it... 2 - fetch the list with the SAXParser and XMLReader which will just throw an exception telling me that there is some content error... specifically at the line where the first country is with such a character... So is there some way to get this to work ? Can I read the iso-8859-1 encoded xml into the Parser ? Or is there some way to encode/decode the received data into something actually usable ? Any idea where the problem might be ?
[android-developers] GUI/CUI FTP Client
If you like a file manager-type GUI with console based CUI terminal, Runftp is what you want to have. You can type and test any basic FTP commands in the terminal, and viewing through the files and directories in a two-pane tree-style graphical navigation at the same time. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Emulating a Droid
On Feb 1, 11:13 pm, fadden fad...@android.com wrote: Are you looking for: http://developer.android.com/guide/developing/tools/avd.html ? Thanks for the sarcasm. No, the docs don't say how to do this. On Feb 2, 7:48 am, String sterling.ud...@googlemail.com wrote: Click on Window | Android SDK and AVD Manager, click New. Select a Target of Android 2.0.1 (the current OS version on the Droid) and a Skin of WVGA854. That's it. Thanks String, that's what I needed. On Feb 3, 6:49 am, Anthoni anthoni.gard...@gmail.com wrote: Just to add, it would be useful if there was a listing somewhere that showed all the different AVD settings for each phone supported by Android. This would help people like myself who do not have access to these devices. At least we will know if they work or look ugly on the different phones etc. Yes, exactly, I agree. When you set up an emulation there's too many options, how do you really know if you are going to see the same as you would on each device? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Unable to set Camera Picture Size on Samsung Galaxy
I believe it's a Samsung Galaxy problem, as it works on both G1 and Hero. I'm setting PictureSize, but the change doesn't seem to be registered by the device. Creating a Bitmap from the full-size image unfortunately throws an OutOfMemoryException, and I'm unfortunately unable to guarantee enough free memory for manipulation of a 5mp image! On Jan 25, 6:50 pm, Streets Of Boston flyingdutc...@gmail.com wrote: Do set the PictureSize or the PreviewSize? If you set the preview-size, it won't affect the size of the picture actually taken. Use the picture-size parameter for that. That has been working on my G1 and Nexus1. BTW: You should be able to obtain a full-sized image (3MP or 5MP) from onPictureTaken and creating a bitmap out of it. I'm writing a camera- app and it works fine on my G1 and Nexus1. You have to be very very careful with your memory-usage, though. On Jan 25, 7:56 am,enienipath...@gmail.com wrote: As title - having tried everything I could find already suggested, I've completely run out of options. I'm unable to set the picture size taken by the camera on the Samsung Galaxy. I don't set preview size anywhere and I've tried the ShutterCallback trick. On checking the camera parameters before and after attempting to change the size, I get the correct results - the camera *reports* that its size has now been changed... ...however, the size of the byte array I'm receiving in the onPictureTaken() callback is only consistent with the camera's default (enormous) image - and forces an OutOfMemoryError when I attempt to decode it into a bitmap! It looks like I'm having a similar issue to this user:http://groups.google.com/group/android-developers/browse_thread/threa... - but unfortunately it looks like no solution was found then, either : ( Does anyone have any ideas...? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Using WifiManager to connect to a network
Neil, Thanks for the catch on the SSID. Actually, I find that I can only connect when I do not specify the SSID. Documentation on wifi management is a little hard to come by. I am learning the wifi packages and device/driver functionality through trial and error, logging, and network monitoring. I'll eventually get there. Dan On Feb 3, 2010, at 5:11 AM, Neil wrote: I can't help with your protocol question, but the reason why specifying the SSID isn't working is because it needs to be a quoted value, e.g. wifiConfig.SSID = \test\; Neil On Feb 2, 8:30 pm, Daniel Rolph d...@rolph.com wrote: After digging around a little, I was able to put together the code to programmatically connect to an open network/AP. For some reason, specifying the SSID causes the code not to connect. WifiConfiguration wifiConfig = new WifiConfiguration(); wifiConfig.BSSID = 00:0C:41:F5:B0:08; wifiConfig.priority = 1; wifiConfig.allowedKeyManagement.set(KeyMgmt.NONE); wifiConfig.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP); wifiConfig.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN); wifiConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE); wifiConfig.status=WifiConfiguration.Status.ENABLED; WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); int netId = wifi.addNetwork(wifiConfig); wifi.enableNetwork(netId, true); I am curious about the behavior of the network activity that I am seeing. The N1 is constantly broadcasting Probe Requests. The Access Point is sending out Probe Responses. When I enable the network with the SDK, the N1 sends out a Probe Response with the SSID of the AccessPoint (probably determined from the Probe Response). The N1 then sends out an Association Request to the AP and negotiates the connection. Why can't I initiate an Association Request to the AP prior to receiving the AP Probe Response? Basically, I would like to already have the AP defined in my WifiConfiguration and be sending Association Requests prior to being in range of the AP. Is this possible or am I constrained by the protocol? Thank you very much! Dan On Feb 1, 2010, at 8:21 AM, Daniel Rolph wrote: Hello everyone, I am using a Nexus One with 2.1 SDK. I am having problems with a module in my application connecting programmatically to a network/AP. The code snippet that I am using is: WifiConfiguration wifiConfig = new WifiConfiguration(); wifiConfig.BSSID=00:0C:41:F5:B0:08; wifiConfig.SSID=test; WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); wifi.setWifiEnabled(true); int netId = wifi.addNetwork(wifiConfig); wifi.enableNetwork(netId, true); Monitoring the network, I see probe requests transmitting from the device, but I do not see an Authentication/Association request to the access point that I specify in the BSSID. Ultimately, I will perform a scan to determine valid AP BSSIDs, but for testing, I simply want to connect to a test AP which is in close proximity to my Nexus One. I have set the appropriate permissions in my manifest xml and am not seeing any negative log statements from adb. Any pointers or suggestions with using WifiManager to perform this action would be very appreciated. Thank you very much! Dan -- You received this message because you are subscribed to the Google 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] Re: listview is getting me mad plase help
i didnt do it yet. but you can get a sample from here, i am folowing this book http://apress.com/book/downloadfile/4433 there is a zip file, extract it and navigate to FancyLists\RateList\. there you have a full and working example. please send the question to the list wo everyone can get the answer 2010/2/3 Abhi abhinay.pothuga...@gmail.com Hi David, Are you able to capture the checkbox click in the list view ?if so can you pls send me the code I am also facing the same problem as you are facing, I am having a list view with Checkbox,If user clicks on the listrow then the checkbox needs to get selected and on further click it needs to unselect Can you pls help me in solving this On Jan 31, 9:32 pm, David Fire ddf...@gmail.com wrote: SOLVED all the items in the row must be facusable=false i just put it David 2010/1/31 free1000 prwfree...@googlemail.com Just out of curiosity why do you have this in the ListView definition android:isScrollContainer=true Not saying it has anything to do with your problem,just wondering. The list knows how to scroll without this attribute being set. P On Jan 30, 5:08 pm, David Fire ddf...@gmail.com wrote: hi i cant press any item on my listview nor in the emulator nor in a real phone. item layout ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android= http://schemas.android.com/apk/res/android; android:id=@+id/LinearLayout01 android:layout_width=wrap_content android:layout_height=wrap_content android:orientation=horizontal CheckBox android:id=@+id/RuleEnable android:text= android:layout_width=wrap_content android:layout_height=wrap_content/CheckBox TextView android:id=@+id/RuleName android:layout_width=wrap_content android:layout_height=wrap_content android:text= android:focusable=true /TextView /LinearLayout listview layout ListView android:id=@+id/Listado android:layout_width=fill_parent android:layout_height=250px android:isScrollContainer=true android:drawSelectorOnTop=false android:choiceMode=singleChoice/ListView some code public class GuiActivity extends Activity implements View.OnClickListener, OnItemClickListener{ //lista means list in spanish lista = (ListView)findViewById(R.id.Listado); RuleList = new ArrayListSMSRule(); loadRuleList(); adapter=new SMSRuleAdaptor(this,RuleList); lista.setAdapter(adapter); lista.setOnItemClickListener(this); this method is never called public void onItemClick(AdapterView? arg0, View arg1, int arg2, long id) { enable.setText(id: +id); } -- (\__/) (='.'=)This is Bunny. Copy and paste bunny into your ()_()signature to help him gain world domination. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- (\__/) (='.'=)This is Bunny. Copy and paste bunny into your ()_()signature to help him gain world domination. -- (\__/) (='.'=)This is Bunny. Copy and paste bunny into your ()_()signature to help him gain world domination. -- You received this message because you are subscribed to the Google 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] Why setting TextView.Ellipsize as Marquee cause its sibling view in linearlayout redraw
Hi We are using TextView's Ellipsize function to scrolling text in it and there many other controls in our window. We noticed CPU would go up to 50% if text started scrolling. After digging deeper, we found all controls in our layout kept drawing when texts scrolling. We wonder why? And how to avoid all controls redrawing? Best Regards James -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Help needed with parsing some XML data !
well to begin with : thx for the expalanation :D I was wondering about your statement : Try logging to a file. Or better yet, create test cases, and verify the correct operation of your code via test suite, rather than via log statements. I already tried in a test case, which was to write the incoming data to a AlertDialog, but the result was that those characters are shwon on-screen with a rectangle with a ? in it... My idea (and test case) would be to stream a list of countries, and afterwards show this list onscreen so the user can select one... Our problem is that the whole system I am using is based on the ISO norm and cannot be changed to UTF-8 in a short period of time... Or am I misinterpreting your test cases and test suite ? And if so how should it have been interpreted ? On 3 feb, 13:26, Bob Kerns r...@acm.org wrote: Well, you found one way to get the encoding in there. A few more: InputSource.setEncoding(iso-8859-1) new InputStreamReader(stream, iso-8859-1); I'd argue that it should have gotten it from the ?xml... encoding=iso-8859-1? -- I'm a bit surprised it didn't. But it's something I'd never rely on if I know the encoding. Anyway, re: your problem below. It's probably working right, up to the point of the log statement. The log stream is probably taking those bytes, and then later they're being interpreted as UTF-8. or it's taking the characters from the string, and interpreting them as UTF-8 (via String.getBytes()) and passing them off to a log stream that doesn't know about UTF-8. Try logging to a file. Or better yet, create test cases, and verify the correct operation of your code via test suite, rather than via log statements. But if you have any control or influence over the server -- fix the problem there. ISO-8859-* should be of purely historical interest in interpreting old documents. The first draft of ISO-10646 came out nearly 20 years ago, and UTF-8 has been around for nearly 18 years. The world is international. It's time to put a stake in the heart of these national encodings. On Feb 3, 2:55 am, MobDev developm...@mobilaria.com wrote: Btw I also have tried this instead : try { URL url = new URL(http://www.myserver.com/xmlstream;); URLConnection conn = url.openConnection(); InputStream is = conn.getInputStream(); Xml.parse(is, Xml.Encoding.ISO_8859_1, new ExampleHandler ()); } catch (Exception e) { throw new RuntimeException(e); } This time it wont just crash but for example if I print the output (through Log) I get Found attribute : Ã…land eilanden and Found attribute : Albanië instead of Albanié So any input on this ? On 3 feb, 10:44, MobDev developm...@mobilaria.com wrote: Actually this is the code for the second approach : /* Create a URL we want to load some xml-data from. */ URL url = new URL(http://www.myserver.com/xmlstream;); /* Get a SAXParser from the SAXPArserFactory. */ SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); /* Get the XMLReader of the SAXParser we created. */ XMLReader xr = sp.getXMLReader(); /* Create a new ContentHandler and apply it to the XML-Reader*/ ExampleHandler myExampleHandler = new ExampleHandler(); xr.setContentHandler(myExampleHandler); /* Parse the xml-data from our URL. */ xr.parse(new InputSource(url.openStream())); /* Parsing has finished. */ And the error I get is : At line 40, column 23: not well-formed (invalid token) which is around this XML line : Country ID=2 CName=Åland eilanden/ So where should I specifiy its an ISO-8859-1 ? Also I have been debugging the app, but I actually cannot see the stacktrace, could you please direct me on how to show it on NetBeans ? Every time I try to look at the exception thrown I will see several variables but StackTrace will be null... On 3 feb, 06:17, Bob Kerns r...@acm.org wrote: While I would expect your second approach to work, it's important to note that IT IS NOT REQUIRED TO WORK. The XML standard does not require XML processors to support anything other than UTF-8 or UTF-16. In this day and age, I would STRONGLY discourage use of anything other than UTF-8, or, rarely, UTF-16. Another factor to consider is how you're getting access to those characters. You must do this one of two ways: 1) Using a Reader set to read 8859-1 -or- 2) Using an input stream, giving the raw bytes to the parser, letting it decode the 8859-1 characters. You WILL FAIL (and this is probably your problem, would be my guess) if you try to read using a Reader that's expecting UTF-8. A stacktrace should show which problem you have. On Feb 2, 6:42 am, MobDev developm...@mobilaria.com wrote: Hi, I am downloading a xml-type file from a webserver which starts
[android-developers] VBO and DrawTex support
I know VBO's and DrawTex extensions are not a requirement for all devices to have, but does anyone have a list of what devices don't actually support them? I haven't actually come across any yet... 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: Help needed with parsing some XML data !
well to begin with : thx for the expalanation :D I was wondering about your statement : Try logging to a file. Or better yet, create test cases, and verify the correct operation of your code via test suite, rather than via log statements. I already tried in a test case, which was to write the incoming data to a AlertDialog, but the result was that those characters are shwon on-screen with a rectangle with a ? in it... My idea (and test case) would be to stream a list of countries, and afterwards show this list onscreen so the user can select one... Our problem is that the whole system I am using is based on the ISO norm and cannot be changed to UTF-8 in a short period of time... Or am I misinterpreting your test cases and test suite ? And if so how should it have been interpreted ? On 3 feb, 13:26, Bob Kerns r...@acm.org wrote: Well, you found one way to get the encoding in there. A few more: InputSource.setEncoding(iso-8859-1) new InputStreamReader(stream, iso-8859-1); I'd argue that it should have gotten it from the ?xml... encoding=iso-8859-1? -- I'm a bit surprised it didn't. But it's something I'd never rely on if I know the encoding. Anyway, re: your problem below. It's probably working right, up to the point of the log statement. The log stream is probably taking those bytes, and then later they're being interpreted as UTF-8. or it's taking the characters from the string, and interpreting them as UTF-8 (via String.getBytes()) and passing them off to a log stream that doesn't know about UTF-8. Try logging to a file. Or better yet, create test cases, and verify the correct operation of your code via test suite, rather than via log statements. But if you have any control or influence over the server -- fix the problem there. ISO-8859-* should be of purely historical interest in interpreting old documents. The first draft of ISO-10646 came out nearly 20 years ago, and UTF-8 has been around for nearly 18 years. The world is international. It's time to put a stake in the heart of these national encodings. On Feb 3, 2:55 am, MobDev developm...@mobilaria.com wrote: Btw I also have tried this instead : try { URL url = new URL(http://www.myserver.com/xmlstream;); URLConnection conn = url.openConnection(); InputStream is = conn.getInputStream(); Xml.parse(is, Xml.Encoding.ISO_8859_1, new ExampleHandler ()); } catch (Exception e) { throw new RuntimeException(e); } This time it wont just crash but for example if I print the output (through Log) I get Found attribute : Ã…land eilanden and Found attribute : Albanië instead of Albanié So any input on this ? On 3 feb, 10:44, MobDev developm...@mobilaria.com wrote: Actually this is the code for the second approach : /* Create a URL we want to load some xml-data from. */ URL url = new URL(http://www.myserver.com/xmlstream;); /* Get a SAXParser from the SAXPArserFactory. */ SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); /* Get the XMLReader of the SAXParser we created. */ XMLReader xr = sp.getXMLReader(); /* Create a new ContentHandler and apply it to the XML-Reader*/ ExampleHandler myExampleHandler = new ExampleHandler(); xr.setContentHandler(myExampleHandler); /* Parse the xml-data from our URL. */ xr.parse(new InputSource(url.openStream())); /* Parsing has finished. */ And the error I get is : At line 40, column 23: not well-formed (invalid token) which is around this XML line : Country ID=2 CName=Åland eilanden/ So where should I specifiy its an ISO-8859-1 ? Also I have been debugging the app, but I actually cannot see the stacktrace, could you please direct me on how to show it on NetBeans ? Every time I try to look at the exception thrown I will see several variables but StackTrace will be null... On 3 feb, 06:17, Bob Kerns r...@acm.org wrote: While I would expect your second approach to work, it's important to note that IT IS NOT REQUIRED TO WORK. The XML standard does not require XML processors to support anything other than UTF-8 or UTF-16. In this day and age, I would STRONGLY discourage use of anything other than UTF-8, or, rarely, UTF-16. Another factor to consider is how you're getting access to those characters. You must do this one of two ways: 1) Using a Reader set to read 8859-1 -or- 2) Using an input stream, giving the raw bytes to the parser, letting it decode the 8859-1 characters. You WILL FAIL (and this is probably your problem, would be my guess) if you try to read using a Reader that's expecting UTF-8. A stacktrace should show which problem you have. On Feb 2, 6:42 am, MobDev developm...@mobilaria.com wrote: Hi, I am downloading a xml-type file from a webserver which starts
[android-developers] Canvas drawing
Hi all. When overiding onDraw() in my View, is it possible to say Don't draw anything new, just keep what was there the last time? In my app, I only want to draw when I get a sensor change. These changes come intermittently. However the draw() routine is being called continuously, many times per second, and is causing a lot of overhead. I want to hold the last screen output until I have new readings to pass in. Is this possible? -- You received this message because you are subscribed to the Google 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 drawing
your draw routine should only be called if you call invalidate on your view or its parent view. On Feb 3, 7:46 am, Neilz neilhorn...@googlemail.com wrote: Hi all. When overiding onDraw() in my View, is it possible to say Don't draw anything new, just keep what was there the last time? In my app, I only want to draw when I get a sensor change. These changes come intermittently. However the draw() routine is being called continuously, many times per second, and is causing a lot of overhead. I want to hold the last screen output until I have new readings to pass in. Is this possible? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: how to use MediaRecorder to record highest quality video?
Isn't there anyone out there who can tell me not to pursue this with a good reason? I am spending too much of my time figuring this out and if there is some knowledgeable person out there who can give me a straight answer, I would really appreciate it. Thanks, Abhi On Feb 1, 9:12 am, Abhi abhishek.r.sha...@gmail.com wrote: I am still looking for some help around this topic? Any help would be appreciated. Thanks, Abhi On Jan 29, 1:04 pm, Abhi abhishek.r.sha...@gmail.com wrote: Is rooting the device the only solution? On Jan 28, 2:27 pm, Abhi abhishek.r.sha...@gmail.com wrote: Anyone? On Jan 28, 1:33 pm, Abhi abhishek.r.sha...@gmail.com wrote: Hi, Is there a way to get the best quality of video recording possible usingMediaRecorder? the camcorder app does a lot better in terms of quality. Any help? Thanks, A- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] what are the possible connections?
Hi, What kind of connections can we open on Android? Which of the following is possible? - USB - Serial port - Infrared I know that Bluetooth is possible, but are the other ones too? And if yes, which classes i have to use? thanks for the feedback guich -- You received this message because you are subscribed to the Google 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 drawing
It is being called... between 5-10 times a second. I just set up a routine to check. And I'm most definitely not calling invalidate() on these occasions. On Feb 3, 2:04 pm, schwiz sch...@gmail.com wrote: your draw routine should only be called if you call invalidate on your view or its parent view. On Feb 3, 7:46 am, Neilz neilhorn...@googlemail.com wrote: Hi all. When overiding onDraw() in my View, is it possible to say Don't draw anything new, just keep what was there the last time? In my app, I only want to draw when I get a sensor change. These changes come intermittently. However the draw() routine is being called continuously, many times per second, and is causing a lot of overhead. I want to hold the last screen output until I have new readings to pass in. Is this possible? -- You received this message because you are subscribed to the Google 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] Including virtual keyboard widget in layout
I want to include virtual keyboard in my layout file.I am using foll. code. Is there anything I am missing ? android.inputmethodservice.KeyboardView android:id=@android:id/keyboardView android:background=@android:color/transparent android:layout_alignParentBottom=true android:layout_width=fill_parent android:layout_height=wrap_content android:keyTextSize=22sp / Is there anyone who know about it ? Thanks in advance, Swapnil -- You received this message because you are subscribed to the Google 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: concept of user name
Looking at Google Experience devices; they are activates with the users Google Account. Using AccountManager and associated classes (starting 2.0), you can pull this activation user name and other attributes. On Feb 3, 4:03 am, Mark Murphy mmur...@commonsware.com wrote: Is there a concept of user name in Android? Windows Mobile lets you enter a description of the owner of the phone; Palm OS has the concept of user name. But i couldn't find anything about this in Android. The device itself does not really track this anywhere. -- Mark Murphy (a Commons Guy)http://commonsware.com Android App Developer Books:http://commonsware.com/books.html -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: XmlPullParserException: expected: START_TAG
Hi Pankaj! Have you checked if your xml file is well-formed? On 2 feb, 09:57, Pankaj Deshpande pcdeshpande...@gmail.com wrote: Hi all, I am developing an application which uses KSOAP2 with Android 2.0. But I am getting error org.xmlpull.v1.XmlPullParserException: expected: START_TAG can anyone tell me why this is happening?? Regards, Pankaj Deshpande -- Android Application Developer Ruby Solutions, Pune. 09823637153 -- You received this message because you are subscribed to the Google 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] New TypeName for NetworkInfo
Has anyone notice that Android 2.1 (or may be even earlier) has additional Network Type? Namely: ConnectivityManager.MOBILE_MMS 2 ConnectivityManager.MOBILE_SUPL 3 ConnectivityManager.MOBILE_DUN 4 ConnectivityManager.MOBILE_HIPRI 5 In addition to the original types in the document. MOBILE 0 WIFI 1 Does anyone know what those new types corresponds to? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Help needed with parsing some XML data !
well to begin with : thx for the expalanation :D I was wondering about your statement : Try logging to a file. Or better yet, create test cases, and verify the correct operation of your code via test suite, rather than via log statements. I already tried in a test case, which was to write the incoming data to a AlertDialog, but the result was that those characters are shwon on-screen with a rectangle with a ? in it... My idea (and test case) would be to stream a list of countries, and afterwards show this list onscreen so the user can select one... Our problem is that the whole system I am using is based on the ISO norm and cannot be changed to UTF-8 in a short period of time... Or am I misinterpreting your test cases and test suite ? And if so how should it have been interpreted ? On 3 feb, 13:26, Bob Kerns r...@acm.org wrote: Well, you found one way to get the encoding in there. A few more: InputSource.setEncoding(iso-8859-1) new InputStreamReader(stream, iso-8859-1); I'd argue that it should have gotten it from the ?xml... encoding=iso-8859-1? -- I'm a bit surprised it didn't. But it's something I'd never rely on if I know the encoding. Anyway, re: your problem below. It's probably working right, up to the point of the log statement. The log stream is probably taking those bytes, and then later they're being interpreted as UTF-8. or it's taking the characters from the string, and interpreting them as UTF-8 (via String.getBytes()) and passing them off to a log stream that doesn't know about UTF-8. Try logging to a file. Or better yet, create test cases, and verify the correct operation of your code via test suite, rather than via log statements. But if you have any control or influence over the server -- fix the problem there. ISO-8859-* should be of purely historical interest in interpreting old documents. The first draft of ISO-10646 came out nearly 20 years ago, and UTF-8 has been around for nearly 18 years. The world is international. It's time to put a stake in the heart of these national encodings. On Feb 3, 2:55 am, MobDev developm...@mobilaria.com wrote: Btw I also have tried this instead : try { URL url = new URL(http://www.myserver.com/xmlstream;); URLConnection conn = url.openConnection(); InputStream is = conn.getInputStream(); Xml.parse(is, Xml.Encoding.ISO_8859_1, new ExampleHandler ()); } catch (Exception e) { throw new RuntimeException(e); } This time it wont just crash but for example if I print the output (through Log) I get Found attribute : Ã…land eilanden and Found attribute : Albanië instead of Albanié So any input on this ? On 3 feb, 10:44, MobDev developm...@mobilaria.com wrote: Actually this is the code for the second approach : /* Create a URL we want to load some xml-data from. */ URL url = new URL(http://www.myserver.com/xmlstream;); /* Get a SAXParser from the SAXPArserFactory. */ SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); /* Get the XMLReader of the SAXParser we created. */ XMLReader xr = sp.getXMLReader(); /* Create a new ContentHandler and apply it to the XML-Reader*/ ExampleHandler myExampleHandler = new ExampleHandler(); xr.setContentHandler(myExampleHandler); /* Parse the xml-data from our URL. */ xr.parse(new InputSource(url.openStream())); /* Parsing has finished. */ And the error I get is : At line 40, column 23: not well-formed (invalid token) which is around this XML line : Country ID=2 CName=Åland eilanden/ So where should I specifiy its an ISO-8859-1 ? Also I have been debugging the app, but I actually cannot see the stacktrace, could you please direct me on how to show it on NetBeans ? Every time I try to look at the exception thrown I will see several variables but StackTrace will be null... On 3 feb, 06:17, Bob Kerns r...@acm.org wrote: While I would expect your second approach to work, it's important to note that IT IS NOT REQUIRED TO WORK. The XML standard does not require XML processors to support anything other than UTF-8 or UTF-16. In this day and age, I would STRONGLY discourage use of anything other than UTF-8, or, rarely, UTF-16. Another factor to consider is how you're getting access to those characters. You must do this one of two ways: 1) Using a Reader set to read 8859-1 -or- 2) Using an input stream, giving the raw bytes to the parser, letting it decode the 8859-1 characters. You WILL FAIL (and this is probably your problem, would be my guess) if you try to read using a Reader that's expecting UTF-8. A stacktrace should show which problem you have. On Feb 2, 6:42 am, MobDev developm...@mobilaria.com wrote: Hi, I am downloading a xml-type file from a webserver which starts
[android-developers] Re: Why are my SharedPreferences suddenly deleted, after I updated my game in the Market?
There used to be an old old bug where shared preferences would sporadically just disappear. Your post inspired me to do some research and find out if that ever got fixed... En route I found this for you: http://groups.google.com/group/android-developers/browse_thread/thread/246aae66e0caf302/908be552b1d86158?lnk=gstq=Shared+Preferences#908be552b1d86158 On Feb 3, 12:40 am, Martin google-gro...@digle.de wrote: Hi! Why are my SharedPreferences suddenly deleted, after I updated my game in the Market? Here is the logcat: W/ApplicationContext( 1465): Attempt to read preferences file /data/ data/digle.de.LeonardFrog/shared_prefs/Highscore.xml without permission E/ApplicationContext( 1465): Couldn't rename file /data/data/ digle.de.LeonardFrog/shared_prefs/Highscore.xml to backup file /data/ data/digle.de.LeonardFrog/shared_prefs/Highscore.xml.bak E/ApplicationContext( 1465): Couldn't create directory for SharedPreferences file /data/data/digle.de.LeonardFrog/shared_prefs/ Highscore.xml Greetings, Martin -- You received this message because you are subscribed to the Google 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: DNS Query
Hi Radhika, radhika wrote: Hi All, Am a beginner in this area. I am trying to find out how a DNS query is sent from the android device. Am unable to locate the code. Can someone help me by showing me the code where a DNS query is sent. For example, may be from some application like browser? I believe you simply have to use InetAddress.getByName(String Host) ? Like I did use InetAddress's getLocalHost() in resetConnection() funcion in my local app? : http://run.sh/repos/Runftp/src/sh/run/Runftp/FtpConsoleText.java Anyway the Socket() automatically resolves the hostname when given. Ryu -- You received this message because you are subscribed to the Google 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] loading files(images) from sdcard in webView
Hi, i am trying to load an html file which refers an image stored in the sdcard. Actualy the html is provided by a local servlet. in the html, i have this line img id=toto src=file:///sdcard/path/path/ toto.png/br. When i used that, i had this error : Not allowed to load local resource: file://. I find out that android does not allow this kind of things for security reasons . So i searched on Internet(see links at the ends) and i saw that i need to create my own ContentProvider to handle the way to access the local files. I did it by creating a LocalContentProvider that extends ContentProvider and i overwrited the method openFile(android.net.Uri uri, java.lang.String mode). Then i modified the androidManifest to add the provider. androidManifest: provider android:name=LocalContentProvider android:authorities=com.myCompany.myPackageName / LocalContentProvider (stored in com.myCompany.myPackageName): public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException { URI fileURI = URI.create( file:// + uri.getPath() ); File file = new File( fileURI ); ParcelFileDescriptor parcel=null; try { parcel = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY); } catch (FileNotFoundException e) { Log.d(LOG_TAG,Error finding: + fileURI + \n + e.toString()); } return parcel; } After theses modifications i tryed with img id=toto src=content:// com.myCompany.myPackageName/sdcard/path/path/toto.png/br and i had Failed to find provider info for com.myCompany.myPackageName here is my question: How can i change the html to make it access the local files via the contentProvider ? What am i doing wrong ? i' based on theses exemples: http://blog.tourizo.com/2009/02/how-to-display-local-file-in-android.html http://www.techjini.com/blog/2009/01/10/android-tip-1-contentprovider-accessing-local-file-system-from-webview-showing-image-in-webview-using-content/ i' am using Android 1.6 SDK, Release 1 on windows XP. Thank you for your help and i am sorry for my very bad english. Yaya. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: ANDROID_ID always null on devices
How about using the WIFI MAC address in cases where the ANDROID_ID is null? I believe it should be unique for each device: WifiManager manager = (WifiManager) getSystemService (Context.WIFI_SERVICE); WifiInfo wifiInfo = manager.getConnectionInfo(); String MACAddress = wifiInfo.getMacAddress(); This seems to pull back a MAC address even if WIFI is turned off. -Gregg On Feb 1, 10:54 am, Rampanda khaeonga...@gmail.com wrote: Hi, having the exact same problem on a Droid 2.0.1 and HTC Hero 1.5. : String androidID = Secure.getString(this.getContextResolver(), android.provider.Settings.Secure.ANDROID_ID); Toast.makeText(this, ANDROID_ID: + androidID, Toast.LENGTH_LONG).show(); consistently returns null on the devices and differences in OS and device seem to indicate some sort of problem with the compiled code. Not sure what is causing this, could be that the app erroneously believes it is running on an emulator or for some other reason is unable to retrieve the setting. No uncaught exceptions or other error message are printed when making these calls which help. For our application to work we need to be 100% sure we have a unique ID across all OS versions and device manufacturers, which is exactly what androidID is for. We're using IMEI and some key voodoo to sort of make it unique, but would prefer androidID to work. Also, it not working may be caused by something else that is also breaking other functionality. Haven't found the cause yet, but as soon as something falls into place I'll post it here. In the meantime, what is the name of the android apps you're using? Would like to test with the exact same ones you're testing on. 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
Re: [android-developers] Re: DNS Query
What if the application requires to send a query to a DNS server installed at a particular IP address. how do i configure my DNS server in *hosts/**resolv**.**conf from the application ?* *** * On Wed, Feb 3, 2010 at 8:40 PM, Lewske Wada r...@run.sh wrote: Hi Radhika, radhika wrote: Hi All, Am a beginner in this area. I am trying to find out how a DNS query is sent from the android device. Am unable to locate the code. Can someone help me by showing me the code where a DNS query is sent. For example, may be from some application like browser? I believe you simply have to use InetAddress.getByName(String Host) ? Like I did use InetAddress's getLocalHost() in resetConnection() funcion in my local app? : http://run.sh/repos/Runftp/src/sh/run/Runftp/FtpConsoleText.java Anyway the Socket() automatically resolves the hostname when given. Ryu -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Writing files SDCard on Emulator
Mahendra/String, Thank You for your reply on this. The problem was with the following code as pointed correctly by you folks String state = Environment.getExternalStorageState(); if(state != Environment.MEDIA_MOUNTED) { Log.d(DEBUG, The Card is Not Mounted + state +--); throw new IOException (SD Card is not Mounted. It is in + state); After hardcoding the path as per the code below (pointed by Mahendra) I'm able to write the file onto the SD Card and see the same in DDMS /sdcard/somefilename I think this problem is only with Emulator as mentioned in Emulator Limitations in Android Docs-Tools-Emulator. Further Questions 1. Would the code like Environment.getExternalStorageState.etc work when using the actual device. 2. Would the path name like /sdcard be the same when connected to the actual device. Thanks Best Regards Acer On Wed, Feb 3, 2010 at 11:58 AM, Mahendra mahendra.govindego...@wipro.comwrote: Hi, Following code is writting data to the Sdcard. try { FileWriter fOut = new FileWriter(/sdcard/samplefile1.txt); final String TESTSTRING = new String(Hello Android Development team); BufferedWriter osw = new BufferedWriter(fOut); // Write the string to the file osw.write(TESTSTRING); /* ensure that everything is * really written out and close */ osw.flush(); osw.close(); } catch (IOException ioe) { ioe.printStackTrace(); Toast.makeText(this, WriteFailed!, Toast.LENGTH_SHORT).show(); } uses-permission android:name=android.permission.WRITE_EXTERNAL_STORAGE/ Regards, Mahendra G On Feb 3, 10:09 am, Ace aceofli...@gmail.com wrote: Hello Mark, Yes, I do get the SD card image, attached is the screen-shot for your reference. Thank You again for your help Regards Acer On Wed, Feb 3, 2010 at 12:56 AM, Mark Murphy mmur...@commonsware.comwrote: Regarding your question .Are you sure your emulator has an SD card image? They don't by default Yes I think it has SD card image as I'm able to see the same through DDMS File Explorer when I startup the emulator. However, when I try and access it through Downloader.java I get Card Not Mounted. A better test is to bring up the AVD Manager (run tools/android from your SDK, or Windows|Android and AVD Manager from Eclipse). From there, highlight your AVD and click the [Details...] button. If the emulator has an SD card image, it will appear just above the horizontal line. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books:http://commonsware.com/books.html -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en my-emulator-details.bmp 1462KViewDownload -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Emulating a Droid
On Feb 2, 10:49 pm, Anthoni anthoni.gard...@gmail.com wrote: Hello, Just to add, it would be useful if there was a listing somewhere that showed all the different AVD settings for each phone supported by Android. Agreed - that would be useful. Nathan -- You received this message because you are subscribed to the Google 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] sticky client IP address?
Hello, I have an app which performs some online functions to a web server farm we operate using URLConnection. I'm finding that the client IP address of the phone seems to change after a fairly brief period of inactivity. For example, please see these timestamps and the corresponding client IP addresses: 2010-02-03 09:46:47 / 32.152.30.98 2010-02-03 09:47:05 / 32.152.30.98 2010-02-03 09:57:21 / 32.152.218.197 2010-02-03 09:59:53 / 32.152.23.19 This is sitting in a stationary location (on an ATT EDGE network) in my office. Is there some reason for this behavior? Any advice would be greatly appreciated Regards, Chris @ Vertifi -- You received this message because you are subscribed to the Google 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: VerifyError - how can I solve this error?
To help you, you need to post the log (form LogCat) showing the stack- trace of the VerifyError. As an example, VerifyErrors can occur when you load a class compiled in Android 1.6 and using/calling 1.6 specific fields/methods and then the class is run in a Android 1.5 environment. I had one such (coding) error in my app, which should run on 1.5 (and up) e.g. i used the BitmapFactory.Options.inDensity field, which works fine on 1.6 (or higher) phones. However, when i ran my app on a 1.5 phone, i got a VerifyError because of the use of use of 'inDensity' in my app's class. On Feb 3, 5:45 am, Martin google-gro...@digle.de wrote: On my mobile, I do NOT have the VerifyError! This is strange. I just get the Error-Messages from Flurry-Analytics from people, who downloaded my game in the market, so I think that these error-messages come from a specific Android OS? What does it mean that some part of a class failed verification? Which verification? Greetings, Martin On 2 Feb., 00:19, fadden fad...@android.com wrote: On Jan 30, 3:16 am, Martin google-gro...@digle.de wrote: I am analyzing my game with flurry-analytics and some people, who play my game, receive the Exception java.lang.VerifyError in my Highscore- Activity. What do I have to do to solve this error? To figure this out you really need to see the log message associated with the failure. Verification errors generally mean that some part of a class failed verification, and as a result the entire class has been rejected by the VM. It should be 100% repeatable. The logcat output will tell you in great detail what went wrong and where. Are the failures always associated with a specific version of the Android OS?- 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] bug in Spinner.setSelection when called twice?
Hi, I saw several people reporting an issue with Spinner.setSelection that does not seem to work as expected on the second call: the item selection is correctly updated in the list subframe, but not in the text displayed when the spinner is closed Anbody knows a workarround? Thierry. On 4 juin 2009, 21:46, Ben Roberts divestocl...@gmail.com wrote: There are at least two other people who have encountered this problem: http://groups.google.com/group/android-beginners/browse_thread/thread...http://groups.google.com/group/android-developers/browse_thread/threa. .. Any ideas? Is it a bug? At the very least, does anyone know of an open source app that uses a Spinner on a layout from which another Activity can be launched? On Jun 1, 9:17 pm, Ben Roberts divestocl...@gmail.com wrote: I'm quoting an old message from last year because it's EXACTLY the problem I'm having: Hi all, I have a spinner in a dialog. Calling spinner.setSelection(int) correctly sets the spinner just after opening the app. If I reopen the dialog after making another spinner.setSelection(int) call, the spinner shows the first item regardless of the selection being set, BUT... clicking on the spinner shows that the correct value is selected in the list of options (green dot next to the item). Weird huh? Sometimes when this happens, the spinner is cutting off parts of the text. Has anyone else seen this happen? Since the last guy got no response, I'll give as much detail as I can... this is driving me nuts. I built a class to help me build a Spinner in a consistent manner to display a list of categories. After the objects are initialized, my Activity calls a method initCatSpinner which builds the ArrayAdapter and finishes initializing my Spinner. Called from onCreate and onActivityResult: mCategorySpinner = mCatSpinHelper.initCatSpinner(mCategoryId, catcursor); public Spinner initCatSpinner(long initial_category, Cursor all_categories) { LinkedListCategorySpinnerItem categories = new LinkedListCategorySpinnerItem(); // Code to build this linked list from all_Categories is here, removed for brevity // Code adds an All item to the top, builds a list of categories using catcursor, then adds a Edit Categories option to the end of the list if(initial_category == ID_ALL) { mLastCategoryPosition=0; } // Build the spinner adapter and set up the Spinner ArrayAdapterCategorySpinnerItem spinadapter = new ArrayAdapterCategorySpinnerItem(mCtx, android.R.layout.simple_spinner_item, android.R.id.text1, categories); spinadapter.setDropDownViewResource (android.R.layout.simple_spinner_dropdown_item); mCatSpinner.setAdapter(spinadapter); mCatSpinner.setSelection(mLastCategoryPosition); mCatSpinner.setPrompt(mCtx.getResources().getString (R.string.choose_category)); return mCatSpinner; } This works fine on two different activities when they are launched. One activity launches to show a list of all items in the category chosen by this spinner. From there I can launch another activity in a dialog to change the category of a selected item, and when I do this and return to the original activity I get the above symptoms. I still see a list of the items in the proper category, if I open the spinner the category that was originally selected is still selected, but the spinner item that's displayed on the widget itself is always the first one in the list! It also happens if I switch to another Activity then come back to this one. I've checked with Log output and mLastCategoryPosition IS being set correctly, so the setSelection call is passing the right data. I even tried calling SystemClock.sleep for a few hundred milliseconds thinking it might be a race condition, with no change. What's going on here? I'm using the 1.5r2 SDK. -- Thierry. -- You received this message because you are subscribed to the Google 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: Writing files SDCard on Emulator
After hardcoding the path as per the code below (pointed by Mahendra) I'm able to write the file onto the SD Card and see the same in DDMS /sdcard/somefilename Do not hardcode /sdcard. Use Environment.getExternalStoragePath() to get the path to the SD card. 2. Would the path name like /sdcard be the same when connected to the actual device. No. Some devices have their SD card under different paths. Use Environment.getExternalStoragePath() to get the path to the SD card. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Writing files SDCard on Emulator
Thank you Mark for your reply. Reg: Do not hardcode /sdcard. Use Environment. getExternalStoragePath() to get the path to the SD card. 1. When I use the above method, I end up with the problem of device not mounted, how can I overcome this on an Emulator. 2. On the actual device, how can I determine the path? Can I use adb shell to navigate through the device? Thank You again for your patience and help. Best Regards Acer On Wed, Feb 3, 2010 at 9:40 PM, Mark Murphy mmur...@commonsware.com wrote: After hardcoding the path as per the code below (pointed by Mahendra) I'm able to write the file onto the SD Card and see the same in DDMS /sdcard/somefilename Do not hardcode /sdcard. Use Environment.getExternalStoragePath() to get the path to the SD card. 2. Would the path name like /sdcard be the same when connected to the actual device. No. Some devices have their SD card under different paths. Use Environment.getExternalStoragePath() to get the path to the SD card. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: XML Parsing
Add a boolean variable that is set on segfirstroute startElement and cleared on segfirstroute endElement. Us it to ignore the date element. -- You received this message because you are subscribed to the Google 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: Writing files SDCard on Emulator
Thank you Mark for your reply. Reg: Do not hardcode /sdcard. Use Environment. getExternalStoragePath() to get the path to the SD card. 1. When I use the above method, I end up with the problem of device not mounted, how can I overcome this on an Emulator. That method works perfectly fine on the emulator. The problems you have reported in this thread are with a different method (getExternalStorageState()). Also: -- Never use + to concatenate paths together. Use the proper constructors on the File class for that. -- You do not need to call getAbsolutePath() on the result of Environment.getExternalStoragePath(). 2. On the actual device, how can I determine the path? Can I use adb shell to navigate through the device? Your code should use Environment.getExternalStoragePath(). You as a developer can use adb shell or DDMS' File Explorer to poke around and deduce the path. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: DNS Query
You probably are not basically able to change it to your own server. Chances are you can connect to your internal WiFi network and get the automatic DNS settings from dhcpd or whatever. I can dynamically connect through my own rooter (Linux) and pass that beyond to the internet by IP masquerading. Ryu Android Development さんは書きました: What if the application requires to send a query to a DNS server installed at a particular IP address. how do i configure my DNS server in *hosts/*/*resolv*/*.*/*conf *from the application ?/ //* * On Wed, Feb 3, 2010 at 8:40 PM, Lewske Wada r...@run.sh wrote: Hi Radhika, radhika wrote: Hi All, Am a beginner in this area. I am trying to find out how a DNS query is sent from the android device. Am unable to locate the code. Can someone help me by showing me the code where a DNS query is sent. For example, may be from some application like browser? I believe you simply have to use InetAddress.getByName(String Host) ? Like I did use InetAddress's getLocalHost() in resetConnection() funcion in my local app? : http://run.sh/repos/Runftp/src/sh/run/Runftp/FtpConsoleText.java Anyway the Socket() automatically resolves the hostname when given. Ryu -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com mailto: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 -- You received this message because you are subscribed to the Google 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] AlertDialog in Android 1.5 and 2.0 / 2.0.1
I've never had an issue with AlertDialogs in the emulator under any version. Post the code you're using, you're probably just doing something wrong. - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking -- You received this message because you are subscribed to the Google 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: Help needed with parsing some XML data !
Found attribute : Albanië instead of Albanié This suggests you are displaying UTF-8 text (which is was logcat does) as Latin-1. To wit: ë = 0xC3 0xAB which are UTF-8 for Latin1 0xEB. However, é is 0xEB, not 0xAB, so there's something else afoot. Also note that when you see the rectangle with the ? in it, most likely means you are trying to read a Latin-1 encoding as UTF-8. For example, 0xEB by itself is invalid UTF-8. It would require two additional bytes each with the top two bits of 10. But good progress, bring on the data to analyze this problem. It would help if you posted the URL to the XML -- You received this message because you are subscribed to the Google 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 get a remote logcat on error?
This is not necessary, to catch every line of code. Register an uncaught-exception-handler (Thread.setDefaultUncaughtExceptionHandler). Before you set it, get the current one. You may need to call it from your own uncaught- exception-handler. In this handler, print out the stack-trace (and some other info such as OS-version, phone model, make, etc) to a file (on phone-memory or sd-card) These above steps are the bare basics. In my app, I added a Service and an Activity, both running in a different process than my app whose stack-traces i'm logging. If they would run in the same process, it woudn't work (calling a Service and Activity from a dying process). The uncaught-exception-handling code binds to the Service (initialization) and upon a stack-trace dump, after having generated the file, it does a Service-request: The Service starts the Activity that just shows a dialog asking the using to submit an error report or not. If the user answers 'Yes', then the Activity will read the file with the stack-trace info and send it to a web-server (Http). The web-server gets this request, generates an e-mail from it that is then sent to my inbox. When the uncaught-exception-handler calls the service, it just kills and extis the process. If the handler could not bind to the Service or the Service-request failed, it calls the original default uncaught- exception-handler that then shows the common 'Force Close' dialog. This has been working well for me and found a few bugs here and there :) On Feb 3, 5:24 am, Martin google-gro...@digle.de wrote: Or is there another possibility to debug my game, while it is in the market? How can I intercept all the errors in my code to find out how I can solve them? If nobody has an answer to this, I have to put a try { ...} catch (Exception e) { /* send this exception and line number over internet to me */ } on EVERY line of code? For example: @Override public void onCreate(Bundle savedInstanceState) { try { DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); Global.screen_width = dm.widthPixels; Global.screen_height = dm.heightPixels; Global.screen_width_factor = 320/Global.screen_width; Global.screen_height_factor = 480/Global.screen_height;} catch (Exception e) { /* send exception - METRICS */ } try { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); this.getWindow().setFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN );} catch (Exception e) { /* send exception - window */ } try { setContentView(R.layout.main);} catch (Exception e) { /* send exception - contentview */ } try { //Sound starten SharedPreferences prefs = getSharedPreferences(options, 0); Global.bgmusic=prefs.getBoolean(music, true); Global.soundeffects=prefs.getBoolean(soundeffects, true);} catch (Exception e) { /* send exception - start sound */ } try { b_start = (Button) findViewById(R.id.b_start); b_start.layout(120*Global.screen_width_factor, 55*Global.screen_height_factor, (120+buttonwidth)*Global.screen_width_factor, (55+buttonheight)* } catch (Exception e) { /* send exception - startbuttoncreated */ } and so on or is there a better solution? Greetings, Martin On 3 Feb., 10:11, Martin google-gro...@digle.de wrote: Hi! I have a game in the market and with flurry analytics, I receive all my errors. Here are some of them: 01/31/10 01:47:39 PM PST 0 class java.lang.IllegalArgumentException parameter must be a descendant of this view 02/02/10 12:40:41 PM PST 0 class java.lang.IllegalThreadStateException Thread already started. 01/26/10 09:25:36 PM PST 0 class java.lang.NullPointerException 1.0 (beta) uncaught Android 02/01/10 05:26:27 PM PST 0 class java.lang.OutOfMemoryError bitmap size exceeds VM budget 1.3 (beta) uncaught Android 01/29/10 10:23:10 AM PST 0 class java.lang.RuntimeException Adding window failed 1.0 (beta) uncaught Android 01/29/10 08:19:05 AM PST 0 class java.lang.RuntimeException Unable to start activity ComponentInfo{digle.de.LeonardFrog/ digle.de.LeonardFrog.AHighscore}: java.lang.NullPointerException 1.0 (beta) uncaught Android 01/27/10 01:09:35 AM PST 0 class java.lang.VerifyError digle.de.LeonardFrog.AHighscore 1.0 (beta) uncaught Android I want to solve them but I
[android-developers] Re: Android 2.0.1 SocketTimeoutException received with FTP Data channel
The TCP port is entered correctly as 2121 when I connect to FTP, the FTP cpntrol session is started properly according to the server logs. I am not using SFTP since I have disabled the sub-system on my SSH server. I am trying to use SSH TCP forwarding alone to establish and maintain the ftp session sice most FTP clients won't support 1024 bit RSA key authentication. I am considering FTPS, but I'm not sure I want to open up another port to the internet. The SSH service is the only one I currently allow through the firewall. Can you tell me more about the Java error message I'm getting? or maybe if there are any android native FTP apps I can use? Thanks! --James -- You received this message because you are subscribed to the Google 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: Dynamic TableLayout problem
Ok, solved y just have to use final on the tablelayout statement. If someone wants the code ill post it. Thanks for your reply Beth. On 2 feb, 18:13, Beth emez...@gmail.com wrote: David, The output shows you have a null pointer at line 93 of your activity. Look there for a solution. Also, I noticed you have System.out.println. Where are you expecting the println output to appear? You might want to replace that with Android.util.log. Regards, Beth On Feb 2, 3:41 am, David Arm zash...@gmail.com wrote: No idea? :s On 1 feb, 22:09, David Arm zash...@gmail.com wrote: Sorry, double post. On 1 feb, 18:37, David Arm zash...@gmail.com wrote: Hi! Im having a problem with a tablelayout. Im trying to add rows dinamically and display the content of these rows (there are not content problems as T tested it and the app has all the data that it needs). This is the java code and the xml of the activity: [syntax=java]import java.util.ArrayList; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; public class DisplayResult extends Activity{ /** Called when the activity is first created. */ �...@suppresswarnings(unchecked) public void onCreate(Bundle savedInstanceState) { System.out.println(2º actividad lanzada); super.onCreate(savedInstanceState); setContentView(R.layout.displayresults); Bundle extras = getIntent().getExtras(); //this.setContentView(R.layout.main); /* Find Tablelayout defined in main.xml */ TableLayout tl = (TableLayout)findViewById (R.layout.displayresults); ArrayList finalResults; if(extras!=null){ finalResults = (ArrayList) (extras.getSerializable (RemoteIR.RESULTS)); Iterator it = finalResults.iterator(); while(it.hasNext()) { SearchResult result = ((SearchResult) it.next()); /* Create a new row to be added. */ TableRow tr = new TableRow(this); tr.setLayoutParams(new LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); TextView title = new TextView(this); title.setText(result.title.toString()); //System.out.println(title.getText()); TextView author = new TextView(this); author.setText(result.author.toString()); TextView file = new TextView(this); file.setText(result.file.toString()); TextView modDate = new TextView(this); author.setText(result.modDate.toString()); TextView size = new TextView(this); size.setText(result.size.toString()); title.setLayoutParams(new LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); author.setLayoutParams(new LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); file.setLayoutParams(new LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); modDate.setLayoutParams(new LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); size.setLayoutParams(new LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); tr.addView(title); tr.addView(author); tr.addView(file); tr.addView(modDate); tr.addView(size); tl.addView(tr,new TableLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); } } } }[/syntax] This is the xml: [syntax=xml] ?xml version=1.0 encoding=utf-8? TableLayout xmlns:android=http://schemas.android.com/apk/res/ android android:id=@+id/DisplayResults android:layout_width=fill_parent android:layout_height=fill_parent TableRow TextView android:layout_column=1 android:text=Title android:padding=3dip / TextView android:text=Author android:padding=3dip / TextView android:text=File android:padding=3dip / TextView
[android-developers] Re: Wakelock and phone restarts
I had the same problem i used wake lock but still i think before i acquire wakelock wifi goes in sleep mode . On Feb 2, 11:45 am, nikhil nik...@gmail.com wrote: It seems there is a conflict between call forwarding and wakelock... Can someone test this out please? If you have a service which implements a wakelock (partial for my case), try enabling the call forward option in the settings when the service is running in the background... and please let me know here if the phone keeps restarting.. Please help people... On Feb 2, 10:51 am, nikhil nik...@gmail.com wrote: It seems there is some conflict between my service and call forwarding. Whenever I have my service running in the background, after I enable call forwarding the phone restarts and the keeps restarting. Has anyone experienced this? On Feb 2, 10:26 am, nikhil nik...@gmail.com wrote: What can cause thephoneto restart ? On Jan 28, 11:18 am, nikhil nik...@gmail.com wrote: Hello Friends, I have a service which holds on to a wakelock and the code is similar to this, public class WakeLockService extends Service { PowerManager.WakeLock wl; @Override public IBinder onBind(Intent arg0) { // TODO Auto-generated method stub return null; } public void onCreate() { PowerManager pm = (PowerManager) getSystemService (Context.POWER_SERVICE); wl = pm.newWakeLock (PowerManager.PARTIAL_WAKE_LOCK, My Tag); wl.acquire(); } public void onDestroy() { wl.release(); } For past two days, myphonehas been restarting randomly...Today it was worse, it kept restarting untill I uninstalled the app. I tried to search about this behaviour online and found that too many wakelocks may coz thephonetorestart. Can there be any other reason? Is the above code right? Should make wl as a final variable? Does the service call onDestroy method whenphoneshuts down? I am using a broadcastreceiver to start my service at boot up as well. Any help would be appreciated. Thank You So Much -- You received this message because you are subscribed to the Google 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 get a remote logcat on error?
Note that I made a blog entry to explain how I made a crash reporter using email on my blog, there : http://androidblogger.blogspot.com/2009/12/how-to-improve-your-application-crash.html It's a very effective way to catch the bugs, and to find how they happen. The fact that it is send by mail ( so the user should accept to send it ) makes it really easy to do, you don't need to have a web site to handle them, but most of the users won't send it. In my view, if nobody sent me an crash report, I take it for granted there is no common bug. If a bug is really common and happens often, it will be sent ! Hope it helps, Emmanuel Ps : By the way, I don't fully understand why Flurry doesn't provide the full call stack. They are so close, and they have done most of the work to have a super useful tool, and they just stop one inch before it... Strange... ( but it makes me feel good to have develop my own crash reporter ) On Feb 3, 5:40 pm, Streets Of Boston flyingdutc...@gmail.com wrote: This is not necessary, to catch every line of code. Register an uncaught-exception-handler (Thread.setDefaultUncaughtExceptionHandler). Before you set it, get the current one. You may need to call it from your own uncaught- exception-handler. In this handler, print out the stack-trace (and some other info such as OS-version, phone model, make, etc) to a file (on phone-memory or sd-card) These above steps are the bare basics. In my app, I added a Service and an Activity, both running in a different process than my app whose stack-traces i'm logging. If they would run in the same process, it woudn't work (calling a Service and Activity from a dying process). The uncaught-exception-handling code binds to the Service (initialization) and upon a stack-trace dump, after having generated the file, it does a Service-request: The Service starts the Activity that just shows a dialog asking the using to submit an error report or not. If the user answers 'Yes', then the Activity will read the file with the stack-trace info and send it to a web-server (Http). The web-server gets this request, generates an e-mail from it that is then sent to my inbox. When the uncaught-exception-handler calls the service, it just kills and extis the process. If the handler could not bind to the Service or the Service-request failed, it calls the original default uncaught- exception-handler that then shows the common 'Force Close' dialog. This has been working well for me and found a few bugs here and there :) On Feb 3, 5:24 am, Martin google-gro...@digle.de wrote: Or is there another possibility to debug my game, while it is in the market? How can I intercept all the errors in my code to find out how I can solve them? If nobody has an answer to this, I have to put a try { ...} catch (Exception e) { /* send this exception and line number over internet to me */ } on EVERY line of code? For example: @Override public void onCreate(Bundle savedInstanceState) { try { DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); Global.screen_width = dm.widthPixels; Global.screen_height = dm.heightPixels; Global.screen_width_factor = 320/Global.screen_width; Global.screen_height_factor = 480/Global.screen_height;} catch (Exception e) { /* send exception - METRICS */ } try { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); this.getWindow().setFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN );} catch (Exception e) { /* send exception - window */ } try { setContentView(R.layout.main);} catch (Exception e) { /* send exception - contentview */ } try { //Sound starten SharedPreferences prefs = getSharedPreferences(options, 0); Global.bgmusic=prefs.getBoolean(music, true); Global.soundeffects=prefs.getBoolean(soundeffects, true);} catch (Exception e) { /* send exception - start sound */ } try { b_start = (Button) findViewById(R.id.b_start); b_start.layout(120*Global.screen_width_factor, 55*Global.screen_height_factor, (120+buttonwidth)*Global.screen_width_factor, (55+buttonheight)* } catch (Exception e) { /* send exception - startbuttoncreated */ } and so on or is there a better solution? Greetings, Martin On 3 Feb., 10:11, Martin google-gro...@digle.de wrote: Hi! I have a game in the market and with flurry analytics, I receive all my errors. Here are some of them: 01/31/10 01:47:39 PM PST 0 class java.lang.IllegalArgumentException
[android-developers] Vertical scrollview disappears on vertical and horizontal scrollview scheme
Hi! I´m just trying to have both vertical and horizontal scrollviews but the vertical one disappears just 1 second after the app launch and I cant scroll down on my results. Here are the codes: XML: ?xml version=1.0 encoding=utf-8? ScrollView android:id=@+id/ScrollView xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=wrap_content android:layout_height=wrap_content android:scrollbars=vertical HorizontalScrollView xmlns:android=http://schemas.android.com/apk/ res/android android:id=@+id/HorizontalScrollView android:layout_width=wrap_content android:layout_height=wrap_content TableLayout xmlns:android=http://schemas.android.com/apk/res/ android android:id=@+id/DisplayResults android:layout_width=fill_parent android:layout_height=fill_parent TableRow TextView android:layout_column=1 android:text=Title android:padding=3dip / TextView android:layout_column=2 android:text=Author android:padding=3dip/ TextView android:layout_column=3 android:text=File android:padding=3dip/ TextView android:layout_column=4 android:text=ModDate android:padding=3dip/ TextView android:layout_column=5 android:text=Size android:padding=3dip/ /TableRow /TableLayout /HorizontalScrollView /ScrollView JAVA: package citic.android.remoteir; import java.util.ArrayList; import java.util.Iterator; import android.app.Activity; import android.os.Bundle; import android.widget.TableRow.LayoutParams; import android.widget.Button; import android.widget.LinearLayout; import android.widget.ScrollView; import android.widget.TableLayout; import android.view.View; import android.view.ViewGroup; import android.widget.TableRow; import android.widget.TextView; import android.app.Activity; public class DisplayResult extends Activity{ private boolean mShrink; @SuppressWarnings(unchecked) protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.displayresults); Bundle extras = getIntent().getExtras(); final TableLayout tl = (TableLayout)findViewById (R.id.DisplayResults); //ArrayList finalResults; if(extras!=null){ appendRow(tl, extras); } } private void appendRow(TableLayout table, Bundle extras) { ArrayList finalResults; finalResults = (ArrayList) (extras.getSerializable (RemoteIR.RESULTS)); Iterator it = finalResults.iterator(); while(it.hasNext()) { SearchResult result = ((SearchResult) it.next()); TableRow tr = new TableRow(this); tr.setLayoutParams(new LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); TextView title = new TextView(this); title.setText(result.title); title.setPadding(3, 3, 3, 3); TextView author = new TextView(this); author.setText(result.author.toString()); author.setPadding(3, 3, 3, 3); TextView file = new TextView(this); file.setText(result.file.toString()); TextView modDate = new TextView(this); modDate.setText(result.modDate); TextView size = new TextView(this); size.setText(result.size.toString()); tr.addView(title, new TableRow.LayoutParams(1)); tr.addView(author, new TableRow.LayoutParams()); tr.addView(file, new TableRow.LayoutParams()); tr.addView(modDate, new TableRow.LayoutParams()); tr.addView(size, new TableRow.LayoutParams()); table.addView(tr,new TableLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); } } Thank you! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android 2.0.1 SocketTimeoutException received with FTP Data channel
Ryu, Sorry, forgot to address your iptables question. I am not using iptables on either my emulator or Droid. My firewall only needs the one SSH port open in order to connect, and then with the port forwarding through SSH additional firewall ports are uneccessary. I am not running a firewall/packet filter on the server. I am currently using it regularly to access my HTTP server and view the MRTG graphs and even telnet to various other devices inside my internal network. This works just fine on the Droid, and I am very impressed with my android experience so far, I just can't get an FTP- Data session to connect without this timeout error. Thanks again! --James -- You received this message because you are subscribed to the Google 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: DNS Query
Then you are doing something VERY strange. DNS is a service provided to hosts (systems, i.e. your phone) by the network. It is not something that is under the control of the application. Generally, a DHCP server (or the wireless carrier) will supply you with your IP address, default router, DNS servers, and other network configuration when you connect. It's a property of your NETWORK environment. Of course, applications are free to use IP addresses, and to obtain them however they choose -- including implementing a DNS client themselves. This, of course, raises the question -- how do you locate your special DNS server -- and why is it special? Is it even reachable in a particular environment? To prevent DNS spoofing attacks, some network administrators may block external DNS requests, and force you to go through their DNS servers. Generally speaking, ANY DNS server should be able to resolve ANY public DNS entry. And ONLY your local one that your network would tell you about, would be able to tell you about special, local, DNS entries. About the only use I can see for such a scheme would be to contact a botnet controller. Or, more likely, to work around a mis-configured local network -- perhaps due to a poorly set-up VPN. But in any event, an application should NOT try to hijack the entire system's DNS resolution by hacking *hosts/**resolv**.**conf. This is not playing nice with others. There's a reason -- many reasons -- these files require root access. On Feb 3, 7:28 am, Android Development indodr...@gmail.com wrote: What if the application requires to send a query to a DNS server installed at a particular IP address. how do i configure my DNS server in *hosts/**resolv**.**conf from the application ?* *** * On Wed, Feb 3, 2010 at 8:40 PM, Lewske Wada r...@run.sh wrote: Hi Radhika, radhika wrote: Hi All, Am a beginner in this area. I am trying to find out how a DNS query is sent from the android device. Am unable to locate the code. Can someone help me by showing me the code where a DNS query is sent. For example, may be from some application like browser? I believe you simply have to use InetAddress.getByName(String Host) ? Like I did use InetAddress's getLocalHost() in resetConnection() funcion in my local app? : http://run.sh/repos/Runftp/src/sh/run/Runftp/FtpConsoleText.java Anyway the Socket() automatically resolves the hostname when given. Ryu -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google 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] Is passing AMR_NB into AudioTrack and AudioRecord valid?
I currently use AudioTrack and AudioRecord to create a looping sound program and I was using raw PCM audio but I want to use AMR_NB audio so I set up the code as follows arec = new AudioRecord(MediaRecorder.AudioSource.MIC, 11025, AudioFormat.CHANNEL_CONFIGURATION_MONO, MediaRecorder.AudioEncoder.AMR_NB, buffersize); atrack = new AudioTrack(AudioManager.STREAM_VOICE_CALL, 11025, AudioFormat.CHANNEL_CONFIGURATION_MONO, MediaRecorder.AudioEncoder.AMR_NB, buffersize, AudioTrack.MODE_STREAM); The above code works fine but is passing MediaRecorder.AudioEncoder.AMR_NB in as the Audio Format valid or is it working but actually not being encoded as AMR_NB? -- You received this message because you are subscribed to the Google 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: DNS Query
I didn't mean that to be harsh, BTW. Knowing that an approach is out in left field, and why, is useful information. Some of the most useful information you can get, as a beginner, since it narrows the focus of what you have to learn, a lot! On Feb 3, 9:21 am, Bob Kerns r...@acm.org wrote: Then you are doing something VERY strange. -- You received this message because you are subscribed to the Google 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: XML Parsing
If you're using xml pull.. just go until you find the start_tag + the name of the node you need, then exit out of the while loops. On Wed, Feb 3, 2010 at 8:18 AM, Frank Weiss fewe...@gmail.com wrote: Add a boolean variable that is set on segfirstroute startElement and cleared on segfirstroute endElement. Us it to ignore the date element. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Educational Resources
We have a lot of questions here of a fairly basic, non-Android- specific nature. I think it would be helpful to compile a list of resources on various topics, that we could refer people to (and try to get them to look at before asking here -- yeah, I know...) Areas I see: * TCP/IP and networking * Cellular communications (I could use some of these, I bet) * XML processing (XML itself, and the API's: DOM, SAX, XMLPull) * Java Done right, referring people to such a listing would be far more useful to them than answering their immediate question. (I'm not saying, don't answer -- but teach them to fish out their own answers!) Of course, http://google.com would be right at the top of the list. But a lot of time beginners don't realize how much information is available to them -- or they're overwhelmed by the amount of information available at the wrong level for them, and no way to judge quality. Except for cellular comm (where I have the opposite problem), I've been around this stuff too long to have any reasonable resource suggestions. I'd send you to the standards documents... :) Can people help out with suggestions? Can Google people give them some visibility on the 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] Re: NullPoinerException in XML
Guys please help me out On Wed, Feb 3, 2010 at 5:26 PM, Chirayu Dalwadi chirayu.dalw...@gmail.comwrote: Hi all, In the below XML, I'm getting NullPointerException. What is the reason behind that? I also want scroll bars in th same XML. How to do that? ? xml version=*1.0* encoding=*utf-8*? ? xml version=*1.0* encoding=*utf-8*? TabHost xmlns:android=*http://schemas.android.com/apk/res/android* android:id =*@+id/my_tabhost* android:layout_width =*fill_parent* android:layout_height =*fill_parent* android:background =*#ff* TabWidget android:id=*@android:id/tabs* android:layout_width=*fill_parent* android:layout_height=*65px*/ FrameLayout android:id=*@android:id/tabcontent* android:layout_width=*fill_parent* android:layout_height=*200px* android:paddingTop=*65px* TableLayout android:id=*@+id/TableLayout01* android:layout_width=*fill_parent* android:layout_height=*fill_parent* xmlns:android=*http://schemas.android.com/apk/res/android* TableRow TextView android:id=*@+id/lbl1* android:layout_width=*wrap_content* android:layout_height=*wrap_content* android:layout_column=*0* **android:layout_marginTop=*10dip* android:text=*@string/lbl1*/ Spinner android:id=*@+id/spinner* android:layout_width=*fill_parent* android:layout_height=*wrap_content* android:drawSelectorOnTop=*true* android:prompt=*@string/planet_prompt*/ / TableRow / TableLayout / FrameLayout / TabHost Warm Regards, Chirayu Dalwadi -- Warm Regards, Chirayu Dalwadi Cell Number: +91-997-470-4341 Email: chirayu.dalw...@gmail.com Profile: http://www.google.com/profiles/chirayu.dalwadi Pain is temporary. Quitting lasts forever. -- Lance Armstrong -- You received this message because you are subscribed to the Google 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: TableLayout, Rotating
I don't think the Android API lets you do what you want. I wound up writing my own gridbox layout widget which I use in several of my apps. It's similar to the old Java gridbag layout and HTML tables. It does everything I need. Unfortunately, it's not generic enough for me to publish yet. -- You received this message because you are subscribed to the Google 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: XML Parsing
This is how I have done it. When there are no more entries it exists try{ try{ String stationfeed = urls; url = new URL(stationfeed); ((xmlName)this.getApplication()).setXMLName(urls); URLConnection connection; connection = url.openConnection(); HttpURLConnection httpConnection = (HttpURLConnection)connection; int responseCode = httpConnection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK){ InputStream in = httpConnection.getInputStream(); DocumentBuilderFactory dbf; dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); //Parse the feed Document dom = db.parse(in); Element docEle = dom.getDocumentElement(); //Get list of each entry NodeList nl = docEle.getElementsByTagName(stations); if (nl != null nl.getLength() 0){ for (int i = 0; i nl.getLength(); i++){ Element entry = (Element)nl.item(i); Element sname = (Element)entry.getElementsByTagName(StationName).item(0); Element sloc = (Element)entry.getElementsByTagName(StationLocation).item(0); Element sid = (Element)entry.getElementsByTagName(StationId).item(0); Element sdis = (Element)entry.getElementsByTagName(StationDistance).item(0); Element stype = (Element)entry.getElementsByTagName(StationPredictions).item(0); String namer = sname.getFirstChild().getNodeValue(); String loc = sloc.getFirstChild().getNodeValue(); String ids = sid.getFirstChild().getNodeValue(); String dis = sdis.getFirstChild().getNodeValue(); String types = stype.getFirstChild().getNodeValue(); //Add the station to the list //Stations station = new Stations(namer, loc, ids, dis, types); submitStation(namer, loc, ids, dis, types); } } } }catch (MalformedURLException e){ e.printStackTrace(); }catch (IOException e){ e.printStackTrace(); }catch (ParserConfigurationException e){ e.printStackTrace(); }catch (SAXException e){ e.printStackTrace(); } finally{ } }else{ //RETURN AN ERROR } } I hope this helps you in some way. From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of Kevin Duffey Sent: Wednesday, February 03, 2010 12:36 PM To: android-developers@googlegroups.com Subject: Re: [android-developers] Re: XML Parsing If you're using xml pull.. just go until you find the start_tag + the name of the node you need, then exit out of the while loops. On Wed, Feb 3, 2010 at 8:18 AM, Frank Weiss fewe...@gmail.com wrote: Add a boolean variable that is set on segfirstroute startElement and cleared on segfirstroute endElement. Us it to ignore the date element. -- You received this message because you are subscribed to the Google 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 -- You received this message because you are subscribed to the Google 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: Android 2.0.1 SocketTimeoutException received with FTP Data channel
Hi James, mericksonj wrote: The TCP port is entered correctly as 2121 when I connect to FTP, the FTP cpntrol session is started properly according to the server logs. I am not using SFTP since I have disabled the sub-system on my SSH server. I am trying to use SSH TCP forwarding alone to establish and maintain the ftp session sice most FTP clients won't support 1024 bit RSA key authentication. I am considering FTPS, but I'm not sure I want to open up another port to the internet. The SSH service is the only one I currently allow through the firewall. Can you tell me more about the Java error message I'm getting? or maybe if there are any android native FTP apps I can use? Well I don't know if you need two ports for FTP tunneled through SSH, but seems like you could not create a data connection for FTP over SSH. I recommend FTPS as it runs on usual FTP ports (21 for connection and some other for data channel) and is programmed in a secure and established manner using standard SSL package. I've developed an FTP client implementation using FTPS called Runftp and should be downloaded in Market. (Searched by Runftp maybe) Ryu -- You received this message because you are subscribed to the Google 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: Coloring Default Buttons - color filter only on unfocused state
I see a similar solution on stackoverflow: http://stackoverflow.com/questions/2065430/fixed-android-detecting-focus-pressed-color/2189757#2189757 but I have some concerns with that solution, mainly what if the OS changes the graphic of the default button? Since the normal unfocused/ unpressed graphic is now hardcoded into the app, it would break the flow. Maybe can someone comment on whether it would be good or bad practice to hardcode the default graphic into the app? What are the chances of the OS completely changing the graphic? Thanks! On Feb 2, 4:57 pm, RLo leecha...@gmail.com wrote: Also tried this: StateListDrawable sd = new StateListDrawable(); int stateFocused = android.R.attr.state_focused; int statePressed = android.R.attr.state_pressed; Drawable norm = this.getResources().getDrawable (android.R.drawable.btn_default); sd.addState(new int[]{statePressed}, norm); sd.addState(new int[]{stateFocused}, norm); norm.mutate().setColorFilter(Color.parseColor(this.getString (R.color.button_blue)), Mode.MULTIPLY); sd.addState(new int[]{-stateFocused, -statePressed}, norm); myButton.setBackgroundDrawable(sd); Whichseems like it would make sense. But i get nullpointer exception because turns out I can't mutate an android.R.drawable... Any ideas?? Help!! On Feb 2, 4:23 pm, RLo leecha...@gmail.com wrote: Hi All, I want to buttons of different colors, but I want to do so while using the default button background resource in order to preserve the onfocus and onclick states. This is because I want to use the default highlight color of the OS for my app, which is NOT always orange (HTC Sense makes it green). I found that adding a color filter to the button's background drawable works great (in this case, blue): myButton.getBackground().setColorFilter(Color.parseColor(this.getString (R.color.button_blue)), Mode.MULTIPLY); BUT, when the button is focused or clicked, it turns a nasty orange_blue because it mixes the color filter with the orange of the background drawable. I want to ONLY set this color filter for the unfocused/unclicked nine- patch drawable within the default button's statelistdrawable. I tried: myButton.getBackground().getCurrent().setColorFilter(Color.parseColor (this.getString(R.color.button_blue)), Mode.MULTIPLY); But this does no coloring at all. I'm not sure how else to do this. Any help please? Thanks very much!! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android 2.0.1 SocketTimeoutException received with FTP Data channel
It also has SFTP capability to some extent, but actually depends on a third-party library (Jsch) and I suspect the performance is not so good. I'm talking about Runftp. Ryu Lewske Wada wrote: Hi James, mericksonj wrote: The TCP port is entered correctly as 2121 when I connect to FTP, the FTP cpntrol session is started properly according to the server logs. I am not using SFTP since I have disabled the sub-system on my SSH server. I am trying to use SSH TCP forwarding alone to establish and maintain the ftp session sice most FTP clients won't support 1024 bit RSA key authentication. I am considering FTPS, but I'm not sure I want to open up another port to the internet. The SSH service is the only one I currently allow through the firewall. Can you tell me more about the Java error message I'm getting? or maybe if there are any android native FTP apps I can use? Well I don't know if you need two ports for FTP tunneled through SSH, but seems like you could not create a data connection for FTP over SSH. I recommend FTPS as it runs on usual FTP ports (21 for connection and some other for data channel) and is programmed in a secure and established manner using standard SSL package. I've developed an FTP client implementation using FTPS called Runftp and should be downloaded in Market. (Searched by Runftp maybe) Ryu -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Help needed with parsing some XML data !
Yeah, that's not what I mean by a test case. See http://junit.org as a starting point. (The Android SDK includes some limited version of JUnit I don't recognize. It's adequate for this purpose, but the full, modern version is better. For non-device testing, you're not restricted to the supplied one.) Basically, a test case is code that you can run to *automatically* test some specific aspect of a system. In this case, checking against a known set of XML (so it doesn't change), looking for the known desired result, and reporting failures (expected conditions not matching) and errors (unexpected exceptions thrown). This removes the variables from the equation. You're not depending on how things display, either in the UI nor in the log stream and windows. You're not dependent on a human to notice a problem. An best of all, you can automate it to always run when you build, so if you break later, you'll find out right away, while you know what you changed. And you can make changes freely, with the security of knowing that you won't have to go through some long test/debug cycle. I didn't answer your question about getting a stacktrace earlier, because you said NetBeans. I'm old enough to remember when NetBeans was the hot new thing -- but too old to remember how to do anything with it. Try using Eclipse and the ADK. It will show you the stack trace in the same way it shows any other stack trace, as if you were debugging locally. (I would expect NetBeans to, as well). Or you can catch the exception, and use exception.printStackTrace() to get it into the log (I'm surprised it's not already there). This isn't really an Android problem, and it's not necessary to debug it there. If you write your failing test cases, you can debug them on your desktop computer, get them working, and you should be set to go on the device. Another thing to realize is that not all character values you can come up with, are legal XML content. They *MUST* be valid printing Unicode characters. No random control characters -- for example, ISO-8859-1 byte values 0-31 (decimal). This will ALWAYS fail -- it is NOT well- formed XML. If that's the cause of your exceptions, your two choices would be to fix it on the server (probably by encoding this binary data) or to preprocess the fake-XML into real XML before you feed it to the XML parser. \ On Feb 3, 6:49 am, MobDev developm...@mobilaria.com wrote: well to begin with : thx for the expalanation :D I was wondering about your statement : Try logging to a file. Or better yet, create test cases, and verify the correct operation of your code via test suite, rather than via log statements. I already tried in a test case, which was to write the incoming data to a AlertDialog, but the result was that those characters are shwon on-screen with a rectangle with a ? in it... My idea (and test case) would be to stream a list of countries, and afterwards show this list onscreen so the user can select one... Our problem is that the whole system I am using is based on the ISO norm and cannot be changed to UTF-8 in a short period of time... Or am I misinterpreting your test cases and test suite ? And if so how should it have been interpreted ? On 3 feb, 13:26, Bob Kerns r...@acm.org wrote: Well, you found one way to get the encoding in there. A few more: InputSource.setEncoding(iso-8859-1) new InputStreamReader(stream, iso-8859-1); I'd argue that it should have gotten it from the ?xml... encoding=iso-8859-1? -- I'm a bit surprised it didn't. But it's something I'd never rely on if I know the encoding. Anyway, re: your problem below. It's probably working right, up to the point of the log statement. The log stream is probably taking those bytes, and then later they're being interpreted as UTF-8. or it's taking the characters from the string, and interpreting them as UTF-8 (via String.getBytes()) and passing them off to a log stream that doesn't know about UTF-8. Try logging to a file. Or better yet, create test cases, and verify the correct operation of your code via test suite, rather than via log statements. But if you have any control or influence over the server -- fix the problem there. ISO-8859-* should be of purely historical interest in interpreting old documents. The first draft of ISO-10646 came out nearly 20 years ago, and UTF-8 has been around for nearly 18 years. The world is international. It's time to put a stake in the heart of these national encodings. On Feb 3, 2:55 am, MobDev developm...@mobilaria.com wrote: Btw I also have tried this instead : try { URL url = new URL(http://www.myserver.com/xmlstream;); URLConnection conn = url.openConnection(); InputStream is = conn.getInputStream(); Xml.parse(is, Xml.Encoding.ISO_8859_1, new ExampleHandler ()); } catch (Exception e) { throw new
[android-developers] Re: Wakelock and phone restarts
I dont have any issues with wifi after holding on to wakelock...but yeah when I try to forward calls the phone starts rebooting itself ...I have to kill the service to stop it from rebooting again and again... I have no clue why that happens.. On Feb 3, 11:04 am, himanshu jain himanshu@gmail.com wrote: I had the same problem i used wake lock but still i think before i acquire wakelock wifi goes in sleep mode . On Feb 2, 11:45 am, nikhil nik...@gmail.com wrote: It seems there is a conflict between call forwarding and wakelock... Can someone test this out please? If you have a service which implements a wakelock (partial for my case), try enabling the call forward option in the settings when the service is running in the background... and please let me know here if the phone keeps restarting.. Please help people... On Feb 2, 10:51 am, nikhil nik...@gmail.com wrote: It seems there is some conflict between my service and call forwarding. Whenever I have my service running in the background, after I enable call forwarding the phone restarts and the keeps restarting. Has anyone experienced this? On Feb 2, 10:26 am, nikhil nik...@gmail.com wrote: What can cause thephoneto restart ? On Jan 28, 11:18 am, nikhil nik...@gmail.com wrote: Hello Friends, I have a service which holds on to a wakelock and the code is similar to this, public class WakeLockService extends Service { PowerManager.WakeLock wl; @Override public IBinder onBind(Intent arg0) { // TODO Auto-generated method stub return null; } public void onCreate() { PowerManager pm = (PowerManager) getSystemService (Context.POWER_SERVICE); wl = pm.newWakeLock (PowerManager.PARTIAL_WAKE_LOCK, My Tag); wl.acquire(); } public void onDestroy() { wl.release(); } For past two days, myphonehas been restarting randomly...Today it was worse, it kept restarting untill I uninstalled the app. I tried to search about this behaviour online and found that too many wakelocks may coz thephonetorestart. Can there be any other reason? Is the above code right? Should make wl as a final variable? Does the service call onDestroy method whenphoneshuts down? I am using a broadcastreceiver to start my service at boot up as well. Any help would be appreciated. Thank You So Much -- You received this message because you are subscribed to the Google 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: concept of user name
Yep, good idea, thanks. guich -- You received this message because you are subscribed to the Google 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: Suspicious TCP RST packets while device is sleeping.
Is it the delay in discovering the disconnect that's the issue? Exactly... The connection stays open to accept data from the server. There are definitely points in time when this wouldn't happen for a few minutes, and if the connection dropped, that wouldn't be a problem if the client noticed the disconnect immediately (it would just reconnect, and start waiting again). However, when the device sleeps, it doesn't see the disconnect until it wakes up (possibly hours later)... After a bit more research, it looks like if the client holds a wake lock infinitely (just for testing), it gets the reset packet immediately when the connection is killed, and re-connects immediately. However, if the device doesn't hold the lock, and goes to sleep, the reset packet is dropped somewhere... Anyone on the dev team able to explain that functionality (intended/unintended/workaround?) - Dan On Wed, Feb 3, 2010 at 3:30 AM, Bob Kerns r...@acm.org wrote: Well, I don't grok NAT enough to conclude that it's wrong. But I don't see why they'd do it -- unless they're trying to minimize traffic. Seems kinda trivial -- and likely more than offset by the later attempted transmit. I'm not sure what problem you're trying to solve. It can certainly happen that one side thinks a connection is open while the other thinks it's closed. The recipient sends a RST, the sender gets a connection reset and life goes on. Is it the delay in discovering the disconnect that's the issue? On Feb 2, 7:43 pm, Dan Sherman impact...@gmail.com wrote: Hey Bob, Thanks a lot for the response :) After a few more hours tonight working on the problem, I've got a bit more information to present. From everything I'm seeing, it looks like the issue has to do with NAT'ing at the network level (tmobile I'd imagine). The connection is definitely NAT'd, the client sees itself as one outgoing IP (14.130.xxx.xxx) and port, and the server sees an incoming connection from a different IP/port (208.54.xxx.xxx). My best guess is that tmobile is killing the connections at the NAT level after not seeing traffic running on it for a certain period of time (5 minutes in this case). This wouldn't be a problem, as you said, a reconnect works just fine. And in fact, the higher-level long-lived session control is already in place, and the client reconnects/etc properly when sensing a disconnect. The problem comes in based on _how_ the NAT is killing the connection. Keeping a wake-lock on device to prevent sleeping, and watching TCPdump on both sides shows the server receiving a RST packet, but no RST packet is sent to the client. The client sits there, assuming the connection is still active, indefinitely. The second it tries to do something (user-prompted, or via a ping timer), it sends a PSH packet to the server, and the server responds with a RST (it closed the connection when it got the RST from the NAT). Obviously if the NAT were to send RSTs both directions, this wouldn't be a problem, the client would notice the disconnect, and reconnect. But from everything I can tell, it notifies the server, and leaves the client completely unaware that the connection has been dropped... I understand that the NAT needs to clear out old/stale connections, but sending a RST uni-directionally seems a bit incorrect to me... Any ideas? - Dan On Tue, Feb 2, 2010 at 10:25 PM, Bob Kerns r...@acm.org wrote: This is expected behavior. TCP connections time out if the connection is lost, or either side dies. That way, you don't have systems drowning in dead connections. The RST packet is telling you that the server has forgotten about the connection. The client may even report it directly, if it realizes that it hasn't heard from the server, so you may get a connection reset error even without seeing an actual RST from the server. The default timeout is usually 5 minutes, which squares with your observations. In general, you should not try to solve your problem by increasing the timeout, but rather by reestablishing the connection, and maintaining long-lived sessions at a higher level. I'd recommend, if possible, dropping your AlarmManager ping task, in favor of reopening your connection. You'll consume less resources -- including battery. If you want to minimize the cost of reopening connections, you can send a ping whenever you happen to wake up, reopening if necessary. But that doesn't scale that well -- you'll be able to have more simultaneous clients if you strike a suitable balance between keeping connections alive, and the cost of reopening them. For rare interactions, you can support more clients if you open connections on actual need, and close them promptly when not needed. It all depends on exactly what you're trying to optimize, and the environment in which you're operating. The only constant
[android-developers] Re: StackOverflow, Threads and Stack Sizes
Quietly bumping.. R On Feb 2, 11:14 pm, Rich miser...@gmail.com wrote: Because hey, why the hell not. What about the stacksize argument to the Tread constructor? Is it always 8k, not matter is sent? R On Feb 2, 6:34 pm, Michael MacDonald googlec...@antlersoft.com wrote: Rich wrote: Hello! I've been looking around trying to find a definitive answer on this with no success, perhaps you guys can give me something concrete? Also, it doesn't help that Android dev has teamed up with the StackOverflow website, as it means that any questions relating to ACTUAL StackOverflows have become ungoogleable. :) What are the size and depth limits of an application stack? My app crashes like this: Why in the world would you be trying to run git on the phone?!? In any case, the stack size I believe is 8k; you can have 8k bytes on the stack before it blows up. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android 2.0.1 SocketTimeoutException received with FTP Data channel
You're reinventing the wheel here, back before they invented circles. SFTP uses the same port as SSH (22 is the standard, but you can substitute if you want to throw off port-scanners) -- you would not be opening another port. FTP is *extremely* problematic in the modern world. Originally, it required that the SERVER open a port back to the CLIENT. This almost always fails, these days, due to NAT, firewalls, etc. But it is still the default in many clients. Even if you managed to make it work, it would be highly insecure -- your data would NOT be going through your secure channel, and you must open up ports on the client! You'd have to use so-called passive FTP. You may even find clients that don't implement it. You're certainly going to be plagued with client differences. You're certainly doing kinda-a-the-same-thing, but with a lot more complexity, security issues, and problems. Really -- if you have control over the server side, DO NOT implement FTP. On Feb 3, 9:01 am, mericksonj mericks...@gmail.com wrote: The TCP port is entered correctly as 2121 when I connect to FTP, the FTP cpntrol session is started properly according to the server logs. I am not using SFTP since I have disabled the sub-system on my SSH server. I am trying to use SSH TCP forwarding alone to establish and maintain the ftp session sice most FTP clients won't support 1024 bit RSA key authentication. I am considering FTPS, but I'm not sure I want to open up another port to the internet. The SSH service is the only one I currently allow through the firewall. Can you tell me more about the Java error message I'm getting? or maybe if there are any android native FTP apps I can use? Thanks! --James -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android 2.0.1 SocketTimeoutException received with FTP Data channel
This is the standard result when trying to do active FTP and the server cannot connect to the random port the client is listening on. Yes, in standard FTP, the client must act as a server. On Feb 3, 9:15 am, mericksonj mericks...@gmail.com wrote: This works just fine on the Droid, and I am very impressed with my android experience so far, I just can't get an FTP- Data session to connect without this timeout error. Thanks again! --James -- You received this message because you are subscribed to the Google 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: XML Parsing
He wants to use SAX. On Feb 3, 10:44 am, Tommy droi...@gmail.com wrote: This is how I have done it. When there are no more entries it exists try{ try{ String stationfeed = urls; url = new URL(stationfeed); ((xmlName)this.getApplication()).setXMLName(urls); URLConnection connection; connection = url.openConnection(); HttpURLConnection httpConnection = (HttpURLConnection)connection; int responseCode = httpConnection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK){ InputStream in = httpConnection.getInputStream(); DocumentBuilderFactory dbf; dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); //Parse the feed Document dom = db.parse(in); Element docEle = dom.getDocumentElement(); //Get list of each entry NodeList nl = docEle.getElementsByTagName(stations); if (nl != null nl.getLength() 0){ for (int i = 0; i nl.getLength(); i++){ Element entry = (Element)nl.item(i); Element sname = (Element)entry.getElementsByTagName(StationName).item(0); Element sloc = (Element)entry.getElementsByTagName(StationLocation).item(0); Element sid = (Element)entry.getElementsByTagName(StationId).item(0); Element sdis = (Element)entry.getElementsByTagName(StationDistance).item(0); Element stype = (Element)entry.getElementsByTagName(StationPredictions).item(0); String namer = sname.getFirstChild().getNodeValue(); String loc = sloc.getFirstChild().getNodeValue(); String ids = sid.getFirstChild().getNodeValue(); String dis = sdis.getFirstChild().getNodeValue(); String types = stype.getFirstChild().getNodeValue(); //Add the station to the list //Stations station = new Stations(namer, loc, ids, dis, types); submitStation(namer, loc, ids, dis, types); } } } }catch (MalformedURLException e){ e.printStackTrace(); }catch (IOException e){ e.printStackTrace(); }catch (ParserConfigurationException e){ e.printStackTrace(); }catch (SAXException e){ e.printStackTrace(); } finally{ } }else{ //RETURN AN ERROR } } I hope this helps you in some way. From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of Kevin Duffey Sent: Wednesday, February 03, 2010 12:36 PM To: android-developers@googlegroups.com Subject: Re: [android-developers] Re: XML Parsing If you're using xml pull.. just go until you find the start_tag + the name of the node you need, then exit out of the while loops. On Wed, Feb 3, 2010 at 8:18 AM, Frank Weiss fewe...@gmail.com wrote: Add a boolean variable that is set on segfirstroute startElement and cleared on segfirstroute endElement. Us it to ignore the date element. -- You received this message because you are subscribed to the Google 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 athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: XML Parsing
I sent you a program last Friday that showed how to do this. You replied then, saying you would look at my example on Monday and reply to me then. You never did. On Feb 3, 12:02 am, Sasikumar.S sasikumar.it1...@gmail.com wrote: Hi, I'm having a XML file like *sample.xml* * * *maintag* *firstroute* *datejan 25th/date* *segfirstroute* *datemar 6th/date* */segfirstroute* */firstroute* * firstroute dateapr 18th/date segfirstroute datejuly 29th/date /segfirstroute /firstroute * */maintag* In this i need to parse date tag. I need only the date tag in firstroute only not in segfirstroute. I need jan 25th apr 18th. But i'm getting jan 25th, mar 6th , apr 18th july 29th. how to get only that 2 tags?... -- Thanks Regards Sasikumar.S -- You received this message because you are subscribed to the Google 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] bind to a remore service
Hallo, i have made an application that is consisted of an activity and a service.The service has an interface (created by an aidl file) including methods implemented in the service.My activity binds to the service and calls some methods of the service.All good till now.My problem is when i want to bind to a service that belongs to a different package from my activity.My activity doesn't have visibility of the remote interface and i cannot import it : public class Client extends Activity { /** Called when the activity is first created. */ IGps mservice=null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent i=new Intent(); i.setComponent(new ComponentName(aexp.share.sharedapp3, aexp.share.sharedapp3.Service_impl)); bindService(i, conn, Context.BIND_AUTO_CREATE); } ServiceConnection conn=new ServiceConnection() { @Override public void onServiceDisconnected(ComponentName name) { Log.e(TAG,DISCONNECTED); } @Override public void onServiceConnected(ComponentName name, IBinder service) { mservice=IGps.Stub.asInterface(service); try { double a=mservice.getLat(); String a_str=Double.toString(a); Log.e(TAG,a_str); } catch(RemoteException e) { } } }; } Here i cannot see the IGps interface,Am i doing something wrong? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en