Android :: Accessing Ringer Mode Does Not Work Inside Service
Jul 9, 2010
I have an application that creates a notification with sound when a specific text comes in. To do this, I detect the current ringerMode, change the ringerMode to normal, play the sound, and then quickly return the ringer back to its original setting.
View 1 Replies
Oct 7, 2010
I've posted this on Android Security as well, but that group does not appear to have as much activity. Actually I guess my question belongs in this group anyway, even though it touches on some of the security aspects of android packages. My goal is to access the certificate that was used to sign the apk package; and ordinarily, I would do that from inside the program like this
Certificates[] signingCertificates = getClass().getProtectionDomain().getCodeSource().getCertificates();
Unfortunately it appears that getProtectionDomain() returns null on android - according to the specs
http://developer.android.com/reference/java/lang/Class.html#getProtec...
This method might return null (to converse space?) but only for system classes. Since I'm calling this from one of my own classes, I would expect to get a non-null value, but unfortunately not. I have tried from the emulator, and from an application deployed on my phone using adb through a USB cable. I'm using the latest SDK (2.2) and targeting android 1.6. So I guess I have two questions, the first being: why does getProtectionDomain return null, and have anyone had any success using this method from inside an android application. And the second: Is there some other way to access the certificate that a given apk package was signed with (I can live with the restriction that only a given package can know its own certificate).
View 2 Replies
View Related
Aug 25, 2009
I have a click listener:
private OnClickListener onMyListener = new OnClickListener() {
public void onClick(View v) {
myMethod();
} };
And my Method:
private String myMethod() {
TextView tv = (TextView) findViewById(R.id.TextView1);
return (String) tv.getText();
}
When it calls this method, at tv.getText() it breaks in the debugger.
With this in the stack --
ViewRoot.handleMessage(Message) line: 1571
ViewRoot(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 3948
Method.invokeNative(Object, Object[],
Class, Class[], Class, int, boolean)
line: not available [native method] Method.invoke(Object, Object...) line: 521 ZygoteInit$MethodAndArgsCaller.run() line: 782 ZygoteInit.main(String[]) line: 540 NativeStart.main(String[]) line: not available [native method]
View 2 Replies
View Related
Oct 4, 2009
Kids, while they are at school, wish to have the phone in silent mode. All other time, would like to have the ringer on. Is it possible to program the ringer mode with days and time? Is it a challenge to Android or the device manufacturers or for Google? Anyway, my kids will be the first users, if it is available.
View 4 Replies
View Related
Jul 19, 2010
I have the following broadcast receiver:
public class MyRingModeReceiver extends BroadcastReceiver {
@Override public void onReceive(Context context, Intent intent) {
Logger.iLog("In my Receiver"); } }
I then have a service that onCreate does the following:
IntentFilter filter = new IntentFilter();
filter.addAction("android.media.RINGER_MODE_CHANGED");
registerReceiver(new MyRingModeReceiver() , filter);
When I place a call to the emulator and use the volume keys to modify (silence) the ringer
nothing happens.
View 1 Replies
View Related
Aug 4, 2010
I'm building an Android application that needs to communicate with a MySQL database. The application isn't meant to be published, and I want the application to be the only thing allowed to interface with the web service I'll create for DB access.
I've been thinking how I can secure the system, and this is the idea I've come up with. I'd appreciate any feedback or other ideas. Surely there is a method built into Android that I am unaware of.
My thought is to give the web service a GUID. Each time a call is made to one of it's public methods, the web service matches its GUID with the GUID given to it by the Android application. If the GUIDs do not match, the web service refuses access. In short, my system has a 128-bit password.
View 1 Replies
View Related
Apr 25, 2012
i am consuming a Wcf service from Android. i am a bit new to Android Dev most of my problems i was able to resolve. this one caught me off guard. My wcf service is defined as follows
Code: public List<MemberModel> Helloworld(string number)
{
List<MemberModel> lstnames = new List<MemberModel>();
MemberModel model = new MemberModel();
[Code]....
View 1 Replies
View Related
Sep 27, 2010
Back when I had my LG Envy, I could set it to rign and vibrate at the same time, cause at time I am in a load area and cannot hear the ring. Can I set my Ally to Ring and Vib at the same time?
View 3 Replies
View Related
Apr 15, 2010
I've got some problems muting the phone via code. The app I develop should mute the phone when a call comes in. This means it should not ring and vibrate at all. My first attempt so archive this was setting the AudioManager Ringer Mode to RINGER_MODE_SILENT using the following code.
AudioManager am = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE); am.setRingerMode(AudioManager.RINGER_MODE_SILENT);
While the phone stops ringing it continues to vibrate although the documentation of RINGER_MODE_SILENT says it should also stop vibrating. My second attempt was to switch off the vibration mode manually. am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF ); But this also doesn't stop the phone vibrating.
View 3 Replies
View Related
Dec 9, 2009
I use Ear to set my ringer profile and it seems to work great. However the ringer volume often goes to silent mode, because I unintentional push the ringer volume button and I miss the calls. Does anyone have a solution for this? Is it possible to turn of the ringer volume button on the Hero?
View 1 Replies
View Related
Oct 9, 2009
I want to run part of my app logic in a background service. However, much of the app uses JavaScript.Currently I run the JavaScript inside a WebView.Is it possible to have an invisible WebView while running inside a Service?If the answer is no, is there any way to run JavaScript inside a Service?
View 4 Replies
View Related
Jul 5, 2010
I love my lg ally but out of nowhere the ringer won't work. i've doubled checked that all the ringertones have been set && that the ringer volume is turned up on everything but everytime my phone gets a text or call it won't ring.
View 5 Replies
View Related
Aug 6, 2010
I have an activity A which uses SharedPreferences to share data with a service S, which is called from within A.Now when I call the stopService() method from A, the onDestroy() method in S is not called immediately.I thought that all the activities and services under a single apk run in just one process. Why then does the jump to onDestroy() not take place immediately instead I can see the output from onDestroy() after the further code in the activity A is executed.
View 5 Replies
View Related
Jul 11, 2010
Bought the Galaxy S yesterday. I connected the phone to my Windows 7 (64-bit) laptop directly (no USB hub). It detects the two internal memories, but the moment I access them; it says please insert the disk in the drive. What might be problem here? The memory shows as mounted in the phone.Also, Kies application does not appear to be working on Windows 7 64-bit. It does get installed properly, but does not detect the Galaxy S.
View 7 Replies
View Related
Apr 13, 2010
I'm trying to change the ringer mode of the phone to RINGER_MODE_SILENT when a call is incoming by using the following lines of code.
CODE:...............
While the phone stops ringing it continue to vibrate although the documentation of RINGER_MODE_SILENT says it should also stop vibrating.
I'm using the SDK 1.6
UPDATE:
As I didn't find a solution yet, I tried to deactivate the vibration settings manually.
am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF );
But this also doesn't prevent the phone form vibrating when a call is incoming.
UPDATE 2:
Today I tried to solve the problem by canceling the vibration via a Vibration object.
Vibrator vib = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
vib.cancel();
Again, without success. Now I'm running out of ideas and asking myself if it is possible to stop the vibration at all.
UPDATE 3:
I've discovered another interesting fact when I've reread the documentation of the Vibrator class. The documentation says:
"If your process exits, any vibration
you started with will stop."
View 2 Replies
View Related
Oct 7, 2009
I am having trouble getting a selector to work inside a button on an app widget.
My app widget xml looks like this:
CODE:......
My_selector.xml in my drawable directory looks like this:
CODE:.............
The button doesn't change appearance....
View 3 Replies
View Related
Apr 30, 2010
I am trying to execute a {public void} method in Service, from scheduled TimerTask which is periodically executing.This TimerTask periodically checks a condition. If it's true, it calls method via {className}.{methodName};However, as Java requires, the method needs to be {pubic static} method, if I want to use {className} with {.dot}.The problem is this method is for notification using Toast(Android pop-up notification) and Status Bar.But for this to work, the method must not have {static} modifier and resides in Service class.So, basically, I want background Service to evaluate condition from scheduled TimerTask, and execute a method in Service class.Can anyone help me what's the right way to use Service, invoking a method when certain condition is satisfied while looping evaluation?
View 1 Replies
View Related
Oct 23, 2010
I get bad service at certain buildings. I'm in target store right now and service is ridiculously bad
View 16 Replies
View Related
Nov 14, 2010
Last week I was in the US and had gotten the AT&T pay-as-you-go sim. It charges 1c/kb and I thought that's not too bad since I *only* get outlook and yahoo email. Well, *before* I knew it, it sucked up $14.40 for internet access....Frantically called AT&T customer service and after a long wait, they told me that my device had access the service and downloaded 1.5Mb! I asked them if there was a way to turn off the GPRS(since I was mostly interested in their $2/day unlimited calling service) and they said they don't have a way to turn it off Tried a bunch of things like turning off auto-sync (in settings) etc...but STILL I ended up paying $40 by the end of the day!!
Is their a way to turn off GPRS completely and also monitor what applications are accessing the service? All I have to go by is what AT&T says at the website!
View 5 Replies
View Related
Dec 23, 2009
I have loaded some of my own music to use as ringers, and they show up when selecting phone ringers and via contacts to select unique ringers for specific contacts, but they do NOT show up when I am trying to select the ringer to use for SMS messaging. Only the factory ringers show up for SMS. Any idea how to get my side loaded music to work as the SMS ringer?! I can't stand the factory ringers. This was so easy to do on my BB Curve and Palm Pixi, so I am baffled why I can't figure it out on my Moment.
View 11 Replies
View Related
Aug 11, 2010
I want the view group to extend with the ScrollView if the content of the group is smaller than the display area of the ScrollView.
How can I have the ScrollView child extend to fill the parent if it's smaller than the parent?
CODE:.........................
View 3 Replies
View Related
Jul 20, 2012
I am developing an application,I tried implementing a swipe action using viewSwitcher. It was working fine. But when I tried implementing the same code inside a scrollView the swipe action is not working.
View 1 Replies
View Related
Mar 7, 2012
I've got viewpager working as it should, but i can't figure out, how to make the buttons inside the views in viewpager work,
View 2 Replies
View Related
Oct 30, 2010
I've been a couple of days trying to solve this thing but I can'f figure it out.The problem is, simple activity, with simple layout, ScrollView -> LinearLayout -> and a lot of buttons inside the layout (within the scroll content). Everything works just fine but one tricky thing. When I click a button let's say at the top of the scroll content and inmediatelly I scroll down to the bottom of the content and I click other button there, nothing happens until I click a second time and all come to normal again.This can be reproduced anytime and it's code independent (i've tried more than 20 scenarios). I've not much experience in android yet but looks like the scroll listener stops the onclick listener or something like that.
View 1 Replies
View Related
Jan 26, 2010
I am using a service in my app. But it doesn't seem to work in sleep mode. I have implemented startforeground to prevent it from shutting down but it still does. Following is my code.............................
View 4 Replies
View Related
May 23, 2009
I'm trying to log the phone's cell movement. So I created a PhoneStateListener that is being called when the CellLocation has been changed. Then it informs a logging service to write that new cell information to a log file.
This works as long as the screen is on. But when the screen goes off, the logging stops.
I have two classes:
The PhoneStateListener gets loaded on boot time public class CellStateListener extends PhoneStateListener { public void onCellLocationChanged(CellLocation location) {...this is the logging service which is informed when the cell location changes listener.onCellChanged(mcc, mnc, lac, cid); ... }
View 3 Replies
View Related
Jul 7, 2009
So I've been extremely frustrated by this for a long time now.I've posted before, but can't seem to find a good solution. My goal is to have something pretty much exactly like the installed application details page in the Android Market.I need a list of items displayed along with other content above the list, and would like the content above to scroll up along with the list (exactly like the application details does for the "My Review" and other descriptive info).Due to responses to my previous posts, I came to believe that it really wasn't possible to do this with a ListView.So rather than using a ListView, I refactored my code to use a simple LinearLayout and add individual View items to the list, thinking I could just set each View as clickable and add an OnClickListener to each View in the LinearLayout.That's not working at all though, and now I'm getting even more frustrated.If someone can help me get the OnClickListener working, then I think it'll work, but I do need a separator for the LinearLayout.How do I add a separator like the one used for ListView to my LinearLayout?
View 12 Replies
View Related
Sep 5, 2010
My app which was working on 2.1 and earlier version fails to run properly in 2.2. It relies on the location but I do not get any error message. However under DDMS /logCat, I see a message saying: Error message while getting the location address: Reason: this service is not available. This is coming more as an information message rather than an exception or error. The process that is printing it out is System.out. Note that I did everything possible ( I can think of) to upgrade the app to run in android 2.2. The API version was changed to 8.
The manifest file contains all the following:-
<uses-library android:name=*"com.google.android.maps"*/>
</application> <uses-sdk android:minSdkVersion=*"8"* />
<uses-permission android:name=*"android.permission.INTERNET"*/>
<uses-permission android:name=*"android.permission.ACCESS_FINE_LOCATION"* />
<uses-permission android:name=*"android.permission.ACCESS_COARSE_LOCATION"* />
View 5 Replies
View Related
Jun 30, 2010
I have an Android Service that is started by my application and does some things in a threadPool using Executors.newCachedThreadPool()
Once it has finished doing it's work I would like the service to stopSelf(), how can I get the service to determine when it is no longer needed (ie, there are no more Threads executing) so that it can shut itself down automatically?
View 1 Replies
View Related
Dec 21, 2009
This is the scenario:
1 user has a main activity used for ii.
2 program needs to communicate with peers and keep connection and wait for messages
3 when a message comes it is shown in the main activity. so the question is should I use a service for the communication and what type of service? and also should I use Aspects in the service in order to keep my ii responsive and why?
View 1 Replies
View Related