質問編集履歴

7

タイトルの修正

2019/12/26 12:22

投稿

SyuheiFujita
SyuheiFujita

スコア18

test CHANGED
@@ -1 +1 @@
1
- Androidアプリ開発で,GPSのパーミッション承認のリクエストを送る処理をする際のエラーを解消したい!
1
+ Androidアプリで,GPSのパーミッション承認のリクエストを送たい!
test CHANGED
File without changes

6

タイトルの修正

2019/12/26 12:22

投稿

SyuheiFujita
SyuheiFujita

スコア18

test CHANGED
@@ -1 +1 @@
1
- GPSを使って位置データを取得して,GoogleMapに表示させるAndroidアプリを作りたい!
1
+ Androidアプリ開発で,GPSのパーミッション承認のリクエスト送る処理をする際のエラーを解消したい!
test CHANGED
@@ -1,5 +1,9 @@
1
1
  Androidアプリ開発についての質問です!
2
2
 
3
+ 現在,GPSを使って位置データを取得して,GoogleMapに表示させるAndroidアプリを作りたい!と思っています.
4
+
5
+
6
+
3
7
  GPSのパーミッションを承認するリクエストを送る処理をする際にエラーが出てしまうのですが(おそらく),方針としては以下のようなコードであっていますでしょうか?
4
8
 
5
9
  よろしければご教授していただきたいです!

5

コメント修正

2019/12/25 13:54

投稿

SyuheiFujita
SyuheiFujita

スコア18

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,6 @@
1
1
  Androidアプリ開発についての質問です!
2
2
 
3
- GPSのパーミッションを承認するリクエストを送る際にエラーが出てしまうのですが,方針としては以下のようなコードであっていますでしょうか?
3
+ GPSのパーミッションを承認するリクエストを送る処理をする際にエラーが出てしまうのですが(おそらく),方針としては以下のようなコードであっていますでしょうか?
4
4
 
5
5
  よろしければご教授していただきたいです!
6
6
 

4

タイトル修正

2019/12/25 08:40

投稿

SyuheiFujita
SyuheiFujita

スコア18

test CHANGED
@@ -1 +1 @@
1
- GPSを使って位置データを取得してGoogleMapに表示させるAndroidアプリを作りたい!
1
+ GPSを使って位置データを取得してGoogleMapに表示させるAndroidアプリを作りたい!
test CHANGED
File without changes

3

追加情報

2019/12/25 02:43

投稿

SyuheiFujita
SyuheiFujita

スコア18

test CHANGED
File without changes
test CHANGED
@@ -220,6 +220,110 @@
220
220
 
221
221
 
222
222
 
223
+ ```AndroidManifest
224
+
225
+ <?xml version="1.0" encoding="utf-8"?>
226
+
227
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
228
+
229
+ package="com.example.googlemap_gps_location_android">
230
+
231
+ <!--
232
+
233
+ The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
234
+
235
+ Google Maps Android API v2, but you must specify either coarse or fine
236
+
237
+ location permissions for the 'MyLocation' functionality.
238
+
239
+ -->
240
+
241
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
242
+
243
+
244
+
245
+ <uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION" />
246
+
247
+
248
+
249
+ <application
250
+
251
+ android:allowBackup="true"
252
+
253
+ android:icon="@mipmap/ic_launcher"
254
+
255
+ android:label="@string/app_name"
256
+
257
+ android:roundIcon="@mipmap/ic_launcher_round"
258
+
259
+ android:supportsRtl="true"
260
+
261
+ android:theme="@style/AppTheme">
262
+
263
+ <activity
264
+
265
+ android:name=".MainActivity"
266
+
267
+ android:label="@string/title_activity_main"
268
+
269
+ android:theme="@style/AppTheme.NoActionBar">
270
+
271
+
272
+
273
+ </activity>
274
+
275
+ <!--
276
+
277
+ The API key for Google Maps-based APIs is defined as a string resource.
278
+
279
+ (See the file "res/values/google_maps_api.xml").
280
+
281
+ Note that the API key is linked to the encryption key used to sign the APK.
282
+
283
+ You need a different API key for each encryption key, including the release key that is used to
284
+
285
+ sign the APK for publishing.
286
+
287
+ You can define the keys for the debug and release targets in src/debug/ and src/release/.
288
+
289
+ -->
290
+
291
+ <meta-data
292
+
293
+ android:name="com.google.android.geo.API_KEY"
294
+
295
+ android:value="@string/google_maps_key" />
296
+
297
+
298
+
299
+ <activity
300
+
301
+ android:name=".MapsActivity"
302
+
303
+ android:label="GoogleMap-GPS-Location">
304
+
305
+ <intent-filter>
306
+
307
+ <action android:name="android.intent.action.MAIN" />
308
+
309
+
310
+
311
+ <category android:name="android.intent.category.LAUNCHER" />
312
+
313
+ </intent-filter>
314
+
315
+ </activity>
316
+
317
+ </application>
318
+
319
+
320
+
321
+ </manifest>
322
+
323
+ ```
324
+
325
+
326
+
223
327
  ```error
224
328
 
225
329
  2019-12-25 11:17:44.033 23317-23317/com.example.googlemap_gps_location_android E/AndroidRuntime: FATAL EXCEPTION: main

2

追加情報

2019/12/25 02:31

投稿

SyuheiFujita
SyuheiFujita

スコア18

test CHANGED
File without changes
test CHANGED
@@ -273,3 +273,11 @@
273
273
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
274
274
 
275
275
  ```
276
+
277
+
278
+
279
+
280
+
281
+ ※ちなみに,手動でパーミッションを承認すると正常に動作することが確認できています
282
+
283
+ ![イメージ説明](94bdf905f847bfdc66d55e3fdf985ef7.png) ![イメージ説明](605858f5686e3ad1a40f8f931ef823a0.png)

1

タイトルの変更

2019/12/25 02:29

投稿

SyuheiFujita
SyuheiFujita

スコア18

test CHANGED
@@ -1 +1 @@
1
- GPSを使って位置データを取得してGoogleMapに表示させたい!
1
+ GPSを使って位置データを取得してGoogleMapに表示させるAndroidアプリを作りたい!
test CHANGED
@@ -1,3 +1,5 @@
1
+ Androidアプリ開発についての質問です!
2
+
1
3
  GPSのパーミッションを承認するリクエストを送る際にエラーが出てしまうのですが,方針としては以下のようなコードであっていますでしょうか?
2
4
 
3
5
  よろしければご教授していただきたいです!