android

problem in passing data in android Activities?

dear friends, can any one guide me what mistake am i doing in this code??? it not seems to be working.. i have two activies public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent intent = new Intent(DataPassing.this, DataPassing2.class); Bun...

Android: ListView.getScrollY() - does it work?

I am using it, but it always returns 0, even though I have scrolled till the end of the list. ...

Android: Communication Activity / Service

Hi, I have some questions concerning the communication between an Activity and a Service. I'd like to write a speedmeter application, where the UI is constantly updated with new data derived from the GPS sensor. So far, I have an LocationListener running in a service. What is the best practice in Android: 1) Access the service from an...

onTextContextMenuItem is not called on custom menu items

Hi I'm trying to add some custom menu items to some EditText-instances. They appear on in the menu, but when I click the buttons the onTextContentMenuItem-method is not called. The EditText-instances are in a ListView if that matters. Any advice on the matter? Relevant code: class DocumentFragment extends EditText { public Docume...

Android private fields naming guidelines are ok?

Here http://source.android.com/submit-patches/code-style-guide#shortmethods it is stated that : "Field Names * Non-public, non-static field names start with m. * Static field names start with s. * Other fields start with a lower case letter. * Public static final fields (constants) are ALL_CAPS_WITH_UNDERSCORES. " also s...

Best phone for doing Android SW development

Hi All, I want to get into trying my hand at Android software development. What is the developer phone in terms of ease of development, debugging features etc. that's out there? It should also be a good phone too, as I'd want to use it as my primary phone. Thanks, Fred ...

Android - how to do background threading properly?

Hi all, Was wondering if anyone could help me on background threading on Android. I have a piece of code that records from the mic of the device and then plays back what it records through the ear piece(on 1.5). I am trying to run it in a thread but have been unsuccessful in getting it to run as a background thread. Currently it run...

How to know my Android application has been upgraded in order to reset an alarm ?

Hi all, I noticed that an alarm is disabled when the application which sets this alarm has been upgraded. Is that true ? Until now, I used the SharedPreferences with a FIRST_RUN key in order to know if it's the first run of my application. If I don't find this key, I enable the alarm and set FIRST_RUN to false, else I do nothing. But ...

Can I load an app built with Android source onto other devices?

This seems like the answer would be no, but does anyone know if it is possible to build a custom app into a custom-built version of Android and then load that apk file onto a different device? Obviously, if you make changes to the OS and then rely on them in your app, you can't, but assuming you use the source as-is (or the appropriate ...

Custom Android Screensaver (or sleep screen)

Hi! I need to build a custom android screen saver so anoboy could explain me how to create an activity that will be launched instead of the default screensaver which show only basic informations as Network, DateTime and alarms... Tanks for ur help! ...

Add margin between a radiobutton its label in Android?

Is it possible to add a little bit of space between a RadioButton and the label while still using Android's built-in components? By default the text looks a little scrunched. <RadioButton android:id="@+id/rb1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="My Text"/> I've tried a cou...

Android and Dependency Injection

I've been looking around, in vain, for some information on using a dependency injection container in Android development. Specifically, how to override the creation of an Activity in a way that will also work when coming back from being killed (for whatever reason). Has anyone got any experience in this area? ...

Adding a project reference to an android project

I am a C# developer and getting started with Android. I am attempting to duplicate a couple applications I already have in VS. The project is made of 2 executables and 1 common assembly. The 2 executables contain the application specific logic while the common contains centralized forms and logic (such as login form). I am using Ecli...

Manual Layout with buttons that don't show up.

Because of the dynamic nature of our program, I have chosen to manually layout some of the screens/activities. I have a simple one here that has a title and 2 buttons, but the buttons never show on the screen. Here is the code called from OnCreate that lays the screen out. public void buildScreen() { myLayout = new LinearLayou...

Do root views of an Activity in Android have any prior knowledge of the child views that will be loaded into them?

Is there any way to query a root view of an activity for all of its child views even before the root view or its children have been inflated? I guess what I'm looking for is whether a view knows ahead of time what children it will have before it gets inflated, and can I get that list in some way. Bizarre I realize, but I think it will ...

App crashes when calling Spinner value in calculation?

import android.app.Activity; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.Spinner; import android.widget.SpinnerAdapter; import android.widget.Text...

How to load AnimationDrawable from xml file

Heya guys! I have some custom class BitmapStorage, not attached to any View or whatever - an utility one. And I have born_animation.xml file which contains <animation-list> with animation frames: <animation-list oneshot="true" > <item drawable="@drawable/frame01" /> <item drawable="@drawable/frame02" /> </animation-list> I ...

New soft-keyboard

I have one question: How can I select what soft-keyboard an edittext will load? Thanks ...

Pass event to parent view?

I have a layout which contains five TextView. When user clicks any of the five TextView, it will do the same thing: open another activity. So, the OnClickerListener behavior to the five TextView is the same. Is it possible that I only add OnClickListerner to one view, e.g. to layout, so I don't have to add OnClickListerner to each of the...

Android: textView doesn't show cursor

I have a textView which is configured as an EditText. But the problem is that the cursor doesn't appear when i'm pressing keys (text is written correctly). Thanks ...