android

Importing Class from External Jar, Android

Hi, I created a new library and added the jars from web harvester to do a bit of web scraping in my android project. in my main activity I import classes that I need. but starting the project on my phone I get a 08-23 08:28:09.763: ERROR/dalvikvm(2123): Could not find class 'org.webharvest.definition.ScraperConfiguration', referenced ...

Android: Programatically iterate through Resource ids

I want to be able to iterate through all of the fields in the generated R file. Something like: for(int id : R.id.getAllFields()){ //Do something with id, like create a view for each image } I've tried reflection, but I can't seem to load a specific inner class that's contained inside the R class. So, for example, this wouldn't work ...

Optimization of Android Applications

Hello, I want to do optimization of my android application. Can anyone please tell what are different ways to optimize code and performance in android? I gone through one tool i.e. Zipalign: an Easy Optimization. Any other tools avaliable? Thank you. ...

Display byte[] to ImageView in Android

Is it possible to do this? I'm reading an XML file that has the Base64 string of an image. I'm planning to use Base64.decode to have the byte array of the image string. I'm stuck though on how to use it in an ImageView. Do i have to create a 'drawable' class first then set it to ImageView's src property? Thanks! ...

AlertDialog problem?

Hi, I have an android application having an AlertDialog with OK and Cancel buttons. When the dialog shows without pressing the OK or Cancel button, just press Home button of device. The Home screen will show. Now open another application suppose Camera. Take some picture or Video. Now get out from the Camera application. Now open my andr...

how to keep track of which applications used most in adroid phone

HI , I need to keep track of installed applications which are used most and least in android device... can anyone help me how to do this programmatically in android...?? My question some thing like , I need to capture the event/Intent which will/may happen when the apllication is launched every time...(like BOOT_COMPLETED will be br...

Best practice: Design pattern for 2D HUD screen navigation

Hi, I fight with me for some days about asking this question. Its pretty plain and simple: If you have an application with a GUI totally working on 2D drawing, what should be the best practice to handle what to draw and where to touch?! Some example for better understanding: I have a game with a map. On this map I can build houses an...

Server Connection in Android Application

How can i connect to the server in Android . Give me Some code it will really helpful for me . ...

How and where to create aidl file in eclipse using android

I am trying to using remote service in android.can anybody tell how and where to create aidl file in eclipse in android? Thanks ...

Basic Prblems Android, need to know where to find Information, need Advice

Hey folks, I really like your site and I think this is the place where I find answers to my questions! I am planning an app, which shall do a couple of things but since I'm kind of lost in all the information conserning Android I really need some advice what I have to look out for and which of my goals might turn out tricky. I want to do...

How to expanding ListView as list item populate?

Basically I am trying to recreate the default contact screen when you click on "+" button another row of Phone number added to the list. Right now I have an ImageView as the "+" button and a ListView to contain the list of phone numbers. The problem is that the ListView doesn't expand when I add more item into the list. I could build t...

Android screen video recoring

Hey, does anyone know how I should go about recording a video screen capture of an OpenGL application? So far my plan of attack is to take individual screenshots then run it through a video encoder. Does anyone here know of any sample code I can look at or has any suggestions of things I can look at? EDIT: I'm looking for the OpenGL a...

Problem in edittext content

Hi friends, I'm creating a dynamic tabs. In each newly created tabs , i'm opening a file. I want to get the filename or file descriptor of the selected tab to do file operations on that corresponding file. For example If i want to delete the file, the file and the corresponding tab should be closed. Please give suggestions........... ...

Android + toString

Hi Everybody! Can anybody please tell what toString in Android is for and how it can be used? As example would be highly appreciated. Thanks in Advance john ...

getCurrentActivity() and ActivityGroup

I am using an ActivityGroup and when I finish a top-level Activity (e.g. with destroyActivity method) and display one from history, the getCurrentActivity method returns the last Activity - the finished one. I need to access currently displayed activity, which is actually shown. ...

how to add includes in native c code that will be compiled by android ndk

Hi.. can someone give me a guide on how I can add headers to my native c file. So here's the details. I was able to setup my android project to call a native function from a .so file. And actually I need to add box2d to my project, but I when I include the header files, it won't make. So basically my problem is how do I tell the make f...

Android bitmap allocation weirdness

I'm having some trouble understanding why this code public class BitmapAllocTest extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); byte[] b = new byte[20 * 1000 * 1000]; b = null;...

Refreshing an Activity

I created an Activity which allows navigating between pages with a couple of Buttons (Previous and Next). When the user clicks one of the buttons, the Activity (same) needs to be "refreshed". In order to do this, I set up the buttons to make a call to onCreate(this); after they set up the other stuff that the activity uses for the pa...

How to find the content type of the application in android

hi, How will i be able to find out the content type of an application, I have an application i need to be able to know what exactly that application contains, like if it has video or audio or images or just text. Is there anyway i can find this? thanks in advance. ...

Android: gradient drawable as relative layout background

Every time I try to create a gradient drawable as the background my application force closes. Is there anything more I need to do than create the xml files in drawable-hdpi, drawable-mdpi, and drawable-ldpi. and then use android:background attribute to point to them? Are there any examples of this? ...