Click here to Skip to main content
15,881,139 members
Home / Discussions / Android
   

Android

 
QuestionRe: How would I get a apk android app that I gotten from google play to show popups when it has a alert? Pin
David Crow30-Oct-17 4:23
David Crow30-Oct-17 4:23 
AnswerRe: How would I get a apk android app that I gotten from google play to show popups when it has a alert? Pin
Doggirl330-Oct-17 5:37
Doggirl330-Oct-17 5:37 
QuestionQuery about swipe issue in expandable listview in android Pin
Jinal Patel26-Oct-17 23:20
Jinal Patel26-Oct-17 23:20 
QuestionRe: Query about swipe issue in expandable listview in android Pin
David Crow30-Oct-17 4:21
David Crow30-Oct-17 4:21 
Questionandroid speech to text application Pin
Oluawayemi26-Oct-17 15:29
Oluawayemi26-Oct-17 15:29 
AnswerRe: android speech to text application Pin
Richard MacCutchan26-Oct-17 22:10
mveRichard MacCutchan26-Oct-17 22:10 
GeneralRe: android speech to text application Pin
Oluawayemi30-Oct-17 15:16
Oluawayemi30-Oct-17 15:16 
QuestionWhy my Android application can't run. Pin
hmanhha20-Oct-17 6:57
hmanhha20-Oct-17 6:57 
I Use Android Studio to write my application using telephonymanager .
The manifest is here.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myapplication">
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_UPDATES"/>
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>



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;
case (TelephonyManager.PHONE_TYPE_GSM):
StrPhoneType ="GSM Phone";
break;
case (TelephonyManager.PHONE_TYPE_NONE):
StrPhoneType ="NONE";
break;
}
boolean isRoaming =TM.isNetworkRoaming();
String info = "Phone Detail";
info+= "\n IMEI Number"+ IMEI;
info+= "\n Sub Number"+ SubcriberNumber;
info+= "\n ISO Number"+ ISO;
info+= "\n Operator "+ Operator;
info+= "\n SIM Operator Name " + SimoperatorName;
//info+= "\n Phone type " + StrPhoneType;
info+= "\n Is Roamming " + isRoaming;
tv.setText(info);




}
}


But the App can't run.
Please help
AnswerRe: Why my Android application can't run. Pin
David Crow22-Oct-17 17:07
David Crow22-Oct-17 17:07 
SuggestionRe: Need help with optimisation Pin
David Crow6-Oct-17 3:13
David Crow6-Oct-17 3:13 
Questionhow to write POST methdod to PHP Pin
sadaiyappan_5-Oct-17 23:42
sadaiyappan_5-Oct-17 23:42 
QuestionRe: how to write POST methdod to PHP Pin
Richard MacCutchan6-Oct-17 1:11
mveRichard MacCutchan6-Oct-17 1:11 
AnswerRe: how to write POST methdod to PHP Pin
sadaiyappan_6-Oct-17 18:54
sadaiyappan_6-Oct-17 18:54 
GeneralRe: how to write POST methdod to PHP Pin
Richard MacCutchan6-Oct-17 22:02
mveRichard MacCutchan6-Oct-17 22:02 
GeneralRe: how to write POST methdod to PHP Pin
sadaiyappan_6-Oct-17 22:05
sadaiyappan_6-Oct-17 22:05 
GeneralRe: how to write POST methdod to PHP Pin
Richard MacCutchan6-Oct-17 22:13
mveRichard MacCutchan6-Oct-17 22:13 
QuestionRe: how to write POST methdod to PHP Pin
David Crow7-Oct-17 14:45
David Crow7-Oct-17 14:45 
QuestionShow a ProgressDialog inside a Fragment that is injected in a Tab Pin
Vimalsoft(Pty) Ltd30-Sep-17 5:54
professionalVimalsoft(Pty) Ltd30-Sep-17 5:54 
QuestionRe: Show a ProgressDialog inside a Fragment that is injected in a Tab Pin
David Crow2-Oct-17 3:09
David Crow2-Oct-17 3:09 
AnswerRe: Show a ProgressDialog inside a Fragment that is injected in a Tab Pin
Vimalsoft(Pty) Ltd2-Oct-17 7:11
professionalVimalsoft(Pty) Ltd2-Oct-17 7:11 
QuestionRe: Show a ProgressDialog inside a Fragment that is injected in a Tab Pin
David Crow2-Oct-17 7:14
David Crow2-Oct-17 7:14 
AnswerRe: Show a ProgressDialog inside a Fragment that is injected in a Tab Pin
Vimalsoft(Pty) Ltd2-Oct-17 7:25
professionalVimalsoft(Pty) Ltd2-Oct-17 7:25 
QuestionRe: Show a ProgressDialog inside a Fragment that is injected in a Tab Pin
David Crow2-Oct-17 7:30
David Crow2-Oct-17 7:30 
AnswerRe: Show a ProgressDialog inside a Fragment that is injected in a Tab Pin
Vimalsoft(Pty) Ltd2-Oct-17 7:37
professionalVimalsoft(Pty) Ltd2-Oct-17 7:37 
QuestionTiming and fragment creation Pin
David Crow29-Sep-17 7:44
David Crow29-Sep-17 7:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.