Android :: How To Read USB State?

Oct 27, 2009

Is it possible to know when the user unplugs a charger or headsets from the device so I can trigger something..

Android :: How to read USB state?


Android :: Read Phone State And Identity?

Feb 27, 2010

For applications that set the android.permission.READ_PHONE_STATE permission. What is meant by "identity" in the permission description "read phone state and identity"? Users ask about this and we don't know what to tell them...

View 5 Replies View Related

Android :: Application Read Phone State And Identity?

Dec 6, 2009

Anyone know what providing an application access to "Phone calls: read phone state and identity" actually does?

View 5 Replies View Related

Android :: Android Permissions - Calls Read Phone State / Identity?

Nov 17, 2009

My android app has nothing to do with phone calls, but I'm seeing that when I install a debug build on my test device it requires "Phone Calls: read phone state and identity" permissions. (I make no mention of this in AndroidManifest.xml). I'd like to have the minimum possible permissions, and wondered if anyone knew how to get rid of this? I commented out the part where I was logging some stuff from Build.MODEL, Build.VERSION.*, etc. I also commented out the part where I was detecting the landscape/portrait orientation thinking that that might be the "phone state". But neither of those seemed to remove that permission required.

I found this bug report but it's marked working-as-intended with a note about permissions being correct from the market but not otherwise. Is this other people's experience? (I'd hate to have to publish to the market just to test that out.) Otherwise, does anyone know if there's an API I can avoid calling that will make it so my app doesn't need this permission?

View 4 Replies View Related

Android :: Changing Displayed State Of Views Based On Parent ViewGroup's State

Aug 11, 2010

I have a compound UI component built up from a ViewGroup containing a number of TextView, ImageView etc. components. Many of these have StateListDrawables as their images/backgrounds. Is there any way of making them select from this drawable based on the state of the parent ViewGroup rather than the component itself? Ideally I want to be able to change the visual state of all children of the ViewGroup (text colour, image etc) based on the state of the ViewGroup, preferably without having to hook up complex logical code. This seems like a fairly common sort of requirement, so I was hoping it would be straightforward in Android - am I going to be disappointed?

View 1 Replies View Related

Android :: Phone State Listener State Transitions

Feb 8, 2009

I'm a little confused by what I'm seeing with regards to phone state transitions via the PhoneStateListener. When I receive a call, this is what happens: (call comes in) RINGING -> IDLE (I pick up) OFFHOOK (I hang up) IDLE It's that first transition from RINGING to IDLE without any interaction from me (not ending the call, not answering the call) that confuses me. Do I really have to implement an idle counter to know that an incoming call has really ended? Seems like the reported phone state represents some sort of phone state that isn't the obvious one.Is this a bug or am I just not in tune with the paradigm here?

View 2 Replies View Related

Android :: Email Widget - When Ever Read Email From Gmail Account - Doesnt Update Read Status - Still Shows As Unread

Oct 6, 2010

I know this has most likely been discussed many times. But I am looking for a decent email widget.

At the moment I am using the default htc email widget, however when ever I read an email from my gmail account it doesnt update the read status so it still shows as unread.

I would like one that would update the read status and possible the support for unified inbox so I can see new mail from hotmail account and gmail.

View 2 Replies View Related

Android :: How To Get Service State?

Jan 6, 2010

I'm trying to get current service state of my phone. It can be easily fetched with get State() method of Service State when a on Service State Changed (Service State service State) callback is invoked: Code...

View 2 Replies View Related

Android :: Dev - Save State

Sep 1, 2010

can someone helpme out with how to save state of the app when the screen orientation is changed i read the development guide at http://developer.android.com/guide/topics/resources/runtime-changes.html#HandlingTheChange

But i dont know how to define the method collectMyLoadedData();

View 2 Replies View Related

Android :: Screen On/Off State?

Nov 3, 2009

I have an app that runs in the background indefinitely provided there is work to be done. I want the app to go to sleep if there is no work to be done and the user is idle. The second part has me stumped. On Windows Mobile I was able to poll the power state to determine user idleness. On BlackBerry I was able to poll the device idle time. However, there does not appear to be a way to determine user idleness on Android.

Instead of polling for user idleness directly, I thought I might be able to use the on/off state of the screen. There are 2 intents ACTION_SCREEN_OFF and ACTION_SCREEN_ON and I was able to setup a listener for these (BroadcastReceiver). The problem is that I do not know how to determine the current state of the screen at the time I register the listener, therefore I have to wait until the next screen on/off change to know anything. The docs speak of some intents that are "sticky" and thus will allow the current state to be determined, but the screen events do not appear to have that property. What am I to do?

In general, I find the lack of support for polling system state properties (e.g. screen state, power state, signal strength) in Android to be annoying. It's cool that one can listen for changes in system state rather than constantly polling for them, but one still needs to know the current state of the property at the time the listener is registered.

View 10 Replies View Related

Android :: Restore Instance State

Aug 24, 2010

I need to save some state when the user leaves my game during game play. Saving the state doesn't seem to be an issue, but I can't figure out how to restore it. The onCreate function isn't called when the Activity is resumed (only when it is first created), so I can't get my state back there. Logically, I would use onRestoreInstanceState, but it isn't being called.

CODE:..........

I see log output from onSaveInstanceState, onResume, onCreate, etc, but I never see a log message from onRestoreInstanceState and savedState is always null. Why isn't onRestoreInstanceState being called, and is there another way to get my state back?

View 1 Replies View Related

Android :: Usability / State Vs Verb?

Feb 26, 2010

My business partner and I have a small disagreement, and I'm trying to figure out the best way to resolve it. First, I should say I started out his way, and switched after reviewing a lot of applications. The background is this -- we have an app, with some controls which can be locked. A lock/unlock icon is put next to the lockable controls. You can long-click the icon, and it brings up a context menu with several items, including the item for the lock state.Currently, it brings up a "Locked [X]" or "Locked [ ]" item -- that is, a menu item with a checkbox that can be checked or unchecked, and the lock state is changed accordingly.He would like me to change it to reflect the action being taken. I.e. the menu item would say "Lock" if it is currently unlocked, and "Unlock" if it is currently locked.It would be acting as a toggle in either case; the only difference is how it is presented to the user.

View 7 Replies View Related

Android :: How To Get BT State / Update Application?

Apr 24, 2009

At the moment I am trying to update my application to Android 1.5. In Android 1.1 I was able to detect the BT state with catching the following broadcasts: Code...

View 8 Replies View Related

Android :: How To Save App State In Phone?

Aug 30, 2010

I am writing an app where I get all the data from the rest call and display all the data in a custom component list(based on Linear Layout) which is added to a LinearLayout. I write this code in onCreate of the activity. The problem is when I switch activity using startActivity, and come back to the calling activity (using startActivity) then onCreate is called again. I see onPause, onStop called when I call other activity. Is there any way that I can save the application's state?

View 1 Replies View Related

Android :: How To Get Pressed State Of Preference

Sep 10, 2009

There is know problem in all the Android phones. Go to Bluetooth Settings->Turn ON bluetooth->Click on bluetooth discovery->Then timer will start in summary->Long press on Bluetooth device discovery-> observe Bluetooth ON/OFF title start to toggle with Bluetooth Discovery toggle. I analyzed the issue. Blueooth ON/OFF is CheckBoxPreference. Bluetooth Discovery is also CheckBoxPreference which has dependency on Bluetooth ON/OFF. When we click on Bluetooth discovery then On thread will run at every second to update summary in Bluetooth Discovery preference. When we change the Bluetooth discovery to OFF then thread will be removed/ killed. When i press the Bluetooth discovery for long time when its already in ON State then still the thread will be updating the summary (remaining time from 120 to 00) till i press it. When i leave the Thread will stop. As it has dependency on Bluetooth ON/OFF, its making to the title invisible. But it should not happen. Solution: When i touch the Device Discovery i should kill the update summary thread then i guess, that problem will be solved. But in prefence i dont have any listener to know the pressed state. I hope somebody can give me solution.

View 2 Replies View Related

Android :: Saving Application State?

Jan 11, 2010

I understand how to save an application's state by using SharedPreferences, onSavedInstanceState() & onRestoreInstanceState(), etc as outlined in a similar post ( http://stackoverflow.com/questions/151777/how-do-i-save-an-android-applications-state ), but how do I save the last activity?

To be more specific, my application starts up and goes to a login screen. Once a user logs in and navigates through several activities, lets say he or she leaves the app using the home button or in some other way. Next time the user starts the app, it will go back to the login screen and do a login again. Instead, I want the app to start up and go to the last activity that was on top of the stack when the user left the app in the previous session.

How is the last activity saved so that it can be restored on app startup?

View 3 Replies View Related

Android :: Get Current Sensor State?

Feb 7, 2010

Yes, I can get sensor update events with SensorEventListener. But this approach has 2 drwwbacks:

1) For some sensors I have to wait for the state to update. For example, temperature may update after a minute!

