android

Android disable activity

How can I make an activity temporarily not touchable and not focusable ? ...

IllegalArgumentException: width and height must be > 0 during zoomOut in Google MapView

I'm trying to zoom in on a Google MapView on step in the oncreateMethod of my Activity. Everytime I try to zoom the map via the mapController I get an IllegalArgumentException: 04-15 10:16:51.012: ERROR/AndroidRuntime(528): java.lang.RuntimeException: Unable to start activity ComponentInfo{android.client/android.client.ui.showstores.Sto...

How to call a new thread from button click

Hi, I'm trying to call a thread on a button click (btn_more) but i cant get it right. The thread is to get some data and update the images. The problem i have is if i only update 4 or 5 images then it works fine. But if i load more than 5 images i will get a force close. At times when the internet is slow I will face the same problem to...

how to automatically install an apk

Hi , Is there a way to automatically trigger the installation process of a just downloaded apk ? Currently after I download the package , nothing happens unless I click the package ,in which case the packege installer is launched ! The tomcat server from where I download the package has in the web.xml file the following : <mime...

how to send image to remote server using web services in android only stored in byte array not bitmap

hi sir i am new in android i am developing uploadImage in sdcard save bytearray in .net webservices public class ImageTest extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main)...

Can I use a static variable from a Java class in res/values/styles.xml?

I want to refer to a static Java variable in my styles.xml, is that possible? Here's a pseudo-xml example: <style name="Artwork"> <item name="android:background">@drawable/border_{Constants.MY_COLOR}</item> </style> ...

How to display a route between two geocoords in google maps? (Android)

Hi guys, I'm just writing an App for displaying the route between two coords (lat, long) in google maps view. Displaying an single coord (even with a marker) works fine, but how to do this with 2 ones and the route between them? I must admit that I'm quite new to Android and the maps-API... ...

getting all contacts (including from other syncAdapters) in android content handler.

Hi i have this Query: private Cursor getContacts(CharSequence constraint) { boolean hasConstrains = constraint != null && constraint.length() != 0; Uri uri = ContactsContract.Contacts.CONTENT_URI; String[] projection = new String[]{ContactsContract.Contacts._ID, ContactsContract.Contacts.DISPLAY_NAME }; String sele...

Android: How to create a Dialog without a title?

I'm trying to generate a custom dialog in Android. I create my Dialog like this: dialog = new Dialog(this); dialog.setContentView(R.layout.my_dialog); Everythings works fine except for the title of the Dialog. Even if I don't set the title of the dialog the dialog popup has a blank space at the position of the dialog. Is there any ...

Moving the Gallery view to the next image on one swipe in Android?

Hi All, I have four images in the Gallery View. When we do swipe from left to right or right to left the Gallery View moves all the images i.e if I swipe from left to right from the first image then it will move to all the four images. What I want is that when I swipe it should only move to the next image. Can someone let me know how ...

Changing locale: Force activity to reload resources?

So I have a language setting in my application. When the language is switched, I would like all the textviews etc to change language immediately. Currently I just change the locale in the configuration, so the language has changed when the user restarts the activity. An ugly solution to my problem would be to make each textview load the...

How to center drawableTop and text vertically on the Button in Android?

I have the Button defined as follows: <Button android:drawableTop="@drawable/ico" android:gravity="center" android:id="@+id/StartButton2x2" android:text="@string/Widget2x2StartBtnLabel" android:layout_width="0dip" android:layout_height="fill_parent" android:layout_weight="1" android:background="@drawable/widgetbtn_bg" /> The...

Expression parser library for Android.

What is the best way to evaluate simple conditional statements like: "a>b" ? "x-4<10+y & y>x" ? Expressions are loaded from external file. Variables are set in application. Syntax used is not essential. It may be "&" or "and" or any other supported with language/library. I need to take different action depending on result of evaluat...

ffmpeg for a android (using tutorial: "ffmpeg and Android.mk")

Hi to all, I am trying to compile ffmpeg for a android. I have found several posts on this theme but non of these seems to work. If tried to build ffmpeg like it is posted on [1]. Did anybody successfully compile ffmpeg using theses tutorial? I am not sure how to realize step 4 to 5. STEP4: Configuring ... STEP5: cd to your ND...

application crashes while putting setContentView in thread class in emulator

when I put the setContentView in thread as below, it crashes while running in emulator. new Thread(){ public void run() { setContentView(R.layout.main_layout); } }.start(); ...

tracing Outgoing SMS

Dear, Currently i am using ContentObserver on the Uri ContentResolver contentResolver = context.getContentResolver(); SMSObserver m_SMSObserver = new SMSObserver(context); contentResolver.registerContentObserver(Uri.parse("content://sms"), true, m_SMSObserver); in this manner onChange method call in both the cases i.e incoming and ou...

[android] showing dialog while loading layout by setContentView in background

I am using below code where , i want to show dialog in front and loading content in background but not able to do the same . Please advise. dialog = ProgressDialog.show(this, "", "Loading. Please wait...", true); runOnUiThread(new Runnable(){ public void run() { setContentView(R.layout.main_layout); dialog.dismiss(); } }); ...

onDownload complete notification

Hi' Is there a piece of code I could write to be notified when a download finishes in android, and be able to execute some custom actions on this event ? ...

Intent provided by Cursor is not fired correctly (LiveFolders)

In my desperation with trying to get LiveFolders working, I have tried the following in my LiveFolder ContentProvider: public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { MatrixCursor mc = new MatrixCursor(new String[] { LiveFolders._ID, LiveFolders.NAME, LiveFolder...

Is there a built in API for handling pinch-zoom functionality in Android

Hi there, I just wanted to know if there is some kind of class to use the multitouch features of android 2.1. Specifically I am trying to implement pinch-zoom and was wondering if I always have to measure the distance between two touch events and calculate the zoom level on my own? Thanks, chris ...