android

How to launch the android browser?

I have the following code: Intent myIntent = new Intent(Intent.ACTION_VIEW, ContentURI.create(arAdapter.getItem(position).getUrl())); startActivity(myIntent); But I get the compile time error: ContentURI cannot be resolved. How can I fix this? or is there a different way to launch the android browser? ...

List assets in a subdirectory using AssetManager.list

My application has an assets directory in which I've dumped a bunch of text files I need to load at runtime. I have a directory full of assets of a particular type (i.e., "assets/subdir") and I want to load all of the files in this directory, one at a time. I have code like this: AssetManager assetMgr = getAssets(); String[] assetsI...

Eclipse Classic Version Differences?

I'm working on an Android project now where everyone (about 12 people) are using the Eclipse Galileo IDE 3.5.2. That decision was made last year when that version was relatively current. But we're at a good milestone where, if we wanted to make any changes, this would be a good time to do it, although we're not having any problems with...

How to debug memory leak where exception instances in heap dump have no inbound references?

I've been trying to diagnose a memory leak in an Android application I'm writing. I got a heap dump loaded into Eclipse, but the results I'm seeing are very curious. There are some 20,000 instances of an exception (specifically, LDAPException from the UnboundID LDAP library) in the heap with no inbound references. That is, they show u...

Automatic Code Generation for Strings.xml from Eclipse

I find it a waste of time that every time I need to enter a string that I have to go edit the strings.xml file manually. What I'd like to be able to do ideally is have Eclipse pop up a dialog box that lets me specify the name of the resource and the value for it. Then Eclipse would generate the code in strings.xml and paste the correct...

Unable to get the correct screen size using Services for Android.

Hi, So i am trying to get the screen size of the Moto Droid on my application. on my Create, i am using the Service windowManager to get the default display. Display display = getWindowManager().getDefaultDisplay(); int width = display.getWidth(); int height = display.getHeight(); When i set it i get width of 320 and height ...

Android: Strange Out of Memory Exception

Hello, i have a problem with a strange out of memory exception that only occurs on some devices (mostly HTC Desire). It happens there every time a user starts a certain activity (no matter how - there are two paths to that activity) and i'm really puzzled as to why (i checked for leaks and couldn't find any)... The error is either thr...

How to create a dynamic context menu in android?

@Override public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); menu.setHeaderTitle("Selection Options"); menu.add(0, v.getId(), 0, "Remove"); } I want my menu to say "Remove AAPL" I would get the string AAPL from ...

change application's starting activity - android

I have created the meat and guts of my application but I want to add a different activity that will be the starting point (sort of a log-in screen). Couple questions: 1) I have a fairly decent handle on how to switch between activities (based on this article: http://www.linux-mag.com/id/7498) but I'm not sure how to go about creating a ...

Android: Sliding button container widget

I am running out of room on my app for buttons, so I want to stick them into some sort of sliding container, like the one at the top of the Astro File Manager app. How do I go about doing this? I've Googled this and can't find anything. ...

Where does Android Account Manager store account specific preferences?

Hi, I've been successful in creating various account authenticators / services each with their own preference.xml. These preferences are persistent but I do not know where on the phone they are stored. I've scoured the phone using adb but I can't seem to find a *.db or "shared_prefs" files that corresponds to the preferences for my pa...

RelativeLayout in dialog has extra space

I am trying to make an AlertDialog that scales in size to the content. The textual content can be larger than the dialog, so it has to be able to scroll. If I use a RelativeLayout everything renders properly no matter how much info there is, but when there is not enough text to fill up the TextView it leaves a lot of extra space. This is...

Android: Is it safe to create a static method to return the application instance?

It annoys me when I need to pass the context reference around all over my code. So I am thinking to create a static method to return a reference to the application instance. I am not sure if it is safe to assume there is only one instance of the Application in one application. Apparently, the Application class in Android SDK doesn't prov...

[android] access to contact data

Alas I have about 500 contacts in my phone book and for some reason after synch'ing them with thunderbird the display name is random last, first...first last. So I thought I would put a quick widget together to just re-do al my display names to last, first. The code I use is below, however I am not getting last / first values. The key...

android button fine text alignment

I'm trying to create standard button in android with a background and some text in front but some fairly specific alignment. I want the text to be centered vertically and on the left with 20dp of padding. The alignment works but the padding doesn't. I know I could probably get the desired effect by putting a few spaces in the text but th...

Android: Add app to firmware, use WRITE_SECURE_SETTINGS

Hi, I'm trying to write an app that can turn my mobile data connection on and off. Already got the source and built my own sdk, where I removed the @hide statements so I can use the relevant function cm = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); cm.setMobileDataEnabled(true); Also found out which permissions I nee...

Any good free website template or theme for wordpress or joomla to demo my phone apps?

I want to build a site to introduce my phone apps and guide users to the app store. is there any good theme or template for me to get start? I need to put all my apps together and have separate page for single one. ...

The project cannot be built until the build path errors are resolved.

while compiling android project in eclipse 3.4.2 , am getting The project cannot be built until the build path errors are resolved. i got a temporary solution from the blog http://www.scottdstrader.com/blog/ether_archives/000921.html The resolution was to force a resave of the selected projects (and their .classpath files): Open th...

Does froyo support AKASATANA and Yomigana based contact sorting?

Can anyone tell me about the Japanese phonebook sorting status in Android contacts? Does froyo support AKASATANA and Yomigana? ...

Is there any efficient way to make Android database query faster ?

In my android app i need to get 50,000 database entry(text) and compare them with a value when the activity started(in onCreate() ).I am doing this with the simplest way : i get the whole table from db to a cursor.However this way is too laggy.Are there any other way to do it more effective ? Edit :The app is "scrabble solver" that is w...