android

Crash when adding a button to a panel view

Hello, I have the following code that shows a panel. It displays a button on the panel but as soon as I assign a Click Handler to it the app crashes! It crashes on the line .setOnClickListener Button button = (Button)findViewById(R.id.buttonclick); button.setOnClickListener(new OnClickListener() { @Override ...

How to get information about android battery usage by application

How can i get battery usage by application in android. I need to know % of battery spent by application. It's possible using SDK? The information that i need, using an android device it's on "Settings>About phone>Battery use" Thanks ...

How-to init a ListPreference to one of it's values

I'm trying to set a defaultValue to a ListPreference item. Here is an sample of my preference.xml file: <ListPreference android:key="notification_delai" android:title="@string/settings_push_delai" android:entries="@array/settings_push_delai_human_value" android:entryValues="@array/settings_push_delai_phone_value" androi...

How to store the parsed Image in the SQLite Database in Android?

Hai Friends, I am parsing the website to store the contents in a url, in that some images are there, i want to store the images in database which are parsed from the site. i m really struggling on this, cany any one help me regarding on this ...

unable to connect with internet in android emulator behind proxy in windows

Hi, I am very new to android. I tried to connect to internet behind proxy in windows.But I cant. I tried with the "-http-proxy" in command line and in eclipse but both did not worked for me :( Please suggest me a right way to enable proxy in emulator Thanks in advance ...

Updating database from an EditText

Hi, I have a text field in SQLite database, which I want the user to be able to update. So I extract and display the text in an EditText view. The user edits it and presses "Update" button. At this point I want to update the text field in database with whatever user has in the EditText. Here's the problem, EditText returns the type Ed...

Play a sound on touch?

Hi, I was working on a simple bubblewrap app in order to learn the android framework, and was wondering how I could play the 'pop' sound clip every time the user touches a bubble. Thanks in advance ...

Is there a way to dynamically change the size of a widget?

Is there a way to dynamically change the size of a widget? Can an app have multiple widgets? Thanks! ...

Android: Change APN settings by code.

Hello all. As in my country (Belgium) a lot of operators settings are not included in default APN list, i would like to create an app that will fill all APN fields correctly with the user choice. I just read all the doc and Google a lot of questions but no answer... How should I do to create an APN profile? Thank a lot for any clue. ...

android layout help

Hello I would like to make a layout like the one displayed on the this link. just an image and 2 simple buttons on the button of the screen, I am trying using this code: <merge xmlns:android="http://schemas.android.com/apk/res/android"&gt; <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_wid...

Android: custom button shape

I'm trying to achieve a custom controller containing of various buttons in different shapes. I'm wondering how I can achieve this with Android. The result should look similar like this, where every color is a different button. I suppose I have to subclass View so please don't write that as an answer ;-) Please give some methodical ste...

NullPointException Don't Know Why?

Hello guys, please have a look at this code and see if you could help me out. viewItem is populating from a database and the method fillRemindersData(long rowId) is only called from the reminder class. I don't know why i am getting a nullPointerException when calling the viewitems.fillRemindersData()method. if i comment the line, the cod...

Anonymous SSL with Android?

Hi, I'm trying to setup a anonymous SSL connection, i.e. one that doesn't require certificates, from an android to a PC. The problem is that I can't find an appropriate cipher suite on the android. IIRC anonymous cipher suites have "anon" in their name, running socket.getEnabledCipherSuites() doesn't return any cipher suites with 'anon'...

How to check does image set in ImageView

How can i check does image set in ImageView or no, exists standard methods? ImageView imgV; imgV = (ImageView)findViewById(R.id.imageView); if(imgV != set) ///!!!!! imgV.setImageBitmap(mBitmap); else imgV.setImageBitmap(null); ...

With latest Android sdks, is there still a Google Apis build target for Android 1.5?

I'm configuring a new machine for Android development and moving my current project over. I did a fresh install of all the Android tools and SDKs, and under "build targets", the Google APIs' target supports Android 2.2. Of course I need 1.5 as the base build target. My project doesn't build when I select that because the Google Maps stu...

Android JNI, is there any way C++ code can directly read the app's sqlite database?

I'm working on an Android app with a Java component and a C++ component via JNI. The C++ component is used on other platforms. It would make my life considerably easier if the C++ component could query the existing SQLite database (via the SQLite C API), without having to shell calls out to the Java side. I know it's a long shot, has a...

android start Video recording upon starting an activity

android start Video recording upon starting an activity without using buttons ,ie when the activity starts video recording also should start without using any other component,its working with buttons,i tried putting video calling functions in onCreate,onStart() etc any idea any one ...

How to show empty view when ListView is empty?

Here is my layout. For some reason the empty view (TextView in this case) always appears, even when the List is not empty. I thought the ListView would automatically detect when to show the empty view. How can I hook up the empty view properly? <RelativeLayout android:id="@+id/LinearLayoutAR" android:layout_height="fill_pa...

Add a live background to an Android View (like the Twitter App)

In the official Twitter Android app, the opening activity (the dashboard) and the Tweets tab activity have a live background/wallpaper (clouds moving, etc). How do you accomplish that? Is it as simple as setting your view's background to a live wallpaper drawable? And then adding <uses-feature android:name="android.software.live_wallp...

Android: Possible for one App to provide Styles/Themes for another App?

Is it possible for AppA to provide styles/themes for AppB? For example, AppA would launch an Activity exposed by AppB, pass in the path to an exposed XML file, which the activity would set as its style? ...