[Android Software/Hacking General [Developers Only]] LauCass:
After a lot of search to find a solution to enable/disable the data connection without modifying the APN configuration, I finally found a solution that I would like to share with developers that are looking for the same thing.

I known that some applications (as Quick Settings) are able to do this but I was not able to find a solution on the web. Because I really wanted to have this feature in my AndroMax application, I searched how it is managed in the Android OS source code.

I quickly discovered that it's not possible to modifiy the connection state using the same API than what is used in the Android phone settings application because the necessary permission can only be obtained by a system application. After more investigation in Android source code, I discovered that it's possible to change the connection state with the ITelephony interface, using a permission that can be obtained by a standard application.

This solution is not working with Gingerbread due to security reenforcement, if anybody have a solution for Gingerbread, I buy it ;)

Here is this solution:

import java.lang.reflect.Method;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;

// Needs the following permissions:
// - "android.permission.MODIFY_PHONE_STATE"

public final class DataConManager
{
private TelephonyManager m_telManager = null;
private ConnectivityManager m_conManager = null;

// ------------------------------------------------------
// ------------------------------------------------------
public DataConManager(Context context)
{
try
{
// Get phone and connectivity services
m_telManager = (TelephonyManager)context.getSystemService("phone");
m_conManager = (ConnectivityManager)context.getSystemService("connectivity");
}
catch (Exception e)
{
m_telManager = null;
m_conManager = null;
}
}

// ------------------------------------------------------
// ------------------------------------------------------
boolean switchState(boolean enable)
{
boolean bRes = false;

// Data Connection mode (only if correctly initialized)
if (m_telManager != null)
{
try
{
// Will be used to invoke hidden methods with reflection
Class cTelMan = null;
Method getITelephony = null;
Object oTelephony = null;
Class cTelephony = null;
Method action = null;

// Get the current object implementing ITelephony interface
cTelMan = m_telManager.getClass();
getITelephony = cTelMan.getDeclaredMethod("getITelephony");
getITelephony.setAccessible(true);
oTelephony = getITelephony.invoke(m_telManager);

// Call the enableDataConnectivity/disableDataConnectivity method
// of Telephony object
cTelephony = oTelephony.getClass();
if (enable)
{
action = cTelephony.getMethod("enableDataConnectivity");
}
else
{
action = cTelephony.getMethod("disableDataConnectivity");
}
action.setAccessible(true);
bRes = (Boolean)action.invoke(oTelephony);
}
catch (Exception e)
{
bRes = false;
}
}

return bRes;
}

// ------------------------------------------------------
// ------------------------------------------------------
public boolean isEnabled()
{
boolean bRes = false;

// Data Connection mode (only if correctly initialized)
if (m_conManager != null)
{
try
{
// Get Connectivity Service state
NetworkInfo netInfo = m_conManager.getNetworkInfo(0);

// Data is enabled if state is CONNECTED
bRes = (netInfo.getState() == NetworkInfo.State.CONNECTED);
}
catch (Exception e)
{
bRes = false;
}
}

return bRes;
}
}