What I’m trying to do is play the first video retrieved from the external SD card, which on my T-Mobile G2 turns out to be the sample video for the phone. Now I assumed that since it plays in the phones video player, that it’d have no problems playing in the VideoView in my test app. However, all I get
Tag: android
Using Regular Expressions
I am having problems trying to use the regular expression that I used in JavaScript. On a web page, you may have: Renewal Date: 03 May 2010
I just want to be able to …
Turning a string into a Uri in Android
I have a string, ‘songchoice’. I want it to become a ‘Uri’ so I can use with MediaPlayer.create(context, Uri) How can I convert songchoice to the Uri? Answer Here’s the doc http://developer.android.com/reference/android/net/Uri.html#parse%28java.lang.String%29
How do you get the selected value of a Spinner?
I am trying to get the selected items string out of a Spinner. So far I have gotten this: This does not work and gives a class casting exception (I thought I could cast a View to a widget that inherits it. Obviously not!) So how do you get the selected value of a Spinner? Answer To get the selected
custom listview adapter getView method being called multiple times, and in no coherent order
I have a custom list adapter: in the overridden ‘getView’ method I do a print to check what position is and whether it is a convertView or not: The output of this (when the list is first displayed, no user input as yet) AFAIK, though I couldn’t find it stated explicitly, getView() is only called for visible rows. Since my
Cursor while loop returning every value but the last
I am using a while loop to iterate through a cursor and then outputing the longitude and latitude values of every point within the database. For some reason it is not returning the last (or first depending on if I use Cursor.MoveToLast) set of longitude and latitude values in the cursor. Here is my code: From this I am getting:
Android Reading from an Input stream efficiently
I am making an HTTP get request to a website for an android application I am making. I am using a DefaultHttpClient and using HttpGet to issue the request. I get the entity response and from this obtain an InputStream object for getting the html of the page. I then cycle through the reply doing as follows: However this is
IntelliJ IDEA with Junit 4.7 “!!! JUnit version 3.8 or later expected:”
When I attempt to run the following test in IntelliJ IDEA I get the message: “!!! JUnit version 3.8 or later expected:” It should be noted that this is an Android project I am working on in IntelliJ IDEA 9. The full stack trace looks like this… Answer This problem happens because Android Platform (android.jar) already contains JUnit classes. IDEA
Android floating view (over other views)
I’ve been messing around with this for a few days now, hopefully someone here can lend me a hand. I have a simple two-column layout, the left side is a navigation bar with buttons, the right side is …
Delete SMS in Android 1.5
There are many questions about it, no answers are working in my application 🙁 I need to remove SMS from a receiver, even if the user can see it, but it must be removed programmatically. How can I do it? The most suitable I have used was the following, but it doesn’t work 🙁 Answer After refactoring my code I