android fixes

pull/3/head
Haroon Amjad 2 months ago
parent 670feb55af
commit 30fd99d122

@ -1,46 +1,188 @@
import java.util.Properties
import java.io.FileInputStream
plugins { plugins {
id("com.android.application") id("com.android.application")
id("kotlin-android") id("kotlin-android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("com.google.gms.google-services") version "4.4.1" // Add the version here
id("dev.flutter.flutter-gradle-plugin") id("dev.flutter.flutter-gradle-plugin")
id("com.google.gms.google-services")
id("com.huawei.agconnect") id("com.huawei.agconnect")
// id("com.mapbox.gradle.application")
// id("com.mapbox.gradle.plugins.ndk")
} }
android { val keystoreProperties = Properties()
namespace = "com.ejada.hmg.hmg_patient_app_new" val keystorePropertiesFile = rootProject.file("key.properties")
compileSdk = flutter.compileSdkVersion if (keystorePropertiesFile.exists()) {
ndkVersion = flutter.ndkVersion keystoreProperties.load(FileInputStream(keystorePropertiesFile))
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
} }
kotlinOptions { android {
jvmTarget = JavaVersion.VERSION_11.toString() namespace = "com.ejada.hmg"
} compileSdk = 36
ndkVersion = "28.2.13676358"
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId = "com.ejada.hmg"
applicationId = "com.ejada.hmg.hmg_patient_app_new" // minSdk = 24
// You can update the following values to match your application needs. minSdk = 26
// For more information, see: https://flutter.dev/to/review-gradle-config. targetSdk = 35
minSdk = flutter.minSdkVersion compileSdk = 35
targetSdk = flutter.targetSdkVersion // targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode versionCode = flutter.versionCode
versionName = flutter.versionName versionName = flutter.versionName
multiDexEnabled = true
}
buildFeatures {
viewBinding = true
dataBinding = true
}
sourceSets {
// getByName("main") {
// java.srcDirs += "src/main/kotlin"
// jniLibs.srcDir("src/main/libs")
// jni.srcDirs = listOf() // disables automatic ndk-build
// }
getByName("main") {
java.srcDir("src/main/kotlin")
jniLibs.srcDir("src/main/libs")
// To disable automatic ndk-build, do not set jni.srcDirs
// If you need to clear jni.srcDirs:
// set("jni.srcDirs", emptyList<String>())
}
}
signingConfigs {
create("release") {
keyAlias = keystoreProperties.getProperty("keyAlias")
keyPassword = keystoreProperties.getProperty("keyPassword")
storeFile = keystoreProperties.getProperty("storeFile")?.let { file(it) }
storePassword = keystoreProperties.getProperty("storePassword")
}
} }
buildTypes { buildTypes {
release { getByName("debug") {
// TODO: Add your own signing config for the release build. isDebuggable = true
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.getByName("debug") signingConfig = signingConfigs.getByName("debug")
isMinifyEnabled = false
isShrinkResources = false
} }
getByName("release") {
isDebuggable = false
signingConfig = signingConfigs.getByName("release")
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
create("staging") {
matchingFallbacks += listOf("debug", "qa", "release")
}
}
packagingOptions {
jniLibs {
pickFirsts += listOf(
"lib/x86/libc++_shared.so",
"lib/x86_64/libc++_shared.so",
"lib/armeabi-v7a/libc++_shared.so",
"lib/arm64-v8a/libc++_shared.so",
"**/*.so"
)
useLegacyPackaging = true
}
resources {
excludes += listOf("META-INF/proguard/androidx-annotations.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
isCoreLibraryDesugaringEnabled = true
}
// kotlinOptions {
// jvmTarget = "17"
// }
lint {
disable += "MissingTranslation"
checkReleaseBuilds = false
} }
} }
flutter { flutter {
source = "../.." source = "../.."
} }
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.20")
implementation("com.google.firebase:firebase-messaging:24.1.2")
implementation("pub.devrel:easypermissions:3.0.0")
implementation("com.google.guava:guava:33.4.0-android")
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"), "exclude" to listOf("bcprov-jdk16-1.46.jar"))))
implementation("com.google.code.gson:gson:2.12.0")
// Zoom SDKs
implementation("us.zoom.videosdk:zoomvideosdk-core:1.12.10")
implementation("us.zoom.videosdk:zoomvideosdk-annotation:1.12.10")
implementation("us.zoom.videosdk:zoomvideosdk-videoeffects:1.12.10")
// Networking
implementation("com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.11")
implementation("com.squareup.okhttp3:okhttp:5.0.0-alpha.11")
implementation("com.squareup.retrofit2:retrofit:2.11.0")
implementation("com.squareup.retrofit2:converter-gson:2.11.0")
implementation("com.squareup.retrofit2:adapter-java8:2.11.0")
// Google Services
implementation("com.google.android.gms:play-services-location:21.3.0")
implementation("com.google.android.gms:play-services-basement:18.7.0")
implementation("com.android.volley:volley:1.2.1")
implementation("androidx.constraintlayout:constraintlayout:2.2.1")
implementation("androidx.navigation:navigation-fragment-ktx:2.9.0")
implementation("androidx.navigation:navigation-ui-ktx:2.9.0")
implementation("androidx.activity:activity-ktx:1.10.1")
// val room_version = "2.6.1"
// implementation("androidx.room:room-runtime:$room_version")
// annotationProcessor("androidx.room:room-compiler:$room_version")
implementation("net.zetetic:android-database-sqlcipher:4.5.4")
implementation("com.intuit.ssp:ssp-android:1.1.0")
implementation("com.intuit.sdp:sdp-android:1.1.0")
// implementation("com.github.bumptech.glide:glide:4.16.0")
// annotationProcessor("com.github.bumptech.glide:compiler:4.16.0")
implementation("com.mapbox.maps:android:11.5.0")
// implementation("com.mapbox.maps:android:11.4.0")
// AARs
// implementation(files("libs/PenNavUI.aar"))
// implementation(files("libs/Penguin.aar"))
// implementation(files("libs/PenguinRenderer.aar"))
implementation("com.github.kittinunf.fuel:fuel:2.3.1")
implementation("com.github.kittinunf.fuel:fuel-android:2.3.1")
// implementation("com.opentok.android:opentok-android-sdk:2.25.2")
// implementation("com.facebook.stetho:stetho:1.6.0")
// implementation("com.facebook.stetho:stetho-urlconnection:1.6.0")
implementation("androidx.core:core-ktx:1.16.0")
implementation("androidx.appcompat:appcompat:1.7.1")
implementation("com.google.android.material:material:1.12.0")
implementation("pl.droidsonroids.gif:android-gif-drawable:1.2.25")
androidTestImplementation("androidx.test:core:1.6.1")
implementation("com.whatsapp.otp:whatsapp-otp-android-sdk:0.1.0")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
// implementation(project(":vitalSignEngine"))
}

