android

Android ImageView with drawable not always rendering

I have an ImageView object that I'm setting the android:src="@drawable/some_xml_file" instead of a standard png and it seems to not always render the drawable, as you can see in the first row here (it also happens intermittently in other rows as well): I've tried setting the src & the background property but they both have the same effe...

Timeout of broadcast when configuring AppWidget

In my application I have recenlty added a home screen widget. Everything works fine except when trying to add a widget for the first time. Instead of opening the config Activity an ANR appears. I'm guessing that since it works just fine after the first crash, the crash is probably caused by some undefined value. Or perhaps I have not u...

Android: change button background programmatically

I have this resource file for colors <resources> <color name="CLR_BLUE">#00f</color> <color name="CLR_RED">#f00</color> <color name="CLR_GREEN">#0f0</color> <color name="CLR_YELLOW">#ff0</color> <color name="CLR_BLUE_DARK">#00a</color> <color name="CLR_RED_DARK">#a00</color> <color name="CLR_GREEN_DARK">#0a0...

Android orientation change calls onCreate

I've made a search screen that has one tab for keywords, filters, and a search button, and three optional tabs for the different types of results (each containing a ListView with an ArrayAdapter). When starting the activity, the developer can optionally pass in the results as an extra Parcelable[] if the search has already been performe...

Posting on Twitter from Android

Hi, I am trying to post on Twitter from Android; first I considered http://code.google.com/p/oauth-signpost/wiki/TwitterAndSignpost but it asks the user to go on site and authorize the application, then to manually input the PIN in order to start posting. Next, starting with http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates...

TranslationAnimation in Android code

Hey, I was able to get the animation to work on the emulator -- however my problem is that it animates for a second, but then then goes back to its original posistion right after it finishes animating. How can I stop this for happening. This is how I animate my objects: private void doAnimations() { logo.setVisibility(View.INV...

Android multiple stroke box in drawable xml

I'm trying to achieve what amounts to effectively 2 strokes on a rectangle in a <shape> element in an android drawable xml. A dark green outer line and a light green inner line, with a gradient fill in the center of it all. My code currently looks like this: <layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt; ...

Android: how to add custom soft keyboard when form field is selected in WebView

I am using WebView to present UI. Is there any way that I can trigger custom soft keyboard when input text form field is selected? ...

How do I manipulate the Android activity stack?

Here's my two scenarios. 1 - User opens app for the first time ever from android home screen User is presented with "first time" screen (backed by first time activity, lets call it A) User hits back button user is returned to android home screen 2 - User opens app for second time User is presented with the main list screen of the app...

How to close and re-open Sqlite database?

In my app, I'm supporting the backup and restoration of the Sqlite db file. I need to close and re-open my database connection after the restore. How can I do this? ...

Getting started programming in dynamic languages in Android ((J)Ruby, Clojure...)

I've been looking around, and I can't seem to find any definitive answer or headway that seems "up to date". I've seen some interesting projects like Duby, and am looking into it a bit. I've seen Jruby unsuccessfully used to compile ruby into .dex. I've also been looking, independently, into Clojure and have realized that they might a...

Android:Is it possible to communicate with input method without a normal textview like edittext?

If I popup input method with togglesoftinput,my view's onCreateInputConnection was not called, and i can not communicate with input method. And then i try to attach the input method to my view: public boolean showSoftInput(View view, int flags,ResultReceiver resultReceiver) { checkFocus(); synchronized (mH) { if (mServedVie...

ClassCastException: android.app.Application

The class which cause error is given below package com.extrasmart; import android.app.Activity; import android.os.Bundle; import android.view.View; //import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.ImageV...

making an unbound listview i.e. set alarm screen in the alarm clock app

Well like the title says if you go to the Alarm clock App on droid i am trying to recreate the screen that comes up when you select an alarm. Essentially the "other" screen in the app. I am new to this but have spent the past day searching for this but im not to sure i know the correct terminology to find what im looking for. I am maki...

using Android SDK 2.2 with Rhomobile

I have installed: rhodes 2.0.0 beta 11, ruby 1.8, gem 1.3.7, and OpenSUSE 11.2. The only way i can get the app to compile is by using Android SDK 1.5. when I delete 1.5 and install 2.2 it says: No required platform (API level 3) found, can't proceed. any ideas? I would rather use an updated version of the SDK. ...

Get "No Service" on Android Emulator

Android newbie. I am writing up a simple Google Maps application but when I start up my Android Emulator, it displays the "No Service" message, and I am unable to see the actual map. A couple of days ago everything was working fine, and I was able to connect. Didn't really make a change that could affect this. Any idea about what might...

Are there any tutorials on how to create jpeg images or convert images into jpeg on Android?

1.myJpegFile = new File("images/jpegImage.jpg"); 2.output = new BufferedOutputStream(new FileOutputStream(myJpegFile)); 3.encoder = JPEGCodec.createJPEGEncoder(output); 4.encoder.encode(myJpegImage); Please could you give me the equivalent code for line no. 3 and 4 in Android? ...

confused with BroadcastReceiver

i have the following pgm which responds with a Toast with an incoming msg and also speaks out the received msg, however there seems to be no speech synthesis in background but i still can see the Toast though, so should i start a service from the onReceive method (don't know if that's possible) here and then in the startService method ,...

Audio programming, Sound Processing and DSP

I was playing with a karaoke application on iPhone and came up with following questions: The application allowed its users to control the volume of the artist; even mute it. How is this possible? Does adjusting artist sound/setting equalizer etc. mean performing some transformation of required frequencies? What sort of mathematics is r...

Android gallery nextfocus not working

I am using gallery as below <Gallery android:nextFocusUp="@+id/zoom_out" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/icon_gallery_plate" android:layout_width="fill_parent" android:layout_height="wrap_content" android:spacing="10dip" android:background="@drawable/browse_slider_bar" a...