android

Implementing Android Action Bar

I am working on creating an Action Bar like the one from the new Android UI Patterns and I am running into a bit of trouble. I have a ViewSwitcher with two layouts in it. When the user taps the search button I animate between the two layouts. The problem is that the layouts are different sizes and I can't figure out how to make them t...

How does forceStopPackage work in Android 2.2 (Froyo)?

Thanks Google released 2.2 source code. In this code-InstalledAppDetails.java It shows how android 2.2 does the "force close" function. private void forceStopPackage(String pkgName) { ActivityManager am = (ActivityManager)getSystemService( Context.ACTIVITY_SERVICE); am.forceStopPackage(pkgName); checkForceStop...

Random character generator with a range of (A..Z, 0..9) and punctuation

I need to create a random character generator that return a single character. The character should range within the letters of the alphabet, numbers 0 through 9, and some characters like ,.?/-. Any example would be appreciated. ...

Creating a tabbed UI without using Layout

As per the android developer docs for creating tab UI you need to have a TabHost and TabWidget and the TabHost must be the root node for the layout. All perfect, I tried the example and everything's fine. Just while looking at the API Samples of tabs, I came across tabs1.java (http://developer.android.com/resources/samples/ApiDemos/src...

Android and RESTful services

In Virgil Dobjanschi talk during Google I/O he mentioned using Services for doing the fetching and then using a callback to notify the Activity when this was completed. He never went into specifics on how to implement this callback and I can't seem to find anything helpful on this topic anywhere. I think he said that you didn't need to ...

Transparent Background

How can i make the background 50% transparent? Let's say the background of an AbsoluteLayout so it's dark but you can still see through it? ...

View-tag dosen't work

I have some preoblems when it comes to designing a view, As you can see I have open my xml file with a view-tag, and it gives me error. why is that? if I change it to LinearLayout than it works. <View xmlns:android="http://schemas.android.com/apk/res/android" class="android.app.SearchDialog$SearchBar" android:id="@+id/search_bar" androi...

How do I make the Checkbox in Android CheckedTextView be left aligned instead of right aligned?

Hi, I am trying to use R.layout.simple_list_item_multiple_choice with ListView. CheckedTextView is used in simple_list_item_multiple_choice.xml, but how can I make the checkbox be left aligned instead of right aligned? ...

How to clear the Tabs in a TabHost of Android ?

Hello All I have been trying to reset the tabs in a Tabhost of android platform and every time i try to do i get some issue or other. Below is the code which i use if(reset) { tabHost.setCurrentTab(0); //tabHost.clearAllTabs(); tabHost.getTabWidget().removeAllViews(); } and i get the following exception e...

what case the managedQuery method return null if uri is provided?

I am doing some android application. I just wonder what will case the managedQuery method return a null value? if (getIntent().getData() == null) { getIntent().setData(Notepad.Notes.CONTENT_URI); } uri = getIntent().getData(); c = managedQuery(uri, PROJECTION, null, null, null);// return null value. ...

can a webpage on a mobile browser ask/get users location from the phone?

Is there any way that a webpage can make a request for the users location from the android / iphone device ? Since all I need is the users location, I am trying to figure out if there is anyway I can bypass developing a native app and use some nifty html5 call to just get the users location so all a user would need to do is visit my web...

What's the best book to learn programming on Android?

Possible Duplicate: Can anyone recommend a good Beginner Android programming book? When I was in college about 20 years ago I used to program a lot (Basic, Pascal, COBOL, Fortran). I dabbled a little bit in VisualBASIC about five years go, but it was really a hack. Now, I really have a burning desire to write some applications...

changing the default voice in android tts?

hi is there a way by which one can change the default voice (female) in the android tts? like if i want some other voice (male)? ...

How do I reference adk resource in a different Android project?

I am developing a study project using the mosembro (mobile semantic browser) project inside my Android project. I am using Eclipse and I created my project, downloaded / imported mosembro and included in my project's build path. So now my code needs to refer to a resource in the mosembro's project. I want to do something like this: S...

Android app remain logged into website, cookies? Session?

I'm looking to make an android app that is basically a custom view of a text based gaming website. I know how to do HttpPosting and such, so sending login information is relatively simple. But my question is, how would I go about then navigating the site? I've never really worked with sessions and cookies on the client side. Is a cookie ...

How to clear an Android App's permission to use the authentication credentials of your account?

I can clear data or uninstall the app, but it never again asks for permission. I'm having trouble tracking down a bug because I can only test the bug conditions once per phone. :( ...

a count down android timer back button vs home

I am writing a count down timer, using .postdelayed(), that speaks each second as the timer goes down to zero. I have trouble understanding the consequences of the user hitting the back or home button. The countdown continues when hitting either button. When home is pressed and you reclick the app, it goes back to the same count(this...

better Android XML Layout Editor than the one in Eclipse

Hello, I'm searching for a better Android XML layout editor than the one in eclipse. Preferable placing items by drag and drop to the correct X/Y position. With the current editor I have to try out figures to place it at the exact position ... is there an easier way ? (RelativeLayout is used) ...

Android ==> Which layout should i use?

I want o be able to add items to my layout, and set the exact position of these items. x,y,width,height. I am currently using AbsoluteLaout which is deprecated, is there any other layout that allows me to locate objects on the screen, by specifying their x,y? I also need to be able to read the x,y of all these objects on the screen. I al...

Audio programming and tone synthesis

I am mostly a business programmer and I've not done anything in audio programming since the ZX Spectrum so I'm not sure how to even ask this question correctly. I just need some pointers in the right direction with regards to writing (Android in this case, but it is really a general question) applications which deal with audio such as a...