@ -193,31 +193,31 @@
android:exported="true" android:exported="true"
android:permission="android.permission.BIND_JOB_SERVICE" /> android:permission="android.permission.BIND_JOB_SERVICE" />
<receiver <!-- <receiver-->
android:name=".geofence.intent_receivers.GeofenceBroadcastReceiver" <!-- android:name=".geofence.intent_receivers.GeofenceBroadcastReceiver"-->
android:enabled="true" <!-- android:enabled="true"-->
android:exported="false" /> <!-- android:exported="false" />-->
<receiver <!-- <receiver-->
android:name=".geofence.intent_receivers.GeofencingRebootBroadcastReceiver" <!-- android:name=".geofence.intent_receivers.GeofencingRebootBroadcastReceiver"-->
android:enabled="true" <!-- android:enabled="true"-->
android:exported="false"> <!-- android:exported="false">-->
<intent-filter> <!-- <intent-filter>-->
<action android:name="android.intent.action.BOOT_COMPLETED" /> <!-- <action android:name="android.intent.action.BOOT_COMPLETED" />-->
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" /> <!-- <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />-->
</intent-filter> <!-- </intent-filter>-->
</receiver> <!-- </receiver>-->
<receiver <!-- <receiver-->
android:name=".geofence.intent_receivers.LocationProviderChangeReceiver" <!-- android:name=".geofence.intent_receivers.LocationProviderChangeReceiver"-->
android:exported="false"> <!-- android:exported="false">-->
<intent-filter> <!-- <intent-filter>-->
<action android:name="android.location.PROVIDERS_CHANGED" /> <!-- <action android:name="android.location.PROVIDERS_CHANGED" />-->
</intent-filter> <!-- </intent-filter>-->
</receiver> <!-- </receiver>-->
<service <!-- <service-->
android:name=".geofence.intent_receivers.ReregisterGeofenceJobService" <!-- android:name=".geofence.intent_receivers.ReregisterGeofenceJobService"-->
android:exported="true" <!-- android:exported="true"-->
android:permission="android.permission.BIND_JOB_SERVICE" /> <!-- Geofencing --> <!-- android:permission="android.permission.BIND_JOB_SERVICE" /> &lt;!&ndash; Geofencing &ndash;&gt;-->
<!-- <!--
Huawei Push Notifications Huawei Push Notifications
Set push kit auto enable to true (for obtaining the token on initialize) Set push kit auto enable to true (for obtaining the token on initialize)
@ -226,25 +226,25 @@
<!-- android:name="push_kit_auto_init_enabled" --> <!-- android:name="push_kit_auto_init_enabled" -->
<!-- android:value="true" /> --> <!-- android:value="true" /> -->
<!-- These receivers are for sending scheduled local notifications --> <!-- These receivers are for sending scheduled local notifications -->
<receiver <!-- <receiver-->
android:name="com.huawei.hms.flutter.push.receiver.local.HmsLocalNotificationBootEventReceiver" <!-- android:name="com.huawei.hms.flutter.push.receiver.local.HmsLocalNotificationBootEventReceiver"-->
android:exported="false"> <!-- android:exported="false">-->
<intent-filter> <!-- <intent-filter>-->
<action android:name="android.intent.action.BOOT_COMPLETED" /> <!-- <action android:name="android.intent.action.BOOT_COMPLETED" />-->
</intent-filter> <!-- </intent-filter>-->
</receiver> <!-- </receiver>-->
<receiver <!-- <receiver-->
android:name="com.huawei.hms.flutter.push.receiver.local.HmsLocalNotificationScheduledPublisher" <!-- android:name="com.huawei.hms.flutter.push.receiver.local.HmsLocalNotificationScheduledPublisher"-->
android:enabled="true" <!-- android:enabled="true"-->
android:exported="false" /> <!-- android:exported="false" />-->
<receiver <!-- <receiver-->
android:name="com.huawei.hms.flutter.push.receiver.BackgroundMessageBroadcastReceiver" <!-- android:name="com.huawei.hms.flutter.push.receiver.BackgroundMessageBroadcastReceiver"-->
android:enabled="true" <!-- android:enabled="true"-->
android:exported="true"> <!-- android:exported="true">-->
<intent-filter> <!-- <intent-filter>-->
<action android:name="com.huawei.hms.flutter.push.receiver.BACKGROUND_REMOTE_MESSAGE" /> <!-- <action android:name="com.huawei.hms.flutter.push.receiver.BACKGROUND_REMOTE_MESSAGE" />-->
</intent-filter> <!-- </intent-filter>-->
</receiver> <!-- Huawei Push Notifications --> <!-- </receiver> &lt;!&ndash; Huawei Push Notifications &ndash;&gt;-->
<meta-data <meta-data
android:name="com.google.android.geo.API_KEY" android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8" /> android:value="AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8" />

@ -1,5 +0,0 @@
package com.ejada.hmg.hmg_patient_app_new
import io.flutter.embedding.android.FlutterActivity
class MainActivity : FlutterActivity()

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off --> <!-- Theme applied to the Android Window while the process is starting -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar"> <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when <!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame --> Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item> <item name="android:windowBackground">@drawable/launch_background</item>
</style> </style>
<!-- Theme applied to the Android Window as soon as the process has started. <!-- Theme applied to the Android Window as soon as the process has started.
@ -12,7 +12,7 @@
running. running.
This Theme is only used starting with V2 of Flutter's Android embedding. --> This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar"> <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item> <item name="android:windowBackground">@android:color/white</item>
</style> </style>
</resources> </resources>

@ -1,16 +1,99 @@
buildscript {
repositories {
mavenCentral()
google()
maven { url = uri("https://developer.huawei.com/repo/") }
maven {
url = uri("https://api.mapbox.com/downloads/v2/releases/maven")
credentials {
username = "mapbox"
password = "sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg"
if (password.isNullOrEmpty()) {
throw GradleException("MAPBOX_DOWNLOADS_TOKEN isn't set. Set it to the project properties or to the environment variables.")
}
}
authentication {
create<BasicAuthentication>("basic")
}
}
}
dependencies {
classpath("com.android.tools.build:gradle:8.1.0")
classpath("com.huawei.agconnect:agcp:1.9.1.304")
}
}
allprojects { allprojects {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
maven { url = uri("https://developer.huawei.com/repo/") }
maven { url = uri("https://artifactory.ess-dev.com/artifactory/gradle-dev-local") }
maven {
url = uri("https://api.mapbox.com/downloads/v2/releases/maven")
credentials {
username = "mapbox"
password = "sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg"
if (password.isNullOrEmpty()) {
throw GradleException("MAPBOX_DOWNLOADS_TOKEN isn't set. Set it to the project properties or to the environment variables.")
}
}
authentication {
create<BasicAuthentication>("basic")
}
}
}
configurations.all {
exclude(group = "org.bouncycastle", module = "bcprov-jdk16")
} }
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_21.toString()
targetCompatibility = JavaVersion.VERSION_21.toString()
} }
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
rootProject.layout.buildDirectory.value(newBuildDir) kotlinOptions {
jvmTarget = "21"
}
}
subprojects {
afterEvaluate {
if (project.hasProperty("android")) {
project.extensions.findByName("android")?.let { androidExt ->
val android = androidExt as com.android.build.gradle.BaseExtension
if (android.namespace == null) {
android.namespace = project.group.toString()
}
android.buildFeatures.apply {
if (buildConfig == null) {
buildConfig = true
}
}
android.compileOptions.apply {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
}
}
project.tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_21.toString()
targetCompatibility = JavaVersion.VERSION_21.toString()
}
project.tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "21"
}
}
}
}
}
rootProject.buildDir = File("../build")
subprojects { subprojects {
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) project.buildDir = File("${rootProject.buildDir}/${project.name}")
project.layout.buildDirectory.value(newSubprojectBuildDir)
} }
subprojects { subprojects {
project.evaluationDependsOn(":app") project.evaluationDependsOn(":app")

@ -9,7 +9,7 @@ import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_callkit_incoming/flutter_callkit_incoming.dart'; // import 'package:flutter_callkit_incoming/flutter_callkit_incoming.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:hmg_patient_app_new/core/utils/LocalNotification.dart'; import 'package:hmg_patient_app_new/core/utils/LocalNotification.dart';
@ -319,7 +319,7 @@ class PushNotificationHandler {
int sdkInt = androidInfo.version.sdkInt ?? 0; int sdkInt = androidInfo.version.sdkInt ?? 0;
if (sdkInt >= 33) { if (sdkInt >= 33) {
await FlutterCallkitIncoming.requestFullIntentPermission(); // await FlutterCallkitIncoming.requestFullIntentPermission();
} }
} }
} }

