HI ,
i want to check wether Airplane mode is on or not .. how to check that ?
thanks + how to check that the user is using WIFI or GPRS OR EDGE . how to di
For SDK 3.0
(http://bbs.51pda.cn/simple/?t4861.html)
#import unistd.h
#include dlfcn.h
#include stdio.h
typedef int (*airType)();
static int (*real_air)() = NULL;
int main(int argc, char **argv)
{
int status = 0;
void *libHandle = dlopen("/System/Library/PrivateFrameworks/CoreTelephony.framework/CoreTelephony", RTLD_LAZY);
real_air = (airType)dlsym(libHandle, "CTPowerGetAirplaneMode");
if(! real_air)
{
printf("something wrong");
}
else
{
status = real_air();
}
printf("%d",status);
return status;
}
debian:~# arm-apple-darwin9-gcc -lobjc -bind_at_load -F"/System/Library/PrivateFrameworks" -framework CoreTelephony test.c -o test