mirror of
https://github.com/hackku21/nearby_connections.git
synced 2026-03-02 03:49:22 +00:00
updated nearby to version 17.0.0, added location enabling and checking utility method, version 1.1.0 published
This commit is contained in:
17
example/android/.project
Normal file
17
example/android/.project
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>android</name>
|
||||
<comment>Project android_ created by Buildship.</comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
13
example/android/.settings/org.eclipse.buildship.core.prefs
Normal file
13
example/android/.settings/org.eclipse.buildship.core.prefs
Normal file
@@ -0,0 +1,13 @@
|
||||
arguments=
|
||||
auto.sync=false
|
||||
build.scans.enabled=false
|
||||
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
|
||||
connection.project.dir=
|
||||
eclipse.preferences.version=1
|
||||
gradle.user.home=
|
||||
java.home=/usr/lib/jvm/java-11-openjdk-amd64
|
||||
jvm.arguments=
|
||||
offline.mode=false
|
||||
override.workspace.settings=true
|
||||
show.console.view=true
|
||||
show.executions.view=true
|
||||
6
example/android/app/.classpath
Normal file
6
example/android/app/.classpath
Normal file
@@ -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-11/"/>
|
||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
||||
<classpathentry kind="output" path="bin/default"/>
|
||||
</classpath>
|
||||
23
example/android/app/.project
Normal file
23
example/android/app/.project
Normal file
@@ -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>
|
||||
@@ -0,0 +1,2 @@
|
||||
connection.project.dir=..
|
||||
eclipse.preferences.version=1
|
||||
@@ -1,3 +1,4 @@
|
||||
android.enableJetifier=true
|
||||
android.useAndroidX=true
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
android.enableR8=true
|
||||
|
||||
@@ -68,8 +68,8 @@ class _MyBodyState extends State<Body> {
|
||||
),
|
||||
RaisedButton(
|
||||
child: Text("askLocationPermission"),
|
||||
onPressed: () async {
|
||||
await Nearby().askLocationPermission();
|
||||
onPressed: () {
|
||||
Nearby().askLocationPermission();
|
||||
},
|
||||
),
|
||||
RaisedButton(
|
||||
@@ -88,8 +88,34 @@ class _MyBodyState extends State<Body> {
|
||||
),
|
||||
RaisedButton(
|
||||
child: Text("askExternalStoragePermission"),
|
||||
onPressed: () {
|
||||
Nearby().askExternalStoragePermission();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(),
|
||||
Text("Location Enabled"),
|
||||
Wrap(
|
||||
children: <Widget>[
|
||||
RaisedButton(
|
||||
child: Text("checkLocationEnabled"),
|
||||
onPressed: () async {
|
||||
await Nearby().askExternalStoragePermission();
|
||||
if (await Nearby().checkLocationEnabled()) {
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content:
|
||||
Text("Location is ON :)")));
|
||||
} else {
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
"Location is OFF :(")));
|
||||
}
|
||||
},
|
||||
),
|
||||
RaisedButton(
|
||||
child: Text("enableLocationServices"),
|
||||
onPressed: () {
|
||||
Nearby().enableLocationServices();
|
||||
},
|
||||
),
|
||||
],
|
||||
@@ -113,7 +139,7 @@ class _MyBodyState extends State<Body> {
|
||||
showSnackbar("Disconnected: " + id);
|
||||
},
|
||||
);
|
||||
showSnackbar("ADVERTISING: "+a.toString());
|
||||
showSnackbar("ADVERTISING: " + a.toString());
|
||||
} catch (exception) {
|
||||
showSnackbar(exception);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ packages:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "1.0.3"
|
||||
version: "1.1.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user