android

Simplest way to debug an android bluetooth application

I am trying to test and build a sample android application that can simply connect to a BT server to send and receive a few packets. Since the emulator has no support what is the next best thing to test BT communication? Can I just run a code that acts as a server on my laptop and dumps BT connection onto a console? Do I have to write th...

inflate vs findViewById

Hi all, Suppose I have a simple layout xml like the following: button.xml: <Button xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/button01" android:layout_width="wrap_content" android:layout_height="wrap_content" /> Are there any differences in the following calls? and which one should i ...

SharedPreferences.onSharedPreferenceChangeListener not being called consistently

I'm registering a preference change listener like this (in the onCreate() of my main activity): SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); prefs.registerOnSharedPreferenceChangeListener( new SharedPreferences.OnSharedPreferenceChangeListener() { public void onSharedPreferenceChanged(...

upload apk on android market getting error

Hi, I am trying to upload my .apk for the 1st time on market. But it gives error:- The server could not process your apk. Try again. Please help. Thanks. ...

Characters problem in Bit.ly

Hello, When I try to shorten a link with "#,&" character I get an exception. Is there a way to handle these character properly? This is a sample code that works: String shortUrl = bitly.getShortUrl("http://z"); //Works If I add for example '&' or '%25' to the string it will throw an exception: String shortUrl = bitly.getShortUrl("h...

Android Camera in Portrait on SurfaceView

Hello, I tried several things to try to get the camera preview to show up in portrait on a SurfaceView. Nothing worked. I am testing on a Droid that has 2.0.1. I tried: 1) forcing the layout to be portrait by: this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); 2) using Camera.Parameters parameters = camera.get...

android saveinstance saving vector datatypes

hi friends, I am making an application which is currently working perfectly but with only 1 problem... As we all know that the activity is destroyed and recreated when user changes the orientation of the phone... my activity needs to save a vector full of objects wen the activity is recreated... i checked the OnSaveInstance() method and ...

android: How to play YouTube video on emulator

Could someone help me in 1. is this possible to play video from YouTube on emulator using YouTube video link (like:http://www.youtube.com/watch?v=T1Wgp3mLa_E) ? If not, then why? 2.If yes then how ? I tried to play YouTube video using VideoView but got "Command PLAYER_INIT completed with an error or info PVMFErrCorrupt" message through...

What's the best way to log an on going widget in handset?

I have a widget which mainly used to display date and month. However, after a few day the widget stop updating itself and must be replace in order for it to work again. Since I can't test its behavior in the emulator, I'd like to know if there's a best way to keep my application log separately and have it available to take a look later? ...

TabWidget white foreground color?

I don't know what I did but for a period of time my TabWidget had white colored tabs which looked really nice. I never set a theme or background/foreground color in my project at all. The next time I compiled it it reverted back to the gray tabs. My application is using the default dark theme. Even if I set the application theme to light...

Android: database reading problem throws exception

Hi, i am having this problem with the android database. I adopted the DBAdapter file the NotepadAdv3 example from the google android page. DBAdapter.java public class DBAdapter { private static final String TAG = "DBAdapter"; private static final String DATABASE_NAME = "PasswordDb"; private static final String DATABASE_TABLE = "myuse...

Store in sharedPreferences

Hi, I have some things in my app that I need to store, in order to have it available the next time I open the application. I wonder if I could save them using the sharedPreferences mechanism even if I don't have any "view" associated with them ! .If this is possible please let me know, if not, what would you suggest instead ? ...

slide downeffect the View problem android

How can i have slide downeffect? The effect will be similar with search function on google map of android. When we click the search option from option menu, the softkeyboard will slide up and the search bar will slide down automatically. Anyone provide any hint or any tutorial about this, or proper keyword i can search ...

setwidth of a dynamic textview

Actually my code is `LinearLayout ll = new LinearLayout(this); ll.setId(i); ll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT)); ll.setPadding(0, 0, 0, 5); //ll.setClickable(false); TextView tv = new TextView(this); ...

How to make a row of ListView like this?

Hello, Sorry, this's my first time to ask a question here. So, I don't have the permission to upload the image to describe. Never Mind. What I would like to make is a row of ListView like this. The block on the left is an icon. Much appreciated if you could feedback the correct XML tags. Thanks. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...

BroadcastReceiver not receiving an alarm's broadcast

I have a code that sets a new repeating alarm (on production I'll use a inexactRepeating), but the BroadCastReceiver I've registered for handling it is not being called. Here is the code where I set the alarm: newAlarmPeriod = 5000; // For debugging Intent alarmIntent = new Intent(this, GroupsCheckAlarmReceiver.class); PendingIntent s...

android send html mail using intent

hi friends... i have generated an html code(complete with tags) as a String... now i want to send this html code as a html to mail... my code is as below.. Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/html"); intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"[email protected]"}); intent.putExtra(Intent.EXTRA_SUBJE...

How can we call an activity through service in android???

I want to know if it is possible to call an activity through background service in android like : import android.app.Service; import android.content.Intent; import android.content.SharedPreferences; import android.media.MediaPlayer; import android.os.Handler; import android.os.IBinder; import android.os.Message; public class backgrou...

Finish sub activities programmatically

Hi, I have an activity that launches another activity with startActivityForResult method. I would like to terminate the called one programmatically but I don't know how to do this since in onActivityResult() method I have no information about the called activity and I cannot call finish() on it. How can I achieve this? Thanks ...

How can i integrate Facebook api in any android application?

What's the procedure to run Facebook Connect application in android? Here is the link:http://code.google.com/p/fbconnect-android/ Please explain step by step. I'm having errors in my manifest file: <activity android:name="com.codecarpet.fbconnect.FBLoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>...