Merge branch 'master' into newNemukemo
This commit is contained in:
commit
f3b18af5bd
|
@ -1,16 +1,19 @@
|
|||
plugins {
|
||||
id 'com.android.application'
|
||||
|
||||
id 'com.google.gms.google-services'
|
||||
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.oplogy'
|
||||
compileSdk 33
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.oplogy"
|
||||
minSdk 26
|
||||
targetSdk 33
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
|
@ -27,6 +30,9 @@ android {
|
|||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -35,6 +41,7 @@ dependencies {
|
|||
implementation 'com.google.android.material:material:1.5.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'com.google.firebase:firebase-firestore:24.4.1'
|
||||
implementation 'com.google.android.gms:play-services-maps:18.2.0'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
|
|
|
@ -12,6 +12,33 @@
|
|||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Oplogy"
|
||||
tools:targetApi="31">
|
||||
|
||||
<!--
|
||||
TODO: Before you run your application, you need a Google Maps API key.
|
||||
|
||||
To get one, follow the directions here:
|
||||
|
||||
https://developers.google.com/maps/documentation/android-sdk/get-api-key
|
||||
|
||||
Once you have your API key (it starts with "AIza"), define a new property in your
|
||||
project's local.properties file (e.g. MAPS_API_KEY=Aiza...), and replace the
|
||||
"YOUR_API_KEY" string in this file with "${MAPS_API_KEY}".
|
||||
-->
|
||||
<meta-data
|
||||
android:name="com.google.android.geo.API_KEY"
|
||||
android:value = "AIzaSyBQ1Ak-I2NL5TP4K59ZI0VgzKk6HNZuusw" />
|
||||
|
||||
<activity
|
||||
android:name=".MapsActivity"
|
||||
android:exported="true"
|
||||
android:label="@string/title_activity_maps">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
|
|
|
@ -3,7 +3,9 @@ package com.example.oplogy;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.annotation.SuppressLint;
|
||||
import androidd.os.Bunle;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
@ -30,11 +32,20 @@ public class MainActivity extends AppCompatActivity {
|
|||
private EditText time;
|
||||
private FirebaseFirestore db = FirebaseFirestore.getInstance();
|
||||
|
||||
|
||||
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
|
||||
|
||||
Button button;
|
||||
// TextView textView;
|
||||
EditText editText;
|
||||
@SuppressLint("MissingInflatedId")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
|
||||
textView=findViewById(R.id.showText);
|
||||
btnShow=findViewById(R.id.btnShow);
|
||||
btnAdd=findViewById(R.id.btnAdd);
|
||||
|
@ -81,6 +92,21 @@ public class MainActivity extends AppCompatActivity {
|
|||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
findViewById(R.id.mapmapcreate).setOnClickListener(
|
||||
view->{
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
class User {
|
||||
|
|
56
app/src/main/java/com/example/oplogy/MapsActivity.java
Normal file
56
app/src/main/java/com/example/oplogy/MapsActivity.java
Normal file
|
@ -0,0 +1,56 @@
|
|||
package com.example.oplogy;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.google.android.gms.maps.CameraUpdateFactory;
|
||||
import com.google.android.gms.maps.GoogleMap;
|
||||
import com.google.android.gms.maps.OnMapReadyCallback;
|
||||
import com.google.android.gms.maps.SupportMapFragment;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.android.gms.maps.model.MarkerOptions;
|
||||
import com.example.oplogy.databinding.ActivityMapsBinding;
|
||||
|
||||
public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
|
||||
|
||||
private GoogleMap mMap;
|
||||
private ActivityMapsBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
binding = ActivityMapsBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
|
||||
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
||||
.findFragmentById(R.id.map);
|
||||
mapFragment.getMapAsync(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Manipulates the map once available.
|
||||
* This callback is triggered when the map is ready to be used.
|
||||
* This is where we can add markers or lines, add listeners or move the camera. In this case,
|
||||
* we just add a marker near Sydney, Australia.
|
||||
* If Google Play services is not installed on the device, the user will be prompted to install
|
||||
* it inside the SupportMapFragment. This method will only be triggered once the user has
|
||||
* installed Google Play services and returned to the app.
|
||||
*/
|
||||
@Override
|
||||
public void onMapReady(GoogleMap googleMap) {
|
||||
mMap = googleMap;
|
||||
|
||||
// Add a marker in Sydney and move the camera
|
||||
/// 緯度経度
|
||||
LatLng loc = new LatLng(35.17260398479137, 136.88635173557998);
|
||||
/// マーカーオプションを設定(情報ウィンドウ)
|
||||
mMap.addMarker(new MarkerOptions().position(loc).title("トライデントコンピュータ専門学校"));
|
||||
/// 表示位置を地図に指定
|
||||
mMap.moveCamera(CameraUpdateFactory.newLatLng(loc));
|
||||
/// 地図の倍率を指定
|
||||
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(loc, 17));
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
tools:context=".MainActivity"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editNumber"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -46,5 +47,23 @@
|
|||
android:text="" />
|
||||
|
||||
|
||||
=======
|
||||
<Button
|
||||
android:id="@+id/mapmapcreate"
|
||||
android:text="マップ生成"
|
||||
android:textSize="50px"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/textview1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="100px"
|
||||
android:hint="ここだよ"
|
||||
android:text=""
|
||||
/>
|
||||
|
||||
|
||||
</LinearLayout>
|
9
app/src/main/res/layout/activity_maps.xml
Normal file
9
app/src/main/res/layout/activity_maps.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:map="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/map"
|
||||
android:name="com.google.android.gms.maps.SupportMapFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MapsActivity" />
|
|
@ -1,3 +1,4 @@
|
|||
<resources>
|
||||
<string name="app_name">oplogy</string>
|
||||
<string name="title_activity_maps">MapsActivity</string>
|
||||
</resources>
|
|
@ -6,4 +6,5 @@ buildscript {
|
|||
plugins {
|
||||
id 'com.android.application' version '8.0.2' apply false
|
||||
id 'com.android.library' version '8.0.2' apply false
|
||||
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false
|
||||
}
|
Loading…
Reference in New Issue
Block a user