i just tryed to set up my first app with Android studio (used eclipser before) and I'm already lost.
Tryed to get signal strength in Button click handler:
TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
CellInfoGsm GSM = (CellInfoGsm)telephonyManager.getAllCellInfo().get(0);
CellSignalStrengthGsm cellSignalStrengthGsm = GSM.getCellSignalStrength();
int signalStrength = cellSignalStrengthGsm.getDbm();
Log.v(TAG, "signalStrength:" + signalStrength);
Manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.kiel.fh......" >
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
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>
Error:
FATAL EXCEPTION: main 10-23 16:01:23.853 12060-12060/de........ E/AndroidRuntime: Process: de........, PID: 12060 10-23 16:01:23.853 12060-12060/de............ E/AndroidRuntime: java.lang.SecurityException: getAllCellInfo: Neither user 10059 nor current process has android.permission.ACCESS_COARSE_LOCATION