android

Android - Custom App Themes that are freely available

I want to make my Android app look a little bit sexier but as I don't have knack for design I was wondering if there are other themes that are available for importing into your Android app (like the Dark and Light themes that come with SDK)? I do not expect a Theme that would make Android app look like an iPhone app, but anything that w...

What's the best way to uniquely identify Android users to a server?

How should I go about identifying an android user to a server. Should I get the IMSI number and some salting algorithm? Considering androids space and performance limitations is there a library that isn't too heavy that I can use to do the calculation? ...

Using the merge tag in layouts to add external layout resource?

I have a layout I want to reuse, it looks like: <LinearLayout .. > <Button /> </LinearLayout> It is in a file called "reuseme.xml". Now I have an activity layout, which like the following, how can I incorporate the layout above into it?: <LinearLayout> <TextView /> <TextView /> <ReuseMeLayout /> // How do we add this here? </...

Set drawable opacity

How can i set the opacity of a Drawable object? ...

problem with calling invalidate in async task thread in Android !

Hi Everyone, I am trying to call the invalidate() from asyntask thread. I am getting this error : 10-18 15:14:30.469: ERROR/AndroidRuntime(889): Caused by: android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. The line I have used is : mainClass.myMapV...

Problem adding textboxes dynamiclly in a relative layout

I am having trouble dynamically adding a text box to my view. More specifically, the text-box-adder works, but the button I am trying to move below it does not. The original view is the first picture in the below hyperlink. After the +/- button is pressed, it should add a text box between the second text box and the decide button, and t...

Context menu in list activity.

Hi. I have list activity with custom array adapter and I can't to get context menu when make long press on list item. <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <FrameLayout android:id="@android:id/tabcontent" ...

Altering ListView items at runtime

I have a ListView which is defined in a layout XML. I have another XML whcih defines TextViews that are elements in each of the items in the ListView and in code use the 'inflator' mechanism . There are 3 TextViews named top, middle and bottom. During the runtime life of the ListView I change some text in the bottom row of one the L...

Android: how to make a clickable map image with each country producing a different action?

Hi there, I need to display a pretty image of a map of Europe, and I want my app to, e.g. bring up a different activity, when the user clicks each country - each country on the map needs to have a different onClickListener (or equivalent). Essentially, I need to be able to call a different function when the user taps on France rather t...

Recommendations for Android app development and test hardware

I’m looking for recommendations for what people are using to get access to development hardware for developing and testing Android Apps. I see three choices that make sense: Buy Nexus One devices off contract from Google’s developer program (http://www.google.com/phone/detail/nexus-one) Buy used or new off contract devices from Ebay or...

Android - getting AppWidget Position

Hi, I'm trying to get my widget button (or the Widget itself) position to pass it to another activity triggered by this button. I've tried like this at the other activity on onCreate() method, and NPE is happening: Button b1 = (Button) findViewById(R.id.ButtonLogin); int[] outLocs; if (b1.getWindowToken() == null) outLoc...

android locale 2nd part code ignored

My question is exactly the same as this one. http://stackoverflow.com/questions/3599508/how-to-set-different-locales-in-android I checked, my phone supports en_PK and en_BE. My resource folders are values-en-rPK and values-en-rBE. When i change locale, android seems to ignore the 2nd part of locale (country code), and always picks the...

How to accept preferences in the emulator?

Hi, I've just created some preferences using the PreferenceScreen XML following the Earthquake example from Wrox's "Professional Android Development" book. Using the emulator, how do I accept the preferences? If I use the back button I return a Activity.RESULT_CANCELED. So which key returns the Activity.RESULT_OK code? Thanks. ...

Java Android App - Simple AI for Texas Hold'em

Hi All! Could anyone point me in the right direction on this. I have 20+ weeks to design and code a Texas Hold'em Poker Game in Java for an Android phone for a University Project. It should include AI opponents that play with you or just against themselves. They should be able to learn what strategies work best over a period of time, con...

How to capture an android application's onPause event?

My android application is consists of 20+ activities. I want to perform some task when application is in background (not an specific activity) and want to perform some other task when application is resumed. How to do this? I couldn't find onPause() and onResume() methods in Application class. ...

Take use of the native spinner in Android.

I want to rebuild (maybe I don't even have to) the nativ android progress indicator and show it as icon for a list item. I followed this example and endet up with a heavy performance eating animation, which also doesn't match the native spinner. The code has as "LinearInterpolator" which seems to cause those problems. Now I made my own ...

Using telephony functionality from Android app

I am just getting started developing my first Android app, and one function that I need the app to do is to be able to place a voice call and play a recording into the call. I have been looking all over the place and I cannot find the ability to do this in the Android SDK. I do see there is com.android.internal.telephony which does seem...

Android. WebView and loadData

It's possible to use following method for content's setting of a web-view loadData(String data, String mimeType, String encoding) How to handle the problem with unknown encoding of html data?! Is there a list of encodings?! I know from my college that in my case html comes from DB and is encoded with latin-1. I try to set encoding par...

Set maximum width of Linear Layout

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <EditText android:id="@+string/urlText" android:layout_width="fill_parent" android:layout...

listview addFooterView problems

i have content i need to display above my listview and below, so much that a scrollview would be great to use if you could use scrollviews and listviews together. Since thats not the best solution, i've been trying to do a couple of things to add footer content to my listview, here the pic below shows what happens when i add a differen...