@ -11,7 +11,6 @@ import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/app_bar_widget.dart'; import 'package:hmg_patient_app_new/widgets/appbar/app_bar_widget.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/input_widget.dart'; import 'package:hmg_patient_app_new/widgets/input_widget.dart';
import 'package:hmg_patient_app_new/widgets/language_switcher.dart';
import 'package:sizer/sizer.dart'; // Import sizer import 'package:sizer/sizer.dart'; // Import sizer
class LoginScreen extends StatefulWidget { class LoginScreen extends StatefulWidget {
@ -57,10 +56,11 @@ class _LoginScreen extends State<LoginScreen> {
children: [ children: [
Utils.showLottie(context: context, assetPath: AppAnimations.login, width: 45.w, height: 22.h, repeat: true, fit: BoxFit.cover), Utils.showLottie(context: context, assetPath: AppAnimations.login, width: 45.w, height: 22.h, repeat: true, fit: BoxFit.cover),
SizedBox(height: 19.h), // Adjusted to sizer unit SizedBox(height: 19.h), // Adjusted to sizer unit
LocaleKeys.welcomeToDrSulaiman.tr().toText22(),
Text( Text(
LocaleKeys.welcomeToDrSulaiman.tr(), LocaleKeys.welcomeToDrSulaiman.tr(),
style: context.dynamicTextStyle( style: context.dynamicTextStyle(
fontSize: 22.sp, fontSize: 22,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.textColor, color: AppColors.textColor,
letterSpacing: -0.4, letterSpacing: -0.4,

@ -367,15 +367,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.4.1" version: "3.4.1"
flutter_callkit_incoming:
dependency: "direct main"
description:
path: "."
ref: dev
resolved-ref: "4b5aa9798a77eaba1c1726c314c5de74cd37ad6d"
url: "https://github.com/hiennguyen92/flutter_callkit_incoming.git"
source: git
version: "2.5.8"
flutter_hooks: flutter_hooks:
dependency: transitive dependency: transitive
description: description:

@ -33,10 +33,10 @@ dependencies:
injector: ^4.0.0 injector: ^4.0.0
provider: ^6.1.5+1 provider: ^6.1.5+1
just_audio: ^0.10.4 just_audio: ^0.10.4
flutter_callkit_incoming: # flutter_callkit_incoming:
git: # git:
url: https://github.com/hiennguyen92/flutter_callkit_incoming.git # url: https://github.com/hiennguyen92/flutter_callkit_incoming.git
ref: dev # ref: dev
url_launcher: ^6.3.2 url_launcher: ^6.3.2
logger: ^2.6.1 logger: ^2.6.1
lottie: ^3.3.1 lottie: ^3.3.1

Loading…
Cancel
Save