Android :: TelephonyManager.listen Forces Application To Terminate

Oct 3, 2010

I am new with Android, and writting a small application for tracking call events. Every time i try to bind the listner, the os forces the app to close unexspectly. What did i miss? Here is my code:package com.example.helloandroid;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.telephony.CellLocation;
import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.TelephonyManager;
import android.widget.TextView;public class helloAndroid extends Activity {
TextView textOut;
TelephonyManager telephonyManager;
PhoneStateListener phoneStateListener;
@Override
public void onDestroy(){
telephonyManager.listen(phoneStateListener, PhoneStateListener.LISTEN_NONE);
}/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Get the UI
textOut = (TextView) findViewById(R.id.textOut);
// Get the telephony manager
telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
// Create a new PhoneStateListener
phoneStateListener = new PhoneStateListener() {
public void onCallForwardingIndicatorChanged(boolean cfi) {}
public void onCallStateChanged(int state, String incomingNumber) {}
public void onCellLocationChanged(CellLocation location) {}
public void onDataActivity(int direction) {}
public void onDataConnectionStateChanged(int state) {}
public void onMessageWaitingIndicatorChanged(boolean mwi) {}
public void onServiceStateChanged(ServiceState serviceState) {
String stateString = "N/A";
switch (serviceState.getState()) {
case TelephonyManager.CALL_STATE_IDLE:
stateString = "Idle";
break;
case TelephonyManager.CALL_STATE_OFFHOOK:
stateString = "Off Hook";
break;
case TelephonyManager.CALL_STATE_RINGING:
stateString = "Ringing";
break;} textOut.append(String.format("
onCallStateChanged: %s", stateString));
} public void onSignalStrengthChanged(int asu) {}
}; // Register the listener with the telephony manager
telephonyManager.listen(phoneStateListener,
PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR |
PhoneStateListener.LISTEN_CALL_STATE |
PhoneStateListener.LISTEN_CELL_LOCATION |
PhoneStateListener.LISTEN_DATA_ACTIVITY |
PhoneStateListener.LISTEN_DATA_CONNECTION_STATE |
PhoneStateListener.LISTEN_MESSAGE_WAITING_INDICATOR |
PhoneStateListener.LISTEN_SERVICE_STATE |
PhoneStateListener.LISTEN_SIGNAL_STRENGTH);

Android :: TelephonyManager.listen forces application to terminate


HTC Hero :: Terminate An Application

Jul 30, 2009

Is it possible to terminate an Application? I downloaded Advanced Task Manager, as i could not find a normal way of doing it!

View 9 Replies View Related

Android :: What Application Forces Close Mostly?

Aug 8, 2010

For me, it would be K9 Mail. What about you all?

View 7 Replies View Related

Android :: Application Forces Close When Launched From The Market

Jul 2, 2009

I have uploaded application to market and met weird problem which I never received before - when I click "Open" button when the application is installed I receive error dialog and the application is forced to close. I do not have this problem when start application from desktop launcher panel. I have already receive 2 stars for that though the exception even comes not from my cod - very unpleasant surprize from market app.

Application uses vibration and declares corresponding uses-permission "android.permission.VIBRATE" - this is what the exception tells me about, but I can't see such problem with other apps that use vibration on market.

Here the exception:

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

Here is application manifest:

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

View 2 Replies View Related

General :: Application Which Forces All Processes To 0% Cpu Usage When Idle

May 26, 2013

My idle cpu usage seems a little high and sporadic and I'd like to force them all to 0% when idle but still be able to receive background data like for instance my play store seems to use a continuous idle usage and a few others. I can freeze them with the System Tuner but I'd prefer to Globally force all apps to 0% usage so I'm getting say 1% usage at idle on occasion every hour or few hours? When I use System Monitor, I see my cpu usage kind of jumping from 0 to up to 35-40% while idling and I don't want these apps using any resources at idle. I'm trying to extend battery life a lot more.

My battery life is really good already since I have a 3600mah battery but I could get even better if I can dial in the usage at idle.

Is there application that can do that?

On another note, I can't seem to figure out why my Google Calendar won't open a "New Event" it just sits on the Loading... Screen

View 6 Replies View Related

Android :: Android Map Application Forces Close When Map Marker Is Clicked

May 19, 2010

I'm building a google map application that marks several points on the map. I'm currently trying to get the dialog box to appear when the marker is clicked. Right now, the markers appear at the right places but when i click them, the entire application stops unexpectedly/forced to close.Does anyone have any suggestions on what is wrong and how i should go about fixing it?

View 1 Replies View Related

Android :: Register Receiver To Listen For Application Update

Jul 1, 2009

I'd like to add a Broadcast Action to my Intent Filter that listens for when my application is successfully updated(replaced).A new version of an application package has been installed, replacing an existing version that was previously installed. The data contains the name of the package."

View 4 Replies View Related

Android :: How To Terminate An APK On Emulator

Apr 16, 2009

I'd like to know how to terminate / kill an APK on emulator. Most times I reinstall the APK, but I was wondering if there is a better way because I simply need to restart my APK...

View 3 Replies View Related

Android :: How Can I Hangup / Terminate Call Programmatically?

Sep 17, 2009

Can any one tell me how can i hangup/terminate call programmatically?With the help of intent.

View 2 Replies View Related

Android :: No Intent To Terminate (end) Call Programmatically

Jun 3, 2009

Is android supports the terminating the phone call programmatically using either intent or any APi? If not now then can we see one of the above in the future sdks??

View 2 Replies View Related

Android :: How To Hang Up (disconnect / Terminate) Incomings Call?

May 3, 2010

"How do you hang up incoming calls (in Android of course)?"First, I know this question has been asked and answered several times, and the response is always "you can't". But if we look in the market we get a few applications (all private software, no access to the source code that do this action, such as CallFilter, Panda firewall and others.So does somebody know how these apps do the hang up action, (or terminate, or disconnect or whatever you call it)?And other question, if the first don't get a response.. does somebody know how send an incoming call to the voice mail?Of course, all questions are about how to do it programmatically. So with the voicemail question I know there's a flag in contacts that is used for that, but like I said, I'd like to know the programmatical way.

View 2 Replies View Related

General :: How To Terminate App On Home Button Press

Mar 2, 2012

Is there a possible way to completely terminate app on home button press? Because everytime my friends use my phone they didn't realize there is a back button.. So they just presses the home button like they were using idevices.. This would hog the memory with the running apps and i have to constantly close them everytime they finish playing.. ICS does have this feature but im running GB atm..

View 4 Replies View Related

Android :: Rotational Forces Doesn't Work

Nov 16, 2009

I have created an Activity A, which is blocked from rotating. I have implemented this by adding android:screen Orientation="portrait" in the Android Manifest. I have tested the app, Activity A didn't enter landscape mode when I rotated the phone, everything worked fine. Then I created another Activity B, which is a 'Dialog theme' Activity. Inside Activity A, I called.

View 3 Replies View Related

Android :: Scroll View Inside Linear Layout Forces Buttons Offscreen

Nov 4, 2010

I'm trying to build an activity that has a checkbox on top, a button at the bottom, and a bunch of other widgets scrolling in between. Conceptually that'sWhen it renders I get the checkbox at the top, the stuff scrolling nicely underneath, but the Button drawn offscreen (I assume) below the ScrollView. The only way I can get the Button to be visible is to hard-code the height of the ScrollView, which of course only works on one screen-size. I've tried all combinations of gravity and layout_weight I can think of to no avail. Am I using the right combination of Views? Anybody managed to get this working?

View 1 Replies View Related

General :: New SIM Forces To Clear Data

Mar 14, 2014

I have a Motorola XT626 (IronRock) its a dual sim (Iden/gsm-3g) with android 2.3.6.At first time, both SIMs, nextel and the other carrier, if putted from the beginning there is no problem. But when trying to change the SIM, to use an other phone number or upgrading the SIM model.It forces to erase private data.Message says: "A new SIM card is being used. All private data must be cleared before you can continue"If no option its selected it erases it, hate to do a backup to just change the SIM or imposible to change the SIM on the fly.Its Rooted, so looking forward to edit any file and line in the db files to fix this problem.

View 1 Replies View Related

Sprint HTC Hero :: Wi-fi Tether Forces Close?

Feb 4, 2010

My phone is rooted with the Fresh 1.1 rom and I have used the Wifi-Tether many times and it always worked great. Now today I went to sign on and it forces close. Anybody have any ideas?

View 5 Replies View Related

HTC Droid Eris :: 2.1 V3 Forces Sense UI To Close Alot

May 5, 2010

It isn't easy to summarize the problem in the title.So in 1.5 or 2.1 v1 or v2, it was very rare for the Sense UI Home app to have to re-launch.By this I mean when you click the home or back button to return to your Home screen, instead of seeing the home screen you see the black screen with HTC on it, then you wait while it loads the Home application.This very rarley happened before v1.3. Now it seems to happen at least once or twice a day.I don't have more apps installed than I did before, I shouldn't be any more out of memery than I was before.

View 5 Replies View Related

HTC Droid Eris :: Phone Forces To Close Most Apps / Way To Fix?

Jun 5, 2010

I have a Droid Eris, but recently its become super leggy and forces closes on most apps. Even the phone function is becoming quite the hassle.

View 6 Replies View Related

HTC Incredible :: Screen Sleeps And Forces Password / Stop It To Do So?

Jun 10, 2010

How do I make it so when my screen turns off when I pause while writing a text or email it doesn't lock and make me re enter my password.

View 9 Replies View Related

Motorola Droid :: Ihome Forces Droid Into Dock Mode

Feb 15, 2010

When you place your Droid in the dock, the dock home screen automatically appears. I noticed recently that when I sit my Droid on top of my iHome (yes, I have an iPod), the dock home screen appears as if I had just placed it into my dock. For some reason or another, the iHome is forcing my Droid into dock mode. Any ideas as to why this happens? Also, can anyone reproduce this?

View 10 Replies View Related

Android :: How To Listen For End Of A Call?

Feb 11, 2009

I am developing a piece of software where I need a service to be alerted of the fact that a call has just finished. I then want to have a look at a few properties of the call that just finished, and do something. Problem is I can't seem to find a Broadcast nor some kind of Listener to do this. Does anybody please have any ideas?

View 2 Replies View Related

Android :: An App Called Listen?

Sep 22, 2010

I was told by a few friends that the iphone has an app that allows you to hold your phone up to a song that you dont know and it tells you the name.Does android have anything like that?

View 6 Replies View Related

Android :: Listen To Uninstall Apk?

Aug 17, 2010

How to listen to uninstall apk?

View 1 Replies View Related

Android :: Any Way To Listen To Podcasts On Droid?

May 13, 2010

Is there a way to listen to itunes podcasts on my droid? I have seen people talk about google listen, but I can't see that letting you get podcasts from itunes?

View 7 Replies View Related

Android :: SMSReader Listen Your SMS As Soon As They Arrive

Dec 5, 2009

We have developed the application SMSReader. With this application, you will be able to listen the SMS text messages as soon as you get them. It's a really useful application when driving, because most hands-free won't be able to read SMS. The user interface is simple and intuitive. By now you can set these options:

- SMS Reader: if you check on this option you will active/desactive the application.
- Bluetooth: by selecting this option, SMSReader will only read the SMS text messages when bluetooth is on.
- Volume: you can set the multimedia volume used to play the SMS text message.You can find more info in this link:Android in Spain: SMSReader: listen your SMS as soon as they arrive.

View 7 Replies View Related

Android :: How Do I Listen To ESPN Radio?

Nov 22, 2009

All I want is to listen to ESPN Radio on my phone.I just got my Moto Droid.I've tried Google Listen.I've tried ESPN radio website.I've tried local radio station website.Nothing works.

View 7 Replies View Related

Android :: Listen From Google Labs

Oct 4, 2009

You should probably send e-mail to the developer through the address shown in the market app. For the most part, Google's Android applications that appear on Market are written just like other third party applications, and are best dealt with that way.

On Sun, Oct 4, 2009 at 3:36 PM, Andrei <gml...@gmail.com> wrote:

> When I do adb logcat I see debug messages from Google Labs Listen app > I thought they recommend we remove debug logs for release. > They also print my email in log, which might be security problem?

View 2 Replies View Related

Android :: Alternative To Google Listen

Jul 21, 2010

I've given Google Listen a go as my podcast app, but it seems buggy and not very intuitive to use. So I'd like to try something different. I'd like sync with Google Reader tho not essential, also need an app that has the option to download over wifi only.

View 3 Replies View Related

Android :: Take Songs Off Google Listen

Apr 29, 2010

How do you take the actual MP3 files off the nexus one (or any android device) when you download them from a podcast manager like Google listen? When I download podcast on my computer, they usually are in C:documents and settings usermy documentsmy music. So I can take the MP3 files and move them to wherever I want. How do I find these files on my phone after having downloaded them through Google listen ?

View 3 Replies View Related

Android :: Support For Google Listen

Sep 29, 2010

I'm a BIG fan of Google Listen, until one of their updates just started f**king up everything! I posted my concern on their discussion group (Discussions - listen-discuss | Google Groups), but I'm not sure that official channel is actually answering ANY questions. The replies are more users saying they have the same problem.

Can I get support (or answers) here or should I just stick to their discussion group?

Here are some of my concerns:
I can't fast forward or rewind anymore. If I try to move the timeline the podcast starts over.
A lot of the time I get an error along the line that it can't play the file. So; it no longer plays while streaming. I have to wait until I get a full download.
When I use my bluetooth headset to start/stop a song, it messes with the Music app. I can't disable this option without disabling it for Music.
I'm running their latest version (v1.1.3b) on my Motoroloa Droid FRG22D. I think I saw these issues when I had Android 2.1.

View 5 Replies View Related







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