android

View user's twitter feed in Twitter app?

Hi, I have a user's twitter handle. Right now I'm opening it through a web page like: String url = "http://www.twitter.com/" + "example_handle"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(intent); If the user has the Twitter android app installed, is there a different intent I can use which gives th...

How to reference R.java of other apps in Android, like com.android.music?

I am trying to develop an app to supplement the built-in music player. I've used git to download the com.android.music package and looked around at its code. I can launch the music player by copying some of its code and launching activities with intents. Now what I need to do is get a handle to its current view. In the MusicUtils.jav...

How to clear all activities in Android app

My app has many activities that can be called in any order Example Activity History: A -> B -> C -> D -> A -> B -> E Now in activity E, I am 'deregistering' the device (logging the user out, and deleting any data they might have downloaded to their sdcard). The desire behavior is that the app 'starts over' and the user is prompted wit...

Question about getting current location in Android

I have few questions about getting current location of the device. I believe only way to do that is using requestLocationUpdates(....). if I subscribe to requestLocationUpdates... with duration set to 1 hour and after 1 hour if my phone is sleeping (or during that 1 hour I rebooted my phone), does the listener still work? A. If yes...

Android Development: File Browser For Reading/Saving Files

Does anyone know any good tutorials for this please? Or could anyone run me through some basic code for making this? Please & thank you, Alex. ...

Clickable item with clickable urls in ListView

I have custom ListView item with ImageView and TextView. TextView contains HTML string with urls and some regular text. Im my adapter I have code similar to tv.setText(Html.fromHtml("<a href='http://google.com'&gt;google&lt;/a&gt;")); tv.setMovementMethod(LinkMovementMethod.getInstance()); and this works great but onListItemClick isn...

Difference Between a Task Killer Killing an App and the Android OS Killing an App

Is there any difference between what happens when you use a Task Killer App to kill an app vs. what happens when the Android OS kills an app due to scarce resources? The Android SDK says that the Application.onTerminate() method isn't called when the OS kills an app due to scarce resources. So it sounds like the OS doesn't cleanly close...

How can I restart a thread in java/Android from a button?

I have a thread in java/Android like this: Handler handler = new Handler() { @Override public void handleMessage(Message msg) { // TODO Auto-generated method stub update_i(); } }; @Override protected void onStart() { // TODO Auto-generated method stub super.onStart(); Thread myThread = new Th...

How to get an APK into the market with an extra certificate... because I lost my first keystore

My keystore has gone missing. I most likely deleted it by mistake, but I can't find it in my recycling bin. --My keystore was originally in my bin folder, not a good place for it as files get automatically deleted when publishing I know the details for the previous keystore... except maybe the date of expiry. I want to put an update o...

Passing object to method in java appears to be by reference (and Java is by val)

I thought when you passed objects to methods in Java, they were supposed to be by value. Here is my code: public class MyClass{ int mRows; int mCols; Tile mTiles[][]; //Custom class //Constructor public MyClass(Tile[][] tiles, int rows, int cols) { mRows = rows; mCols = cols; mTiles = n...

Android: Image button as a hyperlink, phone call, map directions?

I have a simple app that I'm putting together for my company. I have 4 buttons that I've created but can't seem to get them to link correctly. One button should open our mobile site, another button to call us, another button to map to us, and the final button linked to our "News" site. Any help would be greatly appreciated! ...

Debug Android.mk

Hello all, I am building Froyo, is it possible that during building, make/python can output the file and the command it is calling right now. For example, in one of the Android.mk, there is a line, says, echo build success. On the monitor it will show "build success", what I want is that in addition, it shows "Android.mk line 20: ech...

Singletons vs. Application Context in Android?

Recalling this post enumerating several problems of using singletons and having seen several examples of Android applications using singleton pattern, I wonder if it's a good idea to use Singletons instead of single instances shared through global application state (subclassing android.os.Application and obtaining it through context.getA...

Do I have to clean up all dialogs 'show' by my activity

Hi, In my activity, I show a dialog under some condition like this: public void showADialog(String title, String msg) { if (mIsActivityRunning) { new AlertDialog.Builder(this) .show(); } } My question is what do I need to do to ensure there is no resource leak? From the logcat, i see there is a case where it ...

Phone slope Android

I want to write game for Android and I need to use inside AI phone slope in some way ( in degree or any other measure). Can anybody tell me how to do that(link or code sample) ? ...

Android ContactsContract.Contact missing constants from the API?

I've been using the ContactsContract api for some time now and I've come across two "columns" listed in the API page for ContactsContract.Contacts that do not appear to actually be assessable. The values are (under the columns heading): "NAME_RAW_CONTACT_ID" and "DISPLAY_NAME_PRIMARY" By my reading of the API these two values would see...

Setting UI preference Summary field to the value of the preference

New to Android, I have some code when the user changes a preference I update the Summary field in the UI preference to be the value they entered. However, when the preference activity is created I'd like to set the Summary fields to be the values in the corresponding preferences. Please advise. Thanks. public class MyPreferenceActivity...

Trigger Google Maps from Android browser

I have a website designed for the android browser using jquery/jqtouch. As a part of it, i have a map page that loads. In the process of displaying my data, I found that some of my customer's addresses, when clicked kick of the google app map, with the data sent to it. It also seems to load and run a ton faster (as well as having all ...

ImageView animation help

Hello, I'm trying to figure out how to animate in and out of Imageviews. Basically I have a LinearLayout with an ImageView and a Button at the bottom. Everytime the button is pressed, onClick() is invoked and I do image.setImageResource(imageArray[imageCounter]); I simply change the image displayed on the ImageView by selecting diff...

How to define ColorStateList for TextView?

When my ListViewItem is highlighted, I want the text to turn white. How can I define this? <selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; <item android:state_focused="true" android:color="@color/testcolor1"/> <item android:state_pressed="true" android:state_enabled="false" android:color="@color/testcolor2...