android

Android-Broadcast Receiver and Intent Filter

Hi, I am new to android platform.please help me out how the Broadcast Receiver and Intent Filter behaves in android.please explain in simple line or with example.thanks in advance... ...

Why is Context used in this piece of code?

public class ImageAdapter extends BaseAdapter { private Context mContext; public ImageAdapter(Context c) { mContext = c; } Here in this code,what does this Context means and what is the purpose of using this? ...

Problems with glDrawTex_OES

I'm not sure I'm using glDrawTex_OES correctly. In fact, I'm sure I'm not because I'm getting a black rectangle on the screen rather than the intended texture. To get the silly points out of the way: Yes, the GL Extension string contains the OES_draw_texture token. Yes, the texture is loaded into memory/etc. correctly: it displays ju...

Use AsyncTask to add items to list view individually.

I am trying to add ListView items one by one. So if I have say -- 60 items -- the application would add the views to the list view one at a time -- thus showing the user that the application is loading more things. This is my code: try { JSONArray j = getTaggsJSON(); Log.v(TAG, String.valueOf(j.length())); a =...

android:how to check if application is running in background

I am newbie to android. I have client server based application. Server keeps on sending the update notifications to client after every single minute and at client side my app receive those updates and display it using Toast. But now my problem is whenever my client app goes into the background server keeps on sending the update notificat...

How to change default framebuffer for Android?

i'm porting android to an overo gumstix. thus it seems the the omapfb driver has some problems on that platform. it doesn't matter at all, because i want to use udlfb (a driver for usb displays) anyway. till today, i wasn't able to figure out how i can define udlfb as default framebuffer. tried make menuconfig and select udlfb there, bu...

need for onActivityResult() when result is already obtained by onListItemClick()

I have a main class which extends Activity which should spawn a ListActivity and obtain the selection made. So I have an onListItemClick() in the class which extends ListActivity which accepts the selection via getItemAtPosition. This ListActivity is started by startActivityForResult. Now, since I have already obtained the result in on...

Problem in using float on Android

I am going to develop a calculator on android platform, it is fine in calculating numbers less than 1000000, when I tried to add 1000000 with 0, the result is "1.0000E7"?! I try to change the type of result from float to double, but the problem is still here, I try to use long, result becomes normal, but it cannot calculate decimal place...

define two intent in An Activity

I need to start an Activity with two different Intent, can I define two Intents In an Activity node? An real example is: in my current application, I want to start an main Activity in another android application, how can I implement such requirement? can I add another Intent-Filter in the following Activity Node? ...

Android and XML Usage

Hai, I am developing a Puzzle in Android. The puzzle is something like finding a number. It contains 7 steps. Here I use 7 xml files Each file is meant for some operations The 7th file displays the output. There is a Try again button in the 7th file and when the user clicks on that button, it should call the 1st xml file and repeat the...

How to hide application icon from the Android Desktop?

I defined an application which is only used from my other application. So I would like to hide the icon of this application, so that the user can't see it on the desktop of his phone (or how do you call the thing where all apps are listed?). My manifest file looks the following way: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns...

Android GPS Callback off UI Thread

I'm having trouble getting the GPS's onLocationChanged to run on a different thread. I understand how to manage UI thread when I'm calling a function but with the GPS, I don't actively call the function. My intent is to have a light flash every time the GPS receives a reading. I have put this function in a Runnable. I passed this funct...

Port AWT 2DGraphics to android ?

I'm working on a little 2D game just for fun and was wondering if I could make it run on android as well. I'm using a java.awt.Canvas with a BufferStrategy and drawing sprites with the Graphics2D class methods. I'm new to android, just finished some of the tutorials on the android page and already noticed there's no AWT in android. My ...

[Android] Host is unresolved in LAN

Im getting a IOExeption 'Host is unresolved' on HttpPost. The Endpoint in this case a a computer on my LAN with a webservice. (http://pc259:8080/test/service.asmx). Im using WIFI to my LAN. Does Android know to to resolved computernames? StringEntity se = new StringEntity(xmlDataToSend); se.setContentType("text/xml"); HttpPost httppost ...

why is "this" keyword used within the setAdapter method in this snippet ?What does it refer?

GridView gridview = (GridView) findViewById(R.id.gridview); gridview.setAdapter(new ImageAdapter(this)); The typical use of this keyword is that it refers to the current object,but in this example what it refers? ...

Default ringtone on SD CARD: will not find audio

Hey guys, I've been trying to extend my phone profile app to be able to handle the phone's default ringtone. When setting my app to use the default ringtone with a system default one, it sets fine. When I try to set a default ringtone which is on /sdcard, the Uri goes in correctly, but when it comes to setting it, it only pulls out the...

What is the AdapterView<?> means in the OnitemClick() Method?What is the use of other parameters in it?

gridview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View v, int position, long id) { Toast.makeText(HelloGridView.this, "" + position, Toast.LENGTH_SHORT).show(); } }); ...

How to handle both Quick Search Box results and recent suggestions for search?

I'm trying to implement both recent suggestions and custom suggesions in global search in the same application. They both use the same path in the provider so it doesn't seem like it is possible to return different results for them. For example just recent searches for suggestions and real search results in the Quick Search Box. Any ide...

accessing fields across a package

How do I make fields accessible across a package? Currently, even if they are declared public i'm not able to access the fields from another class in the same package. ...

What is the applicationcontext in makeTest() Method, please explain with the following snippet

Toast.makeTest(HelloGridView.this,"Text to be displayed",Toast.LENGTH.SHORT).show(); What is the 'HelloGridView.this' refers? why it is called as appliactioncontext? ...