2) In some cases I can get incorrect readings. For example, the phone lies on a flat surface and does not move. I receive first orientation update event after listener registration. When only a part of the orientation vector changes, other parts may be 0. And it is no way to determine, is it a true 0 degree azimuth or just an incomplete vector. If I move the phone a little, the correct non-zero azimuth appears.

To solve this problems it's possible to create a separate thread that constantly monitors sensors. After some time it will certainly contain true values. But I think that it is an overhead for such simple task.

Is it any other way to get current sensor data?

View 1 Replies View Related

Android :: ImageButton With A Selected State?

Apr 9, 2010

If I was using an ImageButton with a selector for its background, is there a state I can change which will make it change its appearance? Right now I can get it to change images when pressed, but there seems to be no "highlighted" or "selected" or similar state which lets me toggle it's appearance at will.

Here's my XML, it only changes appearance when pressed.

CODE:........................

View 2 Replies View Related

Android :: Saving State Of An Application?

Jul 5, 2010

Which of the following is/are appropriate for saving the state of an Android application?

a. Activity.onFreeze()
b. Activity.onPause()
c. Activity.onStop()
d. Activity.onDestroy()
e. Activity.onFinish()

View 2 Replies View Related

Android :: Saving And Restoring State?

Jul 15, 2010

I have searched through this and a few other sites for the answer, but I have been unable to find it. I am trying to save a boolean and an int using onSaveInstanceState and onRestoreInstanceState, but I can't seem to get it to work. It doesn't crash or anything, but it either isn't saving it or it isn't restoring it, or I am stupid and have no idea what I am doing.

Here is what I have for my activity, do I need to have it in my onCreate somewhere or something?

CODE:..............

I tried putting stuff in the onStop, but it crashes, which is why its empty, in case that matters, thanks in advance

View 2 Replies View Related

Android :: Save State In My Application

Jul 16, 2010

I am developing an android application in which,the first activity is that for Login. After successful authentication, user can see an activity with 4 Tabs. My problem is that when user taps on the home button,the application should terminate and when the user again starts my application, he should be able to see the Login screen again and after successful Login, user should be able to see the tab on which he was working before application terminated(i.e., save state for all the tabs).

View 3 Replies View Related

Android :: Save .app.Application State?

Aug 9, 2010

I've encountered a problem wile using my own subclass of android.app.Application. I have numerous activities in my application and I'm running a custom ROM which consumes quite a lot of memory. What happens is when I launch a third party activity (Camera) my Application is killed. My Application subclass stores vital data for the whole app so it can't work without it. android.app.Application doesn't have any methods for saving or restoring application state. Activity does have them but they are not suitable.

How to perform save/restore state on Application subclass?

UPDATE I've managed to do so by filling a Bundle obtained from onSaveInstanceState and restoring values in onCreate. But is there any better way?

View 1 Replies View Related

Android :: How To Know Whether A MediaRecorder Is In Running State Or Not

Aug 11, 2010

I wrote a code to record audio of call conversation using MediaRecorder.

how can i know whether a MediaRecorder is in running state or not, to stop the recording.
like

CODE:............

Above code is just an example.. If you do not understand my question, please tell me.. i will explain clearly with actual code..

What all i want to know is "In which state the MediaRecorder is?" -> recording/released/prepared/initial/etc..

View 1 Replies View Related

Android :: Get Key Events In Keylock State?

Aug 13, 2009

Basically I have handle the volume UP/DOWN key events when device in key lock state. How I can do this?

View 2 Replies View Related

Android :: Save State Between Orientations?

Sep 4, 2010

In a previous question I asked how I could display two different layouts for portrait and landscape orientations:

Problem switching to landscape orientation

Now I would like to know how I can save the state of my application before it goes into another orientation? I seem to lose this data any time orientation changes.

View 1 Replies View Related

Android :: Can't Set Checkbox State In OnPrepareDialog

Nov 6, 2010

I've got a dialog which shows a list of checkboxes. The info which boxes should be checked each time it opens comes from an edittext. I searched for a way to not allow caching of the dialog but couldn't find out how to do that. Now I override onPrepareDialog to set the checkboxes before the dialog opens. I deleted the content of my edittext, opened the dialog and there were still the same boxes checked... how to reset the checkboxes?

CODE:.......................

View 1 Replies View Related

Android :: No Broadcast On SIM State Change / Get It?

Jul 11, 2009

Am I right if I say that, there is no broadcast action currently for the SIM card state changes?

View 2 Replies View Related

Android :: Get SIM State In GsmServiceStateTracker.java?

Aug 10, 2010

How can I get to know whether SIM is present or not in GsmServiceStateTracker.java file?

View 1 Replies View Related

Android :: ToggleButton Won't Keep State In ListView / Why Is So?

Oct 5, 2010

Any one knows why my ToggleButtons won't keep their states in a ListView?

Each list item includes a ToggleButton - when scrolled off from the screen their states are reset to unchecked...

I presume getView() is called once they're visible; however I'm not re instantiating them anyways.

View 2 Replies View Related

Android : Keep User State In Droid?

Jun 30, 2010

I am developing an Android app that needs to receive specific informations for each user.

I made an authentication using GET and POST methods. Now I have the cookie delivered by the server when the username and password are correct.

How do I store this data? I looked for but couldn't find the best way to store a session in Android.

How applications like Foursquare, Facebook for example keep the state of an user? How do they persist data?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved