android

How to use android styles in styles.xml in programmatic design of views.

Is there any way of applying styles defined in styles.xml to views created programatically? I need to display textviews on the screen, and align them to different positions on the screen. I am able to apply color and text size using setTextAppearance() method, but I'm not able to apply other attributes like alignment and padding....

Getting result of executed shell command fails/hangs

I try to execute shell commands, this does work as it should. Even the result comes back (as is see on LogCat). The problem ist the last line of the result. Every time a readLine() on the last line occurs (which shouldn't occur, temp should be null), the app hangs forever and doesn't come back from the readLine call. Maybe you find the ...

Sub activity confusion. Multiple programs being compiled.

I'm having great problems with getting subactivities to work properly. I've read several tutorials on the subject, none of which work, or seem to leave out important info on how to setup the call to the sub activity. All I want to do is launch a sub-activity. The calling activity doesn't need to get any info back from the called activit...

Call or start external Application Android

HI to every one... I'm working on a Application and I would like to start or call an external application from it by pressing for example a button...on my application. the application I would like to call is an open source application. I've read on the official android website it is possible to do it but haven't found any suggestion o...

android webview link .... click orange rectangle

When I create HTML code by myself , and use webview.loadData to display the HTML , I click <a> on the webview , why there was no orange rectangle appeared? ...

why should a variable in a static method be declared as final in java

Hi, I am having a static method .In the method when I decalare a variable , it was showing an error in eclipse saying that the variable should be decalared as final. Can I know the reason for this , y should a variable in a static method be declared as final? I am writng an Android application where I should pass as an argument current ...

how to see file in sdcard and store file in camerimage ?

Hi Friends, String PATH = Environment.getExternalStorageDirectory()+"/file2.png"; URL url = new URL("http://theblacksheeponline.com/assets/images/galleries95/big_62596549_photo.JPG"); //you can write here any link File file = new File(PATH); URLConnection ucon = url.openConnection(); int len=ucon.getContentLength(); InputStream is = ...

Custom fonts in android

Hello all, I am trying to use custom fonts in a textview: tv=(TextView)findViewById(res); Typeface font = Typeface.createFromAsset(this.getAssets(), "fonts/font.ttf"); tv.setTypeface(font); But when I run I get the following error: W/System.err( 542): java.lang.RuntimeException: native typeface cannot be made Whats the issue? ...

extract and show album art of mp3 file in android

Hi, I'm trying to implement a small mp3 player on android. So far so good, but I cant implement the following feature: When playback of the file starts, check the file, get the artwork and display it. (the artwork is embedded) I've seen several libraries which claim to be capable of doing so, but I did not manage to implement it. (jaud...

about android project

I have elseif statement in which i declare flag is false and i declare Resources r = getResources(); String refrigerant; String[] refrigerant1 = r.getStringArray(R.array.refrigerant); in my program want to set flag=true but my for loop is not executed and flag remains false pls give me solution. is there any problem in array declar...

Pass cookie to browser via Intent

Hello! I have saved a cookie in android. Now I want to pass it into my browser intent. Look at my current code: Intent browser = new Intent("android.intent.action.VIEW", Uri.parse("http://mypage.php/memberpagethatrequireacookie.php")); //putExtra cannot take these arguments -> browser.putExtra("org.apache.htt...

Android game development framework Rokon

I am a beginner in Android game development, while searching i found Rokon, a framework for android game development. It has very nice five tutorials for beginning, done that all now i need some more tutorials so that i can learn more, some more complicated tasks. Now where to find other resources to continue on Rokon, or if there exis...

android : Find UPnP devices from network

hi, I am making application in which i want to find the list of the UPnP devices that are connected to my network from my android application . Any idea how can i do this.. I am using the API of the cybergarage...here is the link of the repository... https://cgupnpjava.svn.sourceforge.net/svnroot/cgupnpjava/trunk/cyberlink/upnp-stack/...

Android SDK 2.0 supports A2DP and AVRCP or not

Hi, Can anyone let me know Android SDK 2.0 supports A2DP and AVRCP or not. Regards, John ...

How to make a non-alphabetical sectionindexer

In my search activity I am pulling data from 4 Cursors (each with a tag saying what it contains) placed in a MergeCursor. What I'd like to is create a section indexer which allows the user to move between these sections, instead of the usual alphabetical one. How should I go about doing this? Thanks ...

Why should a static method in java accept only final or non final variables within its method, but not static?

Why should a static method in java accept only final or non final variables within its method, but not static? For example I have the following method: public static void myfunc(int somethig) { int a=10; final int b=20; static int c=30; //gi...

Could not reset the android device to factory.

I am stuck into resetting an android device to factory. This happens when Unlock pattern is set. ICheckinService service = ICheckinService.Stub.asInterface(ServiceManager.getService("checkin")); This line of code returns 'null'. So a dialog showing an error message "No reset was performed because the System Clear service is not availa...

Restoring view after orientation change in android 1.6

Hi. Here's the flow. I have a button in a layout along with a form as view stub. On click of that button, view stub is inflated and brought to focus. When I change the orientation, the activity gets restarted and goes to main screen with button. Can someone please tell me how to handle orientation change ? I mean, I want the screen to be...

tabactivity cannot work,but my code not mistake

main.xml: <tabwidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <framelayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent" > <linearlayout android:orientation="vertical" android:layout_width="fill_pare...

How to switch the mobile network in program?

Peace upon you , I searched more but didn't get the answer. Currently I have 2 mobile networks for my mobile say they are A and B. Is there a way to automatically detect the mobile networks if there are A and B then choose A? Or just simplely choose A no matter whether there is B availible? I want to search for gsm networks operators av...