Why my Android application can't run.
-
I Use Android Studio to write my application using telephonymanager . The manifest is here.
I have remember to add permission. And The Main Activity Java code is here package com.example.myapplication; import android.content.Context; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.telephony.TelephonyManager; import android.widget.TextView; public class MainActivity extends AppCompatActivity { TextView tv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tv=(TextView)findViewById(R.id.tv); TelephonyManager TM =(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); String IMEI= TM.getDeviceId(); String SubcriberNumber = TM.getLine1Number(); String ISO = TM.getSimCountryIso(); String Operator = TM.getNetworkOperator(); String SimoperatorName = TM.getSimOperatorName(); int Phone=TM.getPhoneType(); String StrPhoneType; switch (Phone) { case (TelephonyManager.PHONE_TYPE_CDMA): StrPhoneType ="CDMA Phone"; break; cas
-
I Use Android Studio to write my application using telephonymanager . The manifest is here.
I have remember to add permission. And The Main Activity Java code is here package com.example.myapplication; import android.content.Context; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.telephony.TelephonyManager; import android.widget.TextView; public class MainActivity extends AppCompatActivity { TextView tv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tv=(TextView)findViewById(R.id.tv); TelephonyManager TM =(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); String IMEI= TM.getDeviceId(); String SubcriberNumber = TM.getLine1Number(); String ISO = TM.getSimCountryIso(); String Operator = TM.getNetworkOperator(); String SimoperatorName = TM.getSimOperatorName(); int Phone=TM.getPhoneType(); String StrPhoneType; switch (Phone) { case (TelephonyManager.PHONE_TYPE_CDMA): StrPhoneType ="CDMA Phone"; break; cas
hmanhha wrote:
But the App can't run. Please help
Sorry, no can do. We do not understand what "can't run" means. If you took your car to a mechanic, do you really think he'd be able to fix your car if you simply said "it can't run?" If you called your HVAC technician and said "my heater can't run," do you really think he'd be able to fix it? You're going to need to offer a detailed explanation of what is happening.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles