Skip to content

Commit f6491b9

Browse files
authored
update android example (#17581)
1 parent 212e454 commit f6491b9

File tree

13 files changed

+110
-129
lines changed

13 files changed

+110
-129
lines changed

packages/firebase_ai/firebase_ai/example/.metadata

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3"
8-
channel: "stable"
7+
revision: "2615ab6c1932e44e6802aaba8dc715b387ff155f"
8+
channel: "main"
99

1010
project_type: app
1111

1212
# Tracks metadata for the flutter migrate command
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
17-
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
18-
- platform: web
19-
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
20-
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
16+
create_revision: 2615ab6c1932e44e6802aaba8dc715b387ff155f
17+
base_revision: 2615ab6c1932e44e6802aaba8dc715b387ff155f
18+
- platform: android
19+
create_revision: 2615ab6c1932e44e6802aaba8dc715b387ff155f
20+
base_revision: 2615ab6c1932e44e6802aaba8dc715b387ff155f
2121

2222
# User provided section
2323

packages/firebase_ai/firebase_ai/example/android/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ gradle-wrapper.jar
55
/gradlew.bat
66
/local.properties
77
GeneratedPluginRegistrant.java
8+
.cxx/
89

910
# Remember to never publicly share your keystore.
10-
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
# See https://flutter.dev/to/reference-keystore
1112
key.properties
1213
**/*.keystore
1314
**/*.jks

packages/firebase_ai/firebase_ai/example/android/app/build.gradle

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
plugins {
2+
id("com.android.application")
3+
id("kotlin-android")
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id("dev.flutter.flutter-gradle-plugin")
6+
}
7+
8+
android {
9+
namespace = "com.example.firebase_ai_example"
10+
compileSdk = flutter.compileSdkVersion
11+
ndkVersion = flutter.ndkVersion
12+
13+
compileOptions {
14+
sourceCompatibility = JavaVersion.VERSION_11
15+
targetCompatibility = JavaVersion.VERSION_11
16+
}
17+
18+
kotlinOptions {
19+
jvmTarget = JavaVersion.VERSION_11.toString()
20+
}
21+
22+
defaultConfig {
23+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
24+
applicationId = "com.example.firebase_ai_example"
25+
// You can update the following values to match your application needs.
26+
// For more information, see: https://flutter.dev/to/review-gradle-config.
27+
minSdk = flutter.minSdkVersion
28+
targetSdk = flutter.targetSdkVersion
29+
versionCode = flutter.versionCode
30+
versionName = flutter.versionName
31+
}
32+
33+
buildTypes {
34+
release {
35+
// TODO: Add your own signing config for the release build.
36+
// Signing with the debug keys for now, so `flutter run --release` works.
37+
signingConfig = signingConfigs.getByName("debug")
38+
}
39+
}
40+
}
41+
42+
flutter {
43+
source = "../.."
44+
}

packages/firebase_ai/firebase_ai/example/android/app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
22
<application
3-
android:label="example"
3+
android:label="firebase_ai_example"
44
android:name="${applicationName}"
5-
android:icon="@mipmap/ic_launcher"
6-
android:usesCleartextTraffic="true">
5+
android:icon="@mipmap/ic_launcher">
76
<activity
87
android:name=".MainActivity"
98
android:exported="true"
109
android:launchMode="singleTop"
10+
android:taskAffinity=""
1111
android:theme="@style/LaunchTheme"
1212
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1313
android:hardwareAccelerated="true"
@@ -32,7 +32,7 @@
3232
android:value="2" />
3333
</application>
3434
<!-- Required to query activities that can process text, see:
35-
https://developer.android.com/training/package-visibility?hl=en and
35+
https://developer.android.com/training/package-visibility and
3636
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
3737
3838
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
@@ -42,9 +42,4 @@
4242
<data android:mimeType="text/plain"/>
4343
</intent>
4444
</queries>
45-
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
46-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
47-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
48-
<uses-permission android:name="android.permission.INTERNET" />
49-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
5045
</manifest>

packages/firebase_ai/firebase_ai/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt

Lines changed: 0 additions & 5 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.example.firebase_ai_example
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity : FlutterActivity()

packages/firebase_ai/firebase_ai/example/android/build.gradle

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
allprojects {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
}
6+
}
7+
8+
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
9+
rootProject.layout.buildDirectory.value(newBuildDir)
10+
11+
subprojects {
12+
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
13+
project.layout.buildDirectory.value(newSubprojectBuildDir)
14+
}
15+
subprojects {
16+
project.evaluationDependsOn(":app")
17+
}
18+
19+
tasks.register<Delete>("clean") {
20+
delete(rootProject.layout.buildDirectory)
21+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
org.gradle.jvmargs=-Xmx4G
1+
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true

0 commit comments

Comments
 (0)