android

Android : Several activities sharing common code

I have an Android application composed by several Activities. Most of them need to check whether an active network is available or not: public boolean isNetworkAvailable() { ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); TelephonyManager tm = (TelephonyManager) getSystemService(Co...

Launching Intent cannot find Activity

My program has a list of tabs that each contain a list of people. Clicking a person should edit their details, but instead, clicking a person throws an ActivityNotFoundException. My code that starts the edit activity: Intent intent = new Intent("my.package.EDIT"); // Person is both intent.putExtra("my.package.PERSON", (...

String to Integer not working

Humm... I can do this easily in Java (and all other languages) but, it doesn't seem to work in Android. I simply want to get an integer number input from the user, press a button and do some simple math on it, then display it. I'm using a TextEdit (also tried a TextView) and have tried many different approaches but, none work. The cod...

Can you include large videos files in Android applications?

I was wondering if the Android had any limitations that would prevent 300+ MB's worth of videos to be included in the application? Currently, I have several iPhone apps that do this, and due to demand, I am looking at the possibility of porting them over to the Android. ...

Android Install Eclipse project onto DeviceAnywhere

How can I install an Eclipse Android project onto deviceanywhere to test on different devices? Thanks Chris ...

Handling UI Events in Android

I'm trying to modify some code I found online to my needs. It is supposed to catch a MotionEvent (a fling in particular) and launch a separate activity. I am new to java, so I'm having some trouble understanding the code. Here's what I have so far: public class Hypertension extends Activity { private GestureDetector flingDetector; Vie...

How does Froyo display a Dialog atop the home screen?

I upgraded my Nexus One a few days ago with 2.2 (Froyo). This morning when I went to use it I saw a Dialog sitting atop the home/launcher screen notifying me that an update was available and that I could choose to upgrade now or later. My question is, what API mechanisms is this using to show a Dialog (perhaps an AlertDialog) atop the h...

Read file from android based device ?

Hi, I am new to Android and Java so pardon me if the question sounds stupid. I have connected a device to PC which runs android OS. Once the device is attached I can see its direcotry F:\ . How do I write a code in JAVA which can display me those files. I am using Eclipse IDE and Android plug in. Thank you ...

multicastlock using

I'm trying to find out how use android multicastlock for capturing packets not addresed to device. As i understand SDK, i can capture them. Can you show how capture them, or advice how use multicast lock. ...

How can I launch the QuickContact action in android 2.1

Hi, Can you please tell me how can I launch the QuickContact action in android 2.1. Like the one shown here: http://1.bp.blogspot.com/_GTM_W5mVPTU/S-rk_0rla6I/AAAAAAAAADs/dUw4bDiagO4/s1600/Contacts.png Thank you. ...

Android - How to get current screen orientation

I simply want to do: if(getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) setContentView(R.layout.search_portrait); else setContentView(R.layout.search_landscape); The problem is - getRequestedOrientation always returns -1. Any suggestions? ...

Best strategy to implement this behavior in Android app?

In my Android app, I have some data that needs to be synced daily but also needs to be updated every hour when a user is inside the app. I have already implemented a service that gets called from an alarm for the daily update. Im having a problem with developing a strategy to do the hourly sync. I could use an hourly alarm too and fire ...

set focus on any item of listview in android

I have a listview which contains textviews as its elements. Now i want the first item of the list to be automatically focused when i launch the application How can i set the focus on any item of the list when i click on the some other view for example a button? ...

Android - Timed UI events (with pause/resume)

I am looking to create timed events which trigger UI changes (like a Toast) on Android. I already know you can do this with a Handler object's postDelayed(runnable, timeDelay) method (see this page for a great example). Here is the twist: I also need to be able to pause and resume the countdown for these events. So when a user pauses th...

How to bold specific elements from a Database using a SimpleCursorAdapter

I have a main activity that takes elements from a database and displays them in a clickable listview. I use this method to accomplish the task: private void fillData() { // Get all of the notes from the database and create the item list Cursor c = RequestManager.getRequests(getApplicationContext()); startManagingCursor(c); ...

Decompiler for APK?

I know it is not right to do this, but is there any APK decoder/decompiler available around? ...

PendingIntent works correctly for the first notification but incorrectly for the rest

protected void displayNotification(String response) { Intent intent = new Intent(context, testActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, Intent.FLAG_ACTIVITY_NEW_TASK); Notification notification = new Notification(R.drawable.icon, "Upload Started", System.currentTimeMillis(...

Finding which BroadcastReceivers are registered?

I have a program that monitors incoming SMS's, and I want it to monitor them full-time, so I registerReceiver with a Broadcast receiver that I've created. The problem is, if I want to unregister that receiver, I can't unless I know the original BroadcastReceiver class I registered. This is not a problem if I set it to stop when the progr...

Android: ContactsContract.Intents.Insert.POSTAL String format

In addition to the address, I want to include city, state and zip in Intent.ACTION_INSERT_OR_EDIT. It seems that in the Android SDK the string format is not precise in how to include city state and zip. Any insight? ...

How to download file on android emulator ?

Hi, by using web services we are able to download file from cloud to buffer storage. We need to now access this downloaded file from buffer memory and move it to SD card. I am using Eclipse and Android plug in. Can someone share any code ? My code snippet is below. String filename = "Test.zip"; URL url = new URL(FromUrl)...