Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Android
  4. Why my Android application can't run.

Why my Android application can't run.

Scheduled Pinned Locked Moved Android
androidjavacomtutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hmanhha
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • H hmanhha

      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

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups