yashsingh1/xdaforums huggingface dataset:
[Java for Android App Development] Androguide.fr:
You can achieve this with a simple sqlite3 query instead of bothering with java reflection ;)

Here's how :

In a terminal :

To enable 2G only

su
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
insert into global values(null, 'preferred_network_mode', 1);
.exit

To enable 2G & 3G :

su
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
insert into global values(null, 'preferred_network_mode', 0);
.exit

In java :

Example to enable 2G only (just replace the 1 with a 0 in the insert into to enable 2G & 3G)

try {
Process process = null;
process = Runtime.getRuntime().exec("su");

DataOutputStream os = new DataOutputStream(
process.getOutputStream());

os.writeBytes("sqlite3 /data/data/com.android.providers.settings/databases/settings.db" + "\n");
os.writeBytes("insert into global values(null, 'preferred_network_mode', 1);" + "\n");
os.writeBytes(".exit" + "\n");
os.writeBytes("exit\n");
os.flush();
process.waitFor();

} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}

It might require a reboot to be active though, not sure

If it doesn't work on your rom (tested on cm10.1), it might be a different row name, try investigating your settings.db like this :

sqlite3 /data/data/com.android.providers.settings/databases/settings.db
.tables [COLOR="Green"]// returns all the tables[/COLOR]
select * from [I]tablename[/I]; [COLOR="green"]// in cm10.1 it's in [I]global[/I] but otherwise look in [I]secure[/I] and/or [I]system[/I]
// this command returns all the rows from the selected table, the names are usually explicit, so you should find the setting you're looking for[/COLOR]

Then, when you found it :

insert into [I]tablename[/I] values(null, [I]'row name'[/I], value);
[Java for Android App Development] superkoal:
Thanks, this is very helpful!

I think you are right, one will need to tell the system to update the settings or send a broadcast that this setting has changed (like for airplane mode).

I will look at the CM sources to find out what i can do.
[Java for Android App Development] Androguide.fr:
Glad it helped.

If you manage to find a way to make the settings read the db without a reboot, please share your findings, would be very useful.
[Java for Android App Development] superkoal:
Of course i will!
[Java for Android App Development] serajr:
Buddy... you can toggle network mode with intent, no root needed, nor permissions!!

Here´s entire sample:

package com.serajr.togglenetworkmode;

import android.os.Bundle;
import android.provider.Settings.Secure;
import android.provider.Settings.SettingNotFoundException;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

Button bnt = (Button) findViewById(R.id.button1);
bnt.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {

// toggle
toggleNetworkMode();

}
});
}

private void toggleNetworkMode() {

int mode = getCurrentNetworkMode() + 1;
if (mode > 2) {

mode = 0;

}

// 0 = 3G_ONLY
// 1 = 3GSM_ONLY
// 2 = 3G_PREFERRED

// change mode
Intent intent = new Intent("com.android.phone.CHANGE_NETWORK_MODE");
intent.putExtra("com.android.phone.NEW_NETWORK_MODE", mode);
sendBroadcast(intent);

}

private int getCurrentNetworkMode() {

try {

int current = Secure.getInt(getContentResolver(), "preferred_network_mode");
return current;

} catch (SettingNotFoundException ex) {

return 0;

}
}
}

Try it and tell me later!!!
[Java for Android App Development] superkoal:
Thanks, but this will only work if your phone.apk has an exported receiver for this intent.

This is only the case if you or your rom dev modded it to be so.

Some custom ROMs also have this kind of "mod/bug" in the power widget, allowing you to toggle gps.

I tried it with slim bean 4.2 build 3 on i9000 and as expected it didn't work (and so will most likely in CM10.1 too).

Just too good to be true!
[Java for Android App Development] sak-venom1997:
If youre following the root method Use RootTools for that
[Java for Android App Development] superkoal:
Thanks, I already do.

Really helpful library!

And yes, I will do it by sql injection to settings.db

I only need to figure out what broadcasts have to be sent / methods called and if this is possible.
[Java for Android App Development] superkoal:
Argh I am kinda lost in CM sources.

Can anyone point me to the place where this is handled?

I managed to toggle flight mode by using this in a SU shell:

if(settingenabled)
{
executeCommand("settings put global airplane_mode_on 1");
executeCommand("am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true");
}
else
{
executeCommand("settings put global airplane_mode_on 0");
executeCommand("am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false");
}

Interstingly enough it didn't work if i manually injected the value and then sent the broadcast.

I have no idea why.

So atm I'm trying to do the same thing for preferred_network_mode. I can write the value to settings.db, but I just don't know what i have to do to make the system apply the setting yet.

EDIT: shell binary "settings" only works in android 4.2 (and probably upwards)
[Java for Android App Development] superkoal:
So i finally found it in CM Sources.

Seems like we need to get the currently running Instance of the Phone class to notify it about the change.

Also seems like we are back to reflection, as this is an internal system class.

I also killed com.android.phone process after updating the setting, but that didn't change anything.

EDIT:

1st step towards reflection:

I figured out that i need a jar file from the cm build to use system classes via reflection.

Does anyone have more information about this?
[Java for Android App Development] Androguide.fr:
Just a far fetched guess, but maybe try to add /system/framework/framework.jar from your rom to your app's build path

Is a reboot that unacceptable in your case ?
[Java for Android App Development] superkoal:
Maybe it's just the challenge, but i wanna change it like every other setting :D

A reboot is very far from what i call comfortable ;)
[Java for Android App Development] Androguide.fr:
Yeah, I get what you mean^^^

Here's a good (but old, 2009^^) official Android tutorial from the Android devs on reflection if it can help you : http://android-developers.blogspot.fr/2009/04/backward-compatibility-for-android.html
[Java for Android App Development] superkoal:
So i got some news

1. This setting is heavily protected by android system and can only be modified by the phone process itself

2. Some roms have a modified phone apk listening to a broadcast, enabling 3rd party apps to toggle

http://xdaforums.com/showthread.php?t=1731187

3. His Majesty Chainfire started an app project which could amongst other features also toggle 2g/3g, but he gave up development. Regarding 2g/3g he implemented several methods, one of them being RIL injection, which he described as a really hard hack and highly experimental.

http://xdaforums.com/showthread.php?t=807989

Seems this task is not that easy :(

But i found out that tasker can toggle 2g/3g on my phone (running slim bean 4.2.2), this is when i found out about the modified phone.apk from 2). So I'mcomfortable that it's working on my phone and i can at least develop an app for myself :D
[Sony Xperia S, Acro S, Ion] dav3x86x:
Hi guys,as the title says i cannot flah rom.

Well i can flash them but every rom has problem,I tried PAC,CM,SlimBean nothing work(or if it works,no more than one day or 2)

CM gives me MD5 errors,slimBean UI keep crashing,PAC every time i try to flash something in recovery(after flashing the rom)keep rebooting and stays on loop.

I know i mentioned specific roms and whatnot but at this time i don't think it's rom related(or recovery,i tried 3 different recovery),the only thing working flawlessly is the stock rom with root.

You guys have some advice? i've had the phone for about 5 months now and i wanted to try out roms but apparently i can't.

Cheers

Dave
[Sony Xperia S, Acro S, Ion] pharix:
Did you wipe everything when you flash new ROM?
[Sony Xperia S, Acro S, Ion] dav3x86x:
the first time with CM no because i followed a guide which didn't.

But with PAC and SlimBean yeah i wiped everything.

The first time with PAC recovery went bad(i guess)and didn't let me wipe or flash anything,i flashed a stock tft repeated the process,the flash worked but as i reboot and tried to flash the on screen button it gave me the same recovery error.

maybe i do something wrong,i came from an HTC desire HD and the whole process was easier and less problematic :(
[Sony Xperia S, Acro S, Ion] Ben36:
Fastboot the opensemc kernel beta2 kernel and then try again. Some people were having problems with flashing and Rayman has fixed it in his kernel apparently
[Sony Xperia S, Acro S, Ion] dav3x86x:
yep. CM it's now good,i kept following a wrong guide apparently :)

thanks for the help!
[RAZR i Q&A, Help & Troubleshooting] DePakas:
Hi gues. I install that app, and they always produces an error - "Is your game dead? Reset all lists", or freezes on searching. Any use that on Razr i ? :confused:

(xt890 4.1.2 + root)

UPD1:

GameCIH gives an error - "Error the system deny to root"

But i have root. Titanium BackUP works great.
[RAZR i Q&A, Help & Troubleshooting] finalvek:
Same problem here...

I I also have a Razr I and thats something I miss about my old Droid 3...

Appears that razr i ram architecture (or the SU permissions) works a bit different from the usual, what stops the memory editors like GameCih, GameGuardian and DaxAtack (that is the same as GG) from even look at the lines...

I've tried even move the editors to inside the rom, what apparently worked for some devices with the same issue, without success though...

Im still looking for a fix to that (or a better explanation)...

If i find something out, i'll share here.
[RAZR i Q&A, Help & Troubleshooting] Vulzu:
D:

Same here.

Why? Game Killer is not finding any Number, Game Guardian says, my game is death and Game Cih says my device is not rooted. But it is.

:cyclops::confused:
[MDA II, XDA II, 2060 ROM Development] orefin:
Hi, I have problem with XDAII, VERSION GTEH 1.06.01 1.60.00. After call connection to gprs fall down. Please help. Thanks
[Atrix 4G Q&A, Help & Troubleshooting] lucasmr:
Hey guys, today i installed the MROM (GB - http://xdaforums.com/showthread.php?t=1836674) in my atrix and everything is running pretty well except for my data network. I've deleted and created the APN several times, and when i do it the Icon on top bar show with 3G, then change to 4G and disapear with no connection. Anyone know how to fix this?? The procedures i used to install the rom are those in the post of the owner of the rom(Wipe Factory -> Dalvik -> install zip from sd card).

PS: Messages and Calls are working normally.

Thanks.
[Atrix 4G Q&A, Help & Troubleshooting] nh777:
Is it only with MROM? Are you running any battery saving apps that could potentially interfere with APN settings?
[Atrix 4G Q&A, Help & Troubleshooting] lucasmr:
Now this problem is with all roms now, and im not using anykind of applications like this.
[XPERIA X8 Themes and Apps] norlan07:
REQUIRES ANDROID: Varies with device

FOR ROOT AND NON-ROOTED

WORKS ON X8/W8

INSTRUCTIONS

1.DOWNLOAD https:/*/www*.dropbox.com/s/b9ponteny411ovx/com.android.vending-4.0.25.apk

[remove the [*] sign]

2.INSTALL AS NORMAL APK

NOTE: NO NEED TO PUSH IN SYSTEM/APP

View attachment 1874885
[XPERIA X8 Themes and Apps] ahmadsamhann:
its already here anyway

http://xdaforums.com/showthread.php?t=2227906
[XPERIA X8 Themes and Apps] norlan07:
this is not a flashable zip it's moded for non rooted devices without xrecovery or cwrecovery

thank you...
[XPERIA X8 Themes and Apps] CnC-ROCK:
ah well all one could do is to extract that zip to get the apk. no need to make another thread to just upload the apk. you could have uploaded it in the already present thread made by devstaff

was i rude? then i am sorry. i am just being resonable because the number of useless threads in this forum has escalated recently
[XPERIA X8 Themes and Apps] Deleted member 3493119:
I have reported this thread now, no need for reposting stuff, also user's could extract the apk file from my zip if they want to use it that way.
[XPERIA X8 Themes and Apps] Clark Joseph Kent:
OP please search before opening/creating a new thread, this topic is already in place. Thanks.
[RAZR HD Q&A, Help & Troubleshooting] larsjameson:
Hello world. I picked the Razr HD up from verizon about a week ago and I gotta say it's fan-****ing-tastic.

Anyway I noticed that my internal storage wasn't anywhere near 16gb, in fact it's ~10gb. Anyone else run into this problem?

I know the operating system is supposed to take up some space and so does the bloatware but does it really take up an entire 6gb?

Any information would be greatly appreciated.

Thanks in advance. :highfive:
[RAZR HD Q&A, Help & Troubleshooting] an21281:
Under settings/storage it breaks down categories on how much room different types of files take up on the internal storage... So you can see what is taking up the most room. To answer your question, the most free space I have seen is between 11.8-12gb free total space. If you want to free up as much space as possible, or debloat, then I would suggest rooting and unlocking the bootloader. You can then fastboot/downgrade back to ICS and start fresh to clear all storage, format ext. sd also. Flash a custom recovery and install a rom like cm10/10.1 which takes up much less room then most roms or stock moto roms.
[RAZR HD Q&A, Help & Troubleshooting] Mr.Parkinson:
an21821 pretty much answered the question spot on.

But yes, the stock ROM for the razr hd is closer to 800 Megabytes, but if you really want to clean your device, I would suggest rooting and flashing a new ROM. This will void your warranty, but you can always reflash the stock ROM again to sorta "unvoid" the warranty. If you haven't already done rooted the phone, just send me a pm and I can help you out a bit more. :)
[Galaxy Tab 2 Q&A, Help & Troubleshooting] anasyonso:
i have galaxy tab 2 gt-p3100 and there was aproblem in its compass directions

i installed some drivers and its make all programms in horizotal screen

any advice to turn its compass drivers to factory setting

i tried install all types of firmwares but that did not help

please help me
[Galaxy Tab 2 Q&A, Help & Troubleshooting] squ89r97:
im confused that you're talking about drivers and programms? and by compas i presume you mean the accelerometer?

What rom/firmware are you using, rooted or stock?

have you tried a factory reset/data wipe?
[Galaxy Tab 2 Q&A, Help & Troubleshooting] anasyonso:
i found in the internet file named compass fix and i installed it then all programms turned to horizotal view

i tried factory reset/data wipe

i tried install rooted and stock firmwares

but nothing fix the problem
[Galaxy Tab 2 Q&A, Help & Troubleshooting] et.nuclear:
can you post screenshots?
[Xperia Z Q&A, Help & Troubleshooting] exekias:
I want my phone to say "SMS" when i get a text, "Email" when i get and so on so forth.

Play store did't have much, Apps like Zedge weren't quite what i was looking for, Am I going to have to record these sound files myself and use the,? Does anyone have the answer?

Thanks in advance
[Xperia Z Q&A, Help & Troubleshooting] DarkKrypt:
You might need to get individual apps for each

On a quick search like

For email -

Mail alert https://play.google.com/store/apps/details?id=com.willdev.mailalert

And then find a audio file that says

'sms received' or 'email received' etc

I'll look deeper over the weekend

Unless someone finds something better

---------- Post added at 08:43 PM ---------- Previous post was at 08:41 PM ----------

Here's another

Sms pop ( just turn off pop up)

https://play.google.com/store/apps/details?id=net.everythingandroid.smspopup

---------- Post added at 08:47 PM ---------- Previous post was at 08:43 PM ----------

Another

IPhone notification

https://play.google.com/store/apps/details?id=com.nlucas.iphonenotificationslite

Just turn off pop ups and choose ringtone again as above
[Xperia Z Q&A, Help & Troubleshooting] exekias:
Don't stress too hard or waste too much time on me, Ill do the hard yards If i really want it
[Xperia Z Q&A, Help & Troubleshooting] DarkKrypt:
One more and how could I forget

Tasker

https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm

Again set notification sound for sms as 'sms received' etc

---------- Post added at 08:59 PM ---------- Previous post was at 08:55 PM ----------

I'm not sure if lightflow allows you to do this I know it can do leds but haven't used it in ages

Someone clarify
[Xperia Z Q&A, Help & Troubleshooting] slo2lah:
Perhaps Speaktoit Assistant is the app you've been looking for?

https://play.google.com/store/apps/details?id=com.speaktoit.assistant&hl=en
[MDA II, XDA II, 2060 Accessories] bananas:
Hi All,

I recently purchsed a NAVMAN 4400 GPS. I've managed to get the thing paired but can't connect to a serial port. Bluetooth tools gives me a choice of com ports 2, 4 & 7, but those port choices are missing in the NAVMAN software. All other ports are shown (1, 3, 5, 6, 8 & 9).

I can only get the thing connect with all ports showing using "bluetoothgps" software (don't know who wrote it - it was linked from another forum). This software is a bit buggy and pops up an error every time the imate screen goes blank.

Any ideas?
[MDA II, XDA II, 2060 Accessories] dts:
I had the same problem. Try deleting the bond with the Navman and then setting the comm port to 4 in the Navman software. Then bond with Navman gps again and you should be able to select com 4.

It worked fo me!
[Galaxy S 4 General] SmilerOnline:
So we know that the GS4 will have several new sensors which you can see in the image below from SamMobile.

But other than Samsungs own apps (ie: S Health) what could you imagine these new sensors could be used for?.

The Air Gesture sensor may be useful to app developers that want to do more with less space, so instead of having one button with one function, that button could have three functions by using 'Air Gesture' and 'Long Press' for additional functions.

And probably not a good example but maybe we'll see some apps that could use the Proximity and temperature sensors to detect if your device is by your ear, face down on the table or in your pocket and adjust some settings as required.

Image Link: http://www.sammobile.com/wp-content/uploads/2013/04/HIDDENS4.jpg
[Galaxy S 4 General] Dannyada1988:
I think some people will do the amazing things with these sensors. But for me, it is just complex, I just want to wait for the amazing performance.
[Windows Phone 8 General] tboy2000:
I have a 16gb Samsung Ativ S.

Like most people I was curious about the newly launched Modern Combat game. It is over 1gig to download but that is fine, I had over 2gigs of free storage space. Except I could not download it as I got a low storage error. No problem I say, I will just delete some games and reinstall them after I tried the trial.

So I delete a game. Not enough. I delete another. Still not enough. Then I delete the largest sized game I have: Asphalt 7. Still not enough. Now I am getting angry because I have to start sacrificing my game progress and saves by deleting games just to try a flipping new game. Which do I delete? Which do I keep? Decisions decisions. I downloaded way too much. I then didn't want to delete anymore games so I had to start deleting apps. Here maps with downloaded map. Audiocloud app and saved songs. In the end when I had 5.11 gigs of free storage would it allow me to download and install the Modern Combat game. When it did install I checked phone storage and it said I had 2.45gigs left. So the 1gig download takes up 2.66 gigs of storage space and yet I had to have over 5gigs free to download? What the hec!!!

Some points...

I know games need additional space to unpack its compressed file but needing over 2gigs of additional space is just wrong.

I don't know who to blame.. the developers for making such games with HUGE storage requirements or blame Microsoft for low storage phones and storage allocation system.

Don't get me wrong. I have nothing against the game. It looks and seems great and of course I would want plenty of games like this but if you are telling me I need to delete apps to gain over 5gigs of storage to install a 2.66 gig game, that is not on. God forbid I want to install and buy Modern Combat, Batman, Asphalt 7 and Real Football - they would probably be the only games I could fit in my phone (excluding apps). Also good luck if you have an 8gig phone.

Also the famous 'Other Storage' fiasco doesn't help where it is 6gigs on my phone. What the hec!!! I am being polite :)

I really think all phones should have minimum 32gig storage if this is the way games are headed. If only we could install games and apps to microSD - it would solve all problems. I am not a big music hoarder or photo hoarder as most my photos are on the cloud so I have a 16gig microSD card in my phone with a lot of valuable user space that I cant have apps on. What use is that Microsoft? Microsoft is pushing/suggesting we store photos/music and video on the cloud (Skydrive), then what is the point of having external microSD storage supporting media files only? Give us options Microsoft.

Anyway, rant over. I will go back to playing Modern Combat trial, deleting it and reinstalling my games back and playing them from the very beginning. Again! I cant buy the game because that means I cant play my other games because they would have to be deleted. £5.49 sale lost. Actually £10.98 sale lost because I want Batman game too!

What joy!

:)
[Windows Phone 8 General] mcosmin222:
You need approximately 2.5 times the size of the file you download, because during install, you have the downloaded copy of the installation zip, and the decompressed copy, both existing at the same time. Considering the thing you download from the marketplace is somewhat compressed, you need much more space than what you download.

After full decompression, the compressed zip is deleted. Keep in mind that the size on the marketplace is the size of the download which does not always match the actual size of the game.
[Windows Phone 8 General] tboy2000:
Thanks I am aware that the size quoted in marketplace is the size of the compressed file. I think Microsoft should make it mandatory to include the required space to download the file also. Eg over 5gigs for Modern Combat. This way we can make an informed decision of what we delete if any if we choose to download it.
[Windows Phone 8 General] mcosmin222:
I do not believe they measure the space as a requirement. They do, however, have issues if the game is too big for devices that should support the game as far as RAM and CPU are concerned.
[Windows Phone 8 General] StevieBallz:
One trick you could try though is to download the Game's XAP from the Online Marketplace at www.windowsphone.com. You then copy the downloaded file over to the SD card. It takes up to 10 minutes before the Store on the phone discovers the XAP-file. You can then choose to install the downloaded XAP from the SD card to internal memory. This should help you reduce the space requirement during installation by at least the amount the downloaded XAP file occupys.

For a better manual on how to install downloaded XAPs you'll have to do a Google search. I have a Lumia 920 which doesn't have a SD card slot and had to type this up from memory.

Hope it helps.