android

Android AsyncTask Pub Sub to Context?

An activity I have starts an AsyncTask. What is the best way of getting the Activity notified that the AsyncTask is done. I can pass the Activity as a Context in, but I don't want the AsyncTask to know about the type of the Activity. In .NET land I would subscribe to an event on the "AsyncTask". I didn't find a way to do that in Android...

How can I dismiss the dialog?

AlertDialog.Builder fpdialog = new AlertDialog.Builder(context); ListView fpathlist = new ListView(context); ArrayAdapter<String> adapter = new ArrayAdapter<String>(context,android.R.layout.simple_expandable_list_item_1, fpathdata()); OnItemClickListener listener = new OnIte...

Able to insert passed image value into sdcard?

As asked, is it possible? Here's part of my code. I don't know how to change it, please help me! Bundle b = New_Entry.this.getIntent().getExtras(); String s1 = b.getString("image"); try { new File("/sdcard/myImages").mkdirs(); InputStream in = getResources().openRawResource(imageSID[position]); File f2 = new File("/sdcard/myima...

How can I know which childview is shown on the current Device screen in a scrollview?

How can I know which childview is shown on the current device screen, in a scrollview? I want to make an infinite Ruler App, so I need to dynamically add and remove view when the view is flipping, but how and where can I find out which childview is shown on the current device screen, so I can add or remove the correct view when I get th...

how to resume an interrupted download

I'm trying to download a large file from my Yahoo! web site server which apparently is setup (not by me) to disconnect downloads if they are not completed within 100 seconds. The file is small enough to usually successfully transfer. On the occasions when the data rate is slow and the download gets disconnected, is there a way to resum...

Android ListView Filtering Without Repeatedly Instantiating ArrayAdapters

I have a ListView filled with twitter tweets. I made a custom Tweet class so I could store a special type number. So, I have the Tweet class and custom ArrayAdapter: class Tweet { private int typeNumber; // My unique type number which does not come from Twitter private String message; // ... other tweet data } class TweetsA...

Cropping a wallpaper in order to have a crisp image

Hi , I am currently working on a wallpaper application and I was wondering if there is a way to make the bitmap look less blurry and more crisp once it is set as a wallpaper. Does it just require cropping the picture and resizing it to fit perfectly the size of the screen or there is some other way of solving this issue? ps: i read tha...

Android - Frame Animation: Which IDs go where?

Here is the example code: ImageView carrotsmile =(ImageView) findViewById(R.id.carrotsmile); rocketImage.setBackgroundResource(R.drawable.animation); main = (AnimationDrawable) carrotsmile.getBackground();} } What would I replace rocketAnimation, carrotsmile, rocketimage, and main with? Like my XML files or something in the xml file...

Can I use my current SharedPreferences tag to store the values from a PreferenceActivity?

Currently, I'm using the following code across all of my activities in my app to store application level variables and carry values between activities.. prefs = this.getSharedPreferences("MyPrefs", Context.MODE_PRIVATE); I didn't have a PreferenceActivity prior to this, but now I do and I am looking to store a few user prefs from this...

How can I make a fixed floating menu for Android?

I am trying to make a floating menu to be at the bottom of the page. I have it working with Chrome but for some reason on Android it doesnt scroll right. Ive seen a ton of people have this problem online and there was an doctyper-iphone solution but I tried it on my droid and it crapped out...it almost worked though. http://208.229.14...

Is the binary representation of native types guaranteed the same on all targets?

I"m planning to store my data in a binary format as a resource, read it into an int buffer and basically pass it straight down to a native C++ function, which might cast it to a struct/class and work with it. No pointers, obviously, just ints and floats. The question is - what kind of fixing up do I need to do? I suppose that I need to ...

Parsing big XML files using SAX parser (skip some lines/tags)

I am currently developing an app that retrieves some data from the internet . For this purpose i use SAX ,i used it before for parsing simple xml files like google weather api .However the websites that i am interested in take parsing to the next level ,the page is huge and looks messy. I only need to retrieve some specific lines ,the re...

android loading webview in dialog

i want to open twitter auth in my webview rather then opening in browser, any good tutorial how to play with webview in dialog and loading it inside dialog? ...

Require Examples for Android development

Hi all, I am new to Android development. I have studied the basics/architecture and the components of android. But now i require few working examples/applications of Android to work on. So please someone can provide me links for few basic examples of Android ? Thanks... Best Regards ...

android -Menu function

hi, I am new to android.I have tested the android.view.menu by the following code..It works. import android.app.Activity; import android.os.Bundle; import android.view.Menu; public class menu extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { ...

What can be the Activity, I am using

Hi All I am new to Android Few words before I ask a question: We developing a selolar solutions based on Android os. I use internal libraries that are not a part of standard sdk A question: My class extends from InstrumentationTestCase class I perform the next operation: mPhone = PhoneFactory.getDefaultPhone(); I use mPhone for t...

Send Audio data with SMS in android

Hello, I am trying to send an audio file converted to a byte array with SMS using SMSManager.sendDataMessage. But, I am unable to send it to other phone. Can any suggest how can I do it? ...

How to receive call programmatically without user notification in android ??

I want to implement conference call. For this i tried listening phone states and as call is received from some number it makes notification to the user we want to involved in conference. Then the person receives notification make the call but i was unable to accept this call without user notification. Please suggest some method to implem...

problem with finish() :Android

In an if statement, I have a finish() because I don't want the control to go any further. But, the app exits, but as I see from the logcat, the control goes beyond finish(). Maybe that's also the reason why a toast supposed to be displayed and some other GUI actions before finish() are not taking place? Please advice. ...

Upgrade Android Application outside Market

Hey, We have a set of 3-5 android applications that we have developed for an enterprise to integrate with our back-end. How do we create an installer system that upgrades applications automatically. We were thinking of getting version numbers and querying the backend to get current versions and downloading them. How do I get the versio...