After my many Unsuccessful attempts to make Telephony Manager extension I Request Koders to make a Telephony Extension. This is Android developer guide telephony Edit by Mod: Don’t tag users in your first post to get attention…
My code :`import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.IntentFilter;
import android.telephony.TelephonyManager;
import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
import com.google.appinventor.components.annotations.;
import com.google.appinventor.components.runtime.;
import com.google.appinventor.components.common.*;
@DesignerComponent(category = ComponentCategory.EXTENSION, nonVisible = true, version = 14)
@SimpleObject(external = true)
public class make extends AndroidNonvisibleComponent {
public static final int VERSION = 14;
private static TelephonyManager tm;
private final Activity activity;
private ComponentContainer container;
private Context context;
public make(ComponentContainer paramComponentContainer) {
super(paramComponentContainer.$form());
if (this.form instanceof com.google.appinventor.components.runtime.ReplForm)
this.isRepl = true;
this.container = paramComponentContainer;
this.context = (Context)paramComponentContainer.$context();
this.activity = paramComponentContainer.$context();
tm = (TelephonyManager)this.context.getSystemService(“TELEPHONY_SERVICE”);
}
@SimpleFunction(description = “get sim counrty id”)
public String Getsimcountry(){
String CountryID="";
CountryID= tm.getSimCountryIso().toUpperCase();
return CountryID;
}
}`