Skip to content

Commit

Permalink
Merge Master Changes with Branch
Browse files Browse the repository at this point in the history
  • Loading branch information
palmer-matthew committed Aug 30, 2020
2 parents fd46d6c + d1359df commit 4384f3d
Show file tree
Hide file tree
Showing 73 changed files with 1,481 additions and 479 deletions.
6 changes: 6 additions & 0 deletions android/app/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-14/" />
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer" />
<classpathentry kind="output" path="bin/default" />
</classpath>
23 changes: 23 additions & 0 deletions android/app/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment>Project app created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
2 changes: 2 additions & 0 deletions android/app/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connection.project.dir=..
eclipse.preferences.version=1
12 changes: 10 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28
compileSdkVersion 29

lintOptions {
disable 'InvalidPackage'
Expand All @@ -35,7 +35,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.fst_app_flutter"
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -47,6 +47,14 @@ android {
signingConfig signingConfigs.debug
}
}
buildToolsVersion '30.0.2'
}

dependencies {
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0'
implementation 'com.google.maps.android:android-maps-utils:2.0.3'
}

flutter {
Expand Down
99 changes: 66 additions & 33 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,63 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http:https://schemas.android.com/apk/res/android"
package="com.example.fst_app_flutter">

<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the "MyLocation" functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
<!--
io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->

FlutterApplication and put your custom class here.
-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />

<application
android:name="io.flutter.app.FlutterApplication"
android:label="fst_app_flutter"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_launcher"
android:label="fst_app_flutter">

<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->


<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as

<!--
Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
to determine the Window background behind the Flutter UI.
-->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />
<!--
Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
Flutter's first frame.
-->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />

<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<!--
Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java
-->
<meta-data
android:name="flutterEmbedding"
android:value="2" />

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>


<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyAwJJ4MCCEkmpR7AI7QlJxdtPwcQlHAu5k"/>
</application>
</manifest>

</manifest>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.example.fst_app_flutter;/*
Dart Java Kotlin Obj-C Swift
null null null nil (NSNull when nested) nil
bool java.lang.Boolean Boolean NSNumber numberWithBool: NSNumber(value: Bool)
int java.lang.Integer Int NSNumber numberWithInt: NSNumber(value: Int32)
int, 64 java.lang.Long Long NSNumber numberWithLong: NSNumber(value: Int)
double java.lang.Double Double NSNumber numberWithDouble: NSNumber(value: Double)
String java.lang.String String NSString String
Uint8List byte[] ByteArray FlutterStandardTypedData typedDataWithBytes: FlutterStandardTypedData(bytes: Data)
Int32List int[] IntArray FlutterStandardTypedData typedDataWithInt32: FlutterStandardTypedData(int32: Data)
Int64List long[] LongArray FlutterStandardTypedData typedDataWithInt64: FlutterStandardTypedData(int64: Data)
Float64List double[] DoubleArray FlutterStandardTypedData typedDataWithFloat64: FlutterStandardTypedData(float64: Data)
List java.util.ArrayList List NSArray Array
Map java.util.HashMap HashMap NSDictionary Dictionary
*/

import androidx.annotation.NonNull;

import com.example.fst_app_flutter.contact.NativeContact;

import java.util.HashMap;

import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugin.common.MethodChannel;

@SuppressWarnings("unchecked")
public class MainActivity extends FlutterActivity {
private static final String CHANNEL = "com.example.fst_app_flutter/native";

@Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
super.configureFlutterEngine(flutterEngine);
new MethodChannel(flutterEngine.getDartExecutor().getBinaryMessenger(), CHANNEL)
.setMethodCallHandler((call, result) -> {
if ("saveNatively".equals(call.method)) {
try {
NativeContact contact = new NativeContact((HashMap<String, Object>) call.arguments);
contact.saveNatively(this);
} catch (Exception e) {
//System.out.println(e.getMessage());
}
} else {
result.notImplemented();
}
});
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.example.fst_app_flutter;
package com.example.fst_app_flutter.contact;


import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.provider.ContactsContract;
import android.util.Log;

import java.util.ArrayList;
import java.util.HashMap;
Expand All @@ -29,7 +28,7 @@ public class NativeContact {
* @param map a Map object passed in from dart saveNatively method in
* * contact_model.dart
*/
NativeContact(HashMap<String, Object> map) {
public NativeContact(HashMap<String, Object> map) {
this.displayName = (String) map.get("displayName");
this.email = (String) map.get("email");
this.note = (String) map.get("note");
Expand All @@ -46,7 +45,7 @@ public class NativeContact {
}
}
} catch (Exception e) {
System.out.println(e.getMessage());
//System.out.println(e.getMessage());
}


Expand All @@ -59,10 +58,10 @@ public class NativeContact {
public void saveNatively(Context context) {
Intent intent = new Intent(ContactsContract.Intents.Insert.ACTION);

Log.d("flutter-plugin", displayName);
//Log.d("flutter-plugin", displayName);
ArrayList<ContentValues> dataList = new ArrayList<>();

Log.d("email", getEmail());
//Log.d("email", getEmail());
ContentValues row = new ContentValues();
row.put(ContactsContract.Data.MIMETYPE,
ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE);
Expand All @@ -73,7 +72,7 @@ public void saveNatively(Context context) {


for (NativeContactPhone phone : getPhones()) {
Log.d("phone", phone.getNumber());
//Log.d("phone", phone.getNumber());
row = new ContentValues();
row.put(ContactsContract.Data.MIMETYPE,
ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
Expand All @@ -82,7 +81,7 @@ public void saveNatively(Context context) {
dataList.add(row);
}

Log.d("website", getWebsite());
//Log.d("website", getWebsite());
row = new ContentValues();
row.put(ContactsContract.Data.MIMETYPE,
ContactsContract.CommonDataKinds.Website.CONTENT_ITEM_TYPE);
Expand Down Expand Up @@ -153,7 +152,7 @@ public ArrayList<NativeContactPhone> getPhones() {
/**
* The class to manage phone numbers for NativeContact.
*/
private class NativeContactPhone {
private static class NativeContactPhone {

private int label;
private String number;
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jun 23 08:50:38 CEST 2017
#Thu Aug 27 02:35:07 EST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\:https://services.gradle.org/distributions/gradle-6.3-bin.zip
5 changes: 5 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source 'https://github.com/CocoaPods/Specs.git'
target 'Runner' do
use_frameworks!
pod 'GoogleMaps'
end
Loading

0 comments on commit 4384f3d

Please sign in to comment.