android

Android Bluetooth: Connect()/Disconnect()

I currently am designing an app which needs to connect to a device, write/read data, and close the connection reliably. Currently I have the write/read solid. My disconnect and then reconnect is terribly unreliable, and often actually crash the phone.. and sometimes Eclipse. I've been looking through numerous articles trying to figure...

layout ideas for android

I've been toying around with a lot of different layout structures and can't seem to find the best one for my solution. Essentially I need 3 rows that each take up 33% (height) of the device (in landscape mode). I thought would be perfect, but I can't seem to find a way to specify the height of a . It's possible I've overlooked a prop...

Android: Is it possible to have a Spanned with part of it's text focusable within a TextView?

I have this currently. ClickableSpan span = new ClickableSpan(...){...}; String text = "I am some <b>awesome</b> text"; Spanned spanned = Html.fromHtml(text); SpannableStringBuilder builder = new SpannableStringBuilder(spanned); int start = builder.nextSpanTransition(0, builder.length(), StyleSpan.class); int stop = builder.nextSpanTra...

Build android branch missing imports

I'm working on nifty enhancements to an Android app and I've cloned its source from android.git.kernel.org. How does one deal with imports not found, for example: import android.content.entity* import android.os.ServiceManager import com.google.android.collect.* import com.android.internal.* etc. This is with a checkout of tag Androi...

when is onSizeChanged() called?

Hi, Is onSizeChanged() called once the user touches some part of the screen? I'm confused about the order in which onDraw(), onMeasure() and onSizeChanged() are called. Thanks ...

How do you get the newly added entry's URL if you are using batch operation on Contacts Provider

If you are using incremental approach in adding a record to Contacts Data table, after an insertion, you get the URL of the newly added record so that you can perform query or update operation. Now if you are using batch operation like following, how do you get the reference to the newly added record? // Create RawContacts...

android - filling ListView with array

I can't fill a ListView layout with an array of strings. Here is the Activity: ListView symptomList = (ListView) findViewById(R.id.ListView_Symptom); String symptomsArray[] = new String[1024]; // Then I fill up symptomsArray ArrayAdapter<String> adapt = new ArrayAdapter<String>(this, R.layout.menu_item, symptomsArray); symptomL...

Android: Help creating a button that produces the same result as hitting the down key on the D-Pad? (part 2)

Why doesn't this work?? I am trying to create an onClickListener for a button that produces the same effect as pressing the "down" key on the D-pad. Eclipse gives me an error, saying: "Cannot make a static reference to the non-static method sendDownUpKeyEvents(int) from the type InputMethodService" Help! downButton.setOnClickListener(ne...

Highlight ListView row based on id

How can I highlight a row in a ListView backed by a CursorAdapter knowing the row ID of the item? ...

Streaming ASF (Windows Media Player) ANDROID

How could achieve Streaming of .ASF (Windows Media Player) in Android? ...

How to add your application to the "share this place" list in Google maps

Google maps now offers a way to "share a place" with what appears to be a predefined list of sources. When users search for a place on Google Maps, whether it's a specific address, cross-street, or restaurant name, there's a new button called "share this place" that posts the location info to Google Buzz, Facebook, Twitter, or via e-mai...

decodeResource returns null on HTC Legend and some Samsung phones.

Hi All, I'm having a strange problem with decoding resources on SOME android phones, my game has been out on the market and 90% of the users are happy, however for some reason Samsung Moment/Behold and Legend crash. Stack trace points to this line of code: Bitmap bmp=BitmapFactory.decodeResource(PaperPlaneX.paperplane.getResources(), t...

Avoid internal getters/setters - Game

Hello! I working on a Game. The View, Thread and the Engine are done. Now I going into how to, for example, set Coordinates to my Bitmap. I have successfully done that using getters/setters-method. I've been reading around the web there the most of the good game developers say that "make your member variable public" and all that stuff....

Copying text from a textview

Looking at the source of TextView (Android 2.2 version), it seems that copying from a textview is supported (Source). Anyone know how I can enable this in a TextView? ...

How to get rid of the program name bar at the top of the application?

hi, i would like to get rid of the defualt grey bar which apears at the top of my application. I just can't seem to find the attribute or setting to do so. how can this be achived? thanks ...

Android: Using tiwlan0 to determine wireless connected status for Droid

Hello, I want to be able to check the status of Droid's wireless and I was hoping that by reading /sys/class/net/tiwlan0/wireless/status I could find out if it was actually connected or not. I already know that I can check if my wireless is enabled/disabled but I want my app to notify the user if the wireless gets disconnected. Howeve...

Sync Two ScrollView

Situation: I have two ScrollView inside of each of two HorizontalScrollView of a TableRow. Goal: When I touch drag one of ScrollView, another ScrollView must scroll as much. For instance, if I have a list of name on left ScrollView and corresponding phone numbers in right ScrollView, scrolling one ScrollView should not destroy the origi...

Correct way to add objects to an ArrayList

I am trying to add an object to an arraylist but when I view the results of the array list, it keeps adding the same object over and over to the arraylist. I was wondering what the correct way to implement this would be. public static ArrayList<Contact> parseContacts(String responseData) { ArrayList<Contact> Contacts = new Arra...

Android Search Market on Keyword URL?

To Launch the market I usually do this: Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:com.package.package2.package3")); startActivity(intent); But I would like to run a search based on a keyword like "Happy Toasters" What is the URL for that kind of search? ...

Need for ViewParent.disallowInterceptTouchEvent?

Views may at any time invoke disallowInterceptTouchEvent() which will prevent parent views from handling touch events. In short, what is the need for this API? I see that lists use it when a scroll is initiated, but why? The list would still receive ACTION_CANCEL if a parent view intercepts the event, so why would it specifically want to...