Id
int64
21.6M
75.6M
PostTypeId
int64
1
1
AcceptedAnswerId
int64
21.6M
75.2M
ParentId
int64
Score
int64
-14
71
ViewCount
int64
5
87.5k
Body
stringlengths
1
26.6k
Title
stringlengths
20
150
ContentLicense
stringclasses
2 values
FavoriteCount
int64
0
0
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
127k
21.3M
Tags
sequencelengths
1
5
73,841,384
1
73,841,443
null
2
57
I have a function that currently returns LinearGradient as a background color. I would like to modify the return type such that the return type is either LinearGradient or AngularGradient based on a value of a variable? This is the code I have: ``` func colors() -> LinearGradient { return LinearGradient( gradient: Gradient(colors: [ Color(red: 135/255, green: 206/255, blue: 235/255), Color(red: 255/255, green: 160/255, blue: 122/255) ]), startPoint: .topLeading, endPoint: .top ) } ``` Instead, I would like to do something like this: ``` enum BackgroundType { case linear case angular } ``` then do the following: (the function is used inside .background() modifier) ``` func colors(backgroundColor: BackgroundType) -> ShapeStyle { if backgroundColor == .linear { return LinearGradient( gradient: Gradient(colors: [ Color(red: 135/255, green: 206/255, blue: 235/255), Color(red: 255/255, green: 160/255, blue: 122/255) ]), startPoint: .topLeading, endPoint: .top ) } else { return AngularGradient(gradient: Gradient(colors: [ Color(red: 135/255, green: 206/255, blue: 235/255), Color(red: 255/255, green: 160/255, blue: 122/255) ]), center: .topLeading, angle: .degrees(180 + 45)) } ``` Any suggestions please? Thanks!
how to make return type a LinearGradient or an AngularGradient in swift based on a condition?
CC BY-SA 4.0
null
2022-09-25T00:27:50.660
2022-09-25T00:50:27.797
null
null
9,751,547
[ "ios", "swift", "iphone", "swiftui", "mobile-development" ]
73,910,188
1
null
null
0
62
everyone, i am a newbe in the Android development (java, android studio). I want to create an app with minSDKversion 25. Am I correct in understanding that I can't use AndroidX for this and accordingly "implementations" as Firebase and similar required Android API 28 and higher? And is it possible to combine in one project a version that supports com.android.support and androidx dependencies?
How can I use androdx at api android level less than 28?
CC BY-SA 4.0
null
2022-09-30T14:19:21.450
2022-09-30T14:40:31.950
null
null
18,400,796
[ "android", "android-studio", "android-support-library", "androidx", "mobile-development" ]
73,976,038
1
null
null
2
199
I am getting the following error, and I see a lot of people refer to changing androidResources to aaptOptions, so I am wondering where would androidResources be located within the app structure? A problem occurred evaluating project ':app'. > No signature of method: build_7ti7vojh4f95jk83rqtiw9b5b.android() is applicable for argument types: (build_7ti7vojh4f95jk83rqtiw9b5b$_run_closure1) values: [build_7ti7vojh4f95jk83rqtiw9b5b$_run_closure1@611ff2ec] -
I am getting an error "No signature of method"
CC BY-SA 4.0
null
2022-10-06T15:03:09.133
2022-10-06T15:07:58.263
2022-10-06T15:07:58.263
2,315,162
20,176,893
[ "android", "gradle", "build.gradle", "mobile-development" ]
73,982,952
1
null
null
0
25
So, for example Google Pixel apparently is great for computational photography--but for most users that means using Google's own algorithms. But let's say I wanted to try to write my own "hackable" version of HDR+ from scratch, with my own features (obviously not trying to steal/modify Google's code, but writing my own, whether using shaders, a language like Halide, etc.). Are the hardware features of the chipset that Google uses to run their own HDR, night mode, etc. algorithms open enough to users/apps to make them run your own custom code instead, or are they "locked" in some way? What about other phone manufacturers--I assume Apple's is probably the most closed but I don't actually know. Which phone out there is currently the most open/"hackable" in this respect (and hopefully has a camera that isn't total crap)?
Phone with "most open" camera processing pipeline (for computational photography developers)?
CC BY-SA 4.0
null
2022-10-07T05:56:20.713
2022-10-07T05:56:20.713
null
null
8,391,331
[ "image-processing", "camera", "mobile-development", "mobile-devices" ]
74,078,850
1
74,081,912
null
0
319
I would like to create a barcode scanner in React Native with typescript; however, there are no libraries or anything that I can use. I am not using EXPO.
How to make a Barcode scanner in React native?
CC BY-SA 4.0
null
2022-10-15T11:02:52.320
2022-10-15T18:12:35.767
null
null
11,691,606
[ "reactjs", "react-native", "mobile-development" ]
74,091,884
1
null
null
0
69
I'm building an app using expo and i would like it to have a mobile view on android tablets but i don't know how this can be done. Any help will be appreciated.
How do i make my expo app render a mobile view on an android tablet just like bolt or uber renders on a tablet?
CC BY-SA 4.0
null
2022-10-17T01:49:30.260
2022-10-17T01:49:30.260
null
null
7,070,419
[ "android", "react-native", "expo", "mobile-development" ]
74,104,270
1
null
null
1
569
am trying to activate the payment gateway in my app. after getting all data needed to open the payment page ( this includes all necessary data like token first name.... etc. ) . after that I should display a page. in this page the user must enter his card info. my issue is: when trying to or when trying to open page using the WebView() am getting error like java.lang.IllegalStateException: Platform view hasn't been initialized from the platform view channel. I have already added the permission of using the internet in the manifesto file. also, i set the minSdkVersion to 19 & compileSdkVersion 32 . in addention to that i run the flutter clean many times but this did not solve the issue . my code below : ``` import 'dart:async'; import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/src/foundation/key.dart'; import 'package:flutter/src/widgets/framework.dart'; import 'package:webview_flutter/webview_flutter.dart'; import '../../shared/components/components.dart'; import '../../shared/components/const.dart'; class VisaCard extends StatefulWidget { const VisCard({Key? key}) : super(key: key); @override State<VisCard> createState() => _VisCardState(); } class _VisCardState extends State<VisCard> { final Completer<WebViewController> _controller = Completer<WebViewController>(); void initState() { super.initState(); if (Platform.isAndroid) { WebView.platform = SurfaceAndroidWebView(); } } @override Widget build(BuildContext context) { return Scaffold( body: WebView( initialUrl:"https://xxxxxxx/api/acceptance/iframes/684162?payment_token=${paymobFinalTokenCard}", javascriptMode: JavascriptMode.unrestricted, onWebViewCreated: (WebViewController webViewController) { _controller.complete(webViewController); }, // onProgress: (int progress) { // print('WebView is loading (progress : $progress%)'); // }, javascriptChannels: <JavascriptChannel>{ _toasterJavascriptChannel(context), }, onPageFinished: (String url) { print('Page finished loading: $url'); }, gestureNavigationEnabled: true, backgroundColor: const Color(0x00000000), ), ); } JavascriptChannel _toasterJavascriptChannel(BuildContext context) { return JavascriptChannel( name: 'Toaster', onMessageReceived: (JavascriptMessage message) { showSnackBar(context,message.toString() ); }); } } ``` error message : ``` [WARNING:dns_config_service_android.cc(153)] Failed to read DnsConfig. D/EGL_emulation( 8941): eglMakeCurrent: 0x7f336f68cf90: ver 2 0 (tinfo 0x7f359bd14080) (first time) **E/flutter ( 8941): [ERROR:flutter/fml/platform/android/jni_util.cc(204)] java.lang.IllegalStateException: Platform view hasn't been initialized from the platform view channel.** E/flutter ( 8941): at io.flutter.plugin.platform.PlatformViewsController.initializePlatformViewIfNeeded(PlatformViewsController.java:732) E/flutter ( 8941): at io.flutter.plugin.platform.PlatformViewsController.onDisplayPlatformView(PlatformViewsController.java:791) E/flutter ( 8941): at io.flutter.embedding.engine.FlutterJNI.onDisplayPlatformView(FlutterJNI.java:1380) E/flutter ( 8941): at android.os.MessageQueue.nativePollOnce(Native Method) E/flutter ( 8941): at android.os.MessageQueue.next(MessageQueue.java:335) E/flutter ( 8941): at android.os.Looper.loopOnce(Looper.java:161) E/flutter ( 8941): at android.os.Looper.loop(Looper.java:288) E/flutter ( 8941): at android.app.ActivityThread.main(ActivityThread.java:7839) E/flutter ( 8941): at java.lang.reflect.Method.invoke(Native Method) E/flutter ( 8941): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) E/flutter ( 8941): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) E/flutter ( 8941): F/flutter ( 8941): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1469)] Check failed: fml::jni::CheckException(env). F/libc ( 8941): Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 8941 (ample.paymobone), pid 8941 (ample.paymobone) *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Build fingerprint: 'google/sdk_gphone64_x86_64/emulator64_x86_64_arm64:12/SE1A.211212.001.B1/8023802:user/release-keys' Revision: '0' ABI: 'x86_64' Timestamp: 2022-10-18 02:10:20.176569800+0300 Process uptime: 0s Cmdline: com.example.paymobone pid: 8941, tid: 8941, name: ample.paymobone >>> com.example.paymobone <<< uid: 10160 signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1469)] Check failed: fml::jni::CheckException(env). ' rax 0000000000000000 rbx 00000000000022ed rcx 00007f357d3205cf rdx 0000000000000006 r8 00007ffee229c9d0 r9 00007ffee229c9d0 r10 00007ffee229c970 r11 0000000000000217 r12 00007f334f6d4bf0 r13 00007ffee229cad0 r14 00007ffee229c968 r15 00000000000022ed rdi 00000000000022ed rsi 00000000000022ed rbp 0000000000000007 rsp 00007ffee229c960 rip 00007f357d3205cf backtrace: #00 pc 000000000005e5cf /apex/com.android.runtime/lib64/bionic/libc.so (abort+191) (BuildId: 5db8d317d3741b337ef046540bbdd0f7) #01 pc 000000000160bf95 /data/app/~~MrR5iAtJNiBzJu6ee3Fmmg==/com.example.paymobone-cvQMP3KIgkxZaQO8P_dSzg==/lib/x86_64/libflutter.so (BuildId: 9292ed7a57d628289a096bc46aa71468ce209e08) #02 pc 0000000001631394 /data/app/~~MrR5iAtJNiBzJu6ee3Fmmg==/com.example.paymobone-cvQMP3KIgkxZaQO8P_dSzg==/lib/x86_64/libflutter.so (BuildId: 9292ed7a57d628289a096bc46aa71468ce209e08) #03 pc 00000000016183d6 /data/app/~~MrR5iAtJNiBzJu6ee3Fmmg==/com.example.paymobone-cvQMP3KIgkxZaQO8P_dSzg==/lib/x86_64/libflutter.so (BuildId: 9292ed7a57d628289a096bc46aa71468ce209e08) #04 pc 0000000001d847d9 /data/app/~~MrR5iAtJNiBzJu6ee3Fmmg==/com.example.paymobone-cvQMP3KIgkxZaQO8P_dSzg==/lib/x86_64/libflutter.so (BuildId: 9292ed7a57d628289a096bc46aa71468ce209e08) #05 pc 00000000019b6578 /data/app/~~MrR5iAtJNiBzJu6ee3Fmmg==/com.example.paymobone-cvQMP3KIgkxZaQO8P_dSzg==/lib/x86_64/libflutter.so (BuildId: 9292ed7a57d628289a096bc46aa71468ce209e08) #06 pc 00000000019b506a /data/app/~~MrR5iAtJNiBzJu6ee3Fmmg==/com.example.paymobone-cvQMP3KIgkxZaQO8P_dSzg==/lib/x86_64/libflutter.so (BuildId: 9292ed7a57d628289a096bc46aa71468ce209e08) #07 pc 00000000019b5be3 /data/app/~~MrR5iAtJNiBzJu6ee3Fmmg==/com.example.paymobone-cvQMP3KIgkxZaQO8P_dSzg==/lib/x86_64/libflutter.so (BuildId: 9292ed7a57d628289a096bc46aa71468ce209e08) #08 pc 00000000019b6b0d /data/app/~~MrR5iAtJNiBzJu6ee3Fmmg==/com.example.paymobone-cvQMP3KIgkxZaQO8P_dSzg==/lib/x86_64/libflutter.so (BuildId: 9292ed7a57d628289a096bc46aa71468ce209e08) #09 pc 00000000019b553b /data/app/~~MrR5iAtJNiBzJu6ee3Fmmg==/com.example.paymobone-cvQMP3KIgkxZaQO8P_dSzg==/lib/x86_64/libflutter.so (BuildId: 9292ed7a57d628289a096bc46aa71468ce209e08) #10 pc 00000000019b5234 /data/app/~~MrR5iAtJNiBzJu6ee3Fmmg==/com.example.paymobone-cvQMP3KIgkxZaQO8P_dSzg==/lib/x86_64/libflutter.so (BuildId: 9292ed7a57d628289a096bc46aa71468ce209e08) #11 pc 00000000019b6d9c /data/app/~~MrR5iAtJNiBzJu6ee3Fmmg==/com.example.paymobone-cvQMP3KIgkxZaQO8P_dSzg==/lib/x86_64/libflutter.so (BuildId: 9292ed7a57d628289a096bc46aa71468ce209e08) #12 pc 0000000001631f33 /data/app/~~MrR5iAtJNiBzJu6ee3Fmmg==/com.example.paymobone-cvQMP3KIgkxZaQO8P_dSzg==/lib/x86_64/libflutter.so (BuildId: 9292ed7a57d628289a096bc46aa71468ce209e08) #13 pc 000000000163734a /data/app/~~MrR5iAtJNiBzJu6ee3Fmmg==/com.example.paymobone-cvQMP3KIgkxZaQO8P_dSzg==/lib/x86_64/libflutter.so (BuildId: 9292ed7a57d628289a096bc46aa71468ce209e08) #14 pc 0000000000018475 /system/lib64/libutils.so (android::Looper::pollInner(int)+1013) (BuildId: 0b21e18f17c36471b0becec44f99518b) #15 pc 000000000001801e /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+126) (BuildId: 0b21e18f17c36471b0becec44f99518b) #16 pc 000000000015d253 /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+35) (BuildId: f90004a78069fa4c4e587a2081d386cd) #17 pc 00000000001ab568 /system/framework/x86_64/boot-framework.oat (art_jni_trampoline+120) (BuildId: 5ead3b6496eb4808298a4612fe10561bbd30f354) #18 pc 0000000002003e6e /memfd:jit-cache (deleted) (android.os.MessageQueue.next+206) #19 pc 0000000002007082 /memfd:jit-cache (deleted) (android.os.Looper.loopOnce+162) #20 pc 0000000000395376 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+806) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #21 pc 000000000041da09 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+233) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #22 pc 00000000005a335c /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+428) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #23 pc 000000000059d16c /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1036) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #24 pc 000000000097c172 /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+1410) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #25 pc 000000000037e899 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+25) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #26 pc 000000000044d768 /system/framework/framework.jar #27 pc 000000000097c90d /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+3357) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #28 pc 000000000037e899 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+25) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #29 pc 00000000001c85ca /system/framework/framework.jar #30 pc 0000000000594b42 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool)+306) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #31 pc 0000000000959a6f /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+1007) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #32 pc 00000000003a04bc /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+140) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #33 pc 0000000000395376 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+806) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #34 pc 000000000041da09 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+233) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #35 pc 0000000000819502 /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1442) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #36 pc 0000000000772728 /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+56) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #37 pc 00000000000b5a30 /apex/com.android.art/javalib/x86_64/boot.oat (art_jni_trampoline+144) (BuildId: d92cc57761604ac2f5849e74a41f38bf70ac7a09) #38 pc 0000000000395014 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+756) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #39 pc 000000000041d9fa /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+218) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #40 pc 00000000005a335c /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+428) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #41 pc 000000000059d16c /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1036) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #42 pc 000000000096e305 /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+1349) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #43 pc 000000000037e719 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+25) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #44 pc 000000000024800e /system/framework/framework.jar #45 pc 0000000000594b42 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool)+306) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #46 pc 0000000000959a6f /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+1007) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #47 pc 00000000003a04bc /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+140) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #48 pc 00000000008b3621 /system/framework/x86_64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2049) (BuildId: 5ead3b6496eb4808298a4612fe10561bbd30f354) #49 pc 0000000000395376 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+806) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #50 pc 000000000041da09 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+233) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #51 pc 0000000000819eb1 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, __va_list_tag*)+465) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #52 pc 00000000006ce8ac /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, __va_list_tag*)+620) (BuildId: cfc3de5d1c7b2855effeb77a784fc353) #53 pc 00000000000c6374 /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+164) (BuildId: f90004a78069fa4c4e587a2081d386cd) #54 pc 00000000000d2a71 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+865) (BuildId: f90004a78069fa4c4e587a2081d386cd) #55 pc 0000000000002f9f /system/bin/app_process64 (main+1599) (BuildId: 5c47dfdf42370b14f9eaa0b58a1dedf3) #56 pc 0000000000050079 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+89) (BuildId: 5db8d317d3741b337ef046540bbdd0f7) **Lost connection to device.** ```
webview_flutter in not working getting a platform error
CC BY-SA 4.0
null
2022-10-17T23:44:16.917
2022-12-22T02:03:35.207
null
null
15,730,661
[ "android", "ios", "flutter", "dart", "mobile-development" ]
74,129,137
1
null
null
0
38
I would like to know if my idea is possible and to get some insights into how I could achieve that. My idea: implement my app widget into the Android Keyboard (OnePlus 7) like in the following pictures: [Android Keyboard Widget](https://i.stack.imgur.com/VvY3R.png) [Widgets View](https://i.stack.imgur.com/4BiWD.png) Cheers!
Android Keyboard Widget
CC BY-SA 4.0
null
2022-10-19T16:53:51.003
2022-10-19T17:04:38.543
null
null
10,391,555
[ "android", "android-studio", "android-layout", "mobile-development" ]
74,206,212
1
74,206,743
null
0
16
``` ``` I'm getting an error in modal.route and I can't enter text, can you help? ``` ``` @override Widget build(BuildContext context) { ``` VeriModeli iletilenArgumanlar = ModalRoute.of(context).settings.arguments; return Scaffold( appBar: AppBar(title: Text("Profil Sayfası")), body: Container( child: Column(children: [ ElevatedButton(onPressed: cikisYap, child: Text("Çıkış Yap")), Text(iletilenArgumanlar.kullaniciaAdi), Text(iletilenArgumanlar.sifre), ]), ), ); ``` } } ``` ``` [](https://i.stack.imgur.com/A8MFD.png)
I'm having an error using modalroute can you solve the problem?
CC BY-SA 4.0
null
2022-10-26T10:26:25.803
2022-10-26T11:05:49.653
null
null
17,059,662
[ "flutter", "mobile", "mobile-development" ]
74,226,209
1
null
null
0
154
I want to continuously play music when the app starts on loop similar to many game apps available on the store. I have created a singleton as below.Do I have to add the play music logic in main.dart? import 'package:audioplayers/audioplayers.dart'; ``` class AudioService { AudioPlayer player = AudioPlayer(); static final AudioService instance = AudioService._(); AudioService._() { this.player.setVolume(1.0); } void playSound() async { await player.play(AssetSource('sounds/click.mp3')); } } ```
Flutter: How to play music in loop using audioplayers package on start of app?
CC BY-SA 4.0
null
2022-10-27T17:42:00.200
2022-11-02T20:06:42.307
2022-11-02T20:06:42.307
10,548,214
10,548,214
[ "android", "flutter", "dart", "flutter-dependencies", "mobile-development" ]
74,232,979
1
74,235,013
null
-1
75
I have 20 input fields in my app. What is the best way to define `TextFormField` widgets? For example: ``` Column( children: [ _buildCariUnvanTextField(unvanController), _buildCariUnvanTextField(unvanController), _buildCariUnvanTextField(unvanController), _buildCariUnvanTextField(unvanController), _buildCariUnvanTextField(unvanController), _buildCariUnvanTextField(unvanController), _buildCariUnvanTextField(unvanController), _buildCariUnvanTextField(unvanController), _buildCariUnvanTextField(unvanController), _buildCariUnvanTextField(unvanController), ], ), ``` Should I have 20 separate methods? Is it the correct way to define? Or what should I do? Can anyone explain?
What is the best way to define/store when I have a lot of TextFormField widgets in Flutter?
CC BY-SA 4.0
null
2022-10-28T09:03:20.183
2022-11-03T08:03:32.570
2022-11-03T08:03:32.570
8,528,014
11,764,250
[ "flutter", "dart", "textfield", "mobile-development", "textformfield" ]
74,234,267
1
74,239,819
null
1
916
As I click on the "Continue" button it's not navigating me to the LogIn Screen.I tried multiple times but its not working and displaying me the above error sometimes. What should be the correct code here for me to navigate to LogIn Screen. "Navigator.pushNamed(context,)." (Also, I can provide the loginPage code as well if its required.) ``` **Body.dart** ``` import 'package:flutter/material.dart'; import 'package:flutter_catalog/constants.dart'; import 'package:flutter_catalog/default_button.dart'; import 'package:flutter_catalog/pages/login_page.dart'; import 'package:flutter_catalog/size_config.dart'; import '../components/splash_content.dart'; class Body extends StatefulWidget { @override _BodyState createState() => _BodyState(); } class _BodyState extends State<Body> { int currentPage = 0; @override Widget build(BuildContext context) { return SafeArea( child: SizedBox( width: double.infinity, child: Column( children: <Widget>[ Expanded( flex: 5, child: PageView.builder( onPageChanged: (value) { setState(() { currentPage = value; }); }, itemCount: splashData.length, itemBuilder: (context, index) => SplashContent( image: splashData[index]["image"], text: splashData[index]['text'], ), ), ), Expanded( flex: 2, child: Padding( padding: EdgeInsets.symmetric( horizontal: getProportionateScreenWidth(20)), child: Column( children: <Widget>[ Spacer(), Row( mainAxisAlignment: MainAxisAlignment.center, children: List.generate( splashData.length, (index) => buildDot(index: index), ), ), Spacer(flex: 3), DefaultButton( text: "Continue", press: () { Navigator.pushNamed(context,**#What should I write here?**); }, ), Spacer(), ], ), ), ), ], ), ), ); } } ``` **Routes.dart** ``` class MyRoutes{ static String loginRoute = "/login"; static String homeRoute = "/home"; static String HomeDetailRoute = "/detail"; static String cartRoute = "/cart"; static String welcomescreenRoute = "/welcome"; static String SplashScreenRoute = "/splash"; } **main.dart** void main() { setPathUrlStrategy(); runApp(VxState(store: MyStore(), child: MyApp())); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { var vxNavigator = VxNavigator(routes: { "/": (_, __) => MaterialPage(child: SplashScreen()), MyRoutes.homeRoute: (_, __) => MaterialPage(child: HomePage()), MyRoutes.SplashScreenRoute: (_, __) => MaterialPage(child: SplashScreen()), MyRoutes.HomeDetailRoute: (uri, _) { final catalog = (VxState.store as MyStore) .catalog .getById(int.parse(uri.queryParameters["id"]!)); return MaterialPage( child: HomeDetailPage( catalog: catalog, ), ); }, MyRoutes.loginRoute: (_, __) => MaterialPage(child: LoginPage()), MyRoutes.cartRoute: (_, __) => MaterialPage(child: CartPage()), }); (VxState.store as MyStore).navigator = vxNavigator; ```
Navigator.onGenerateRoute was null, but the route named "/login" was referenced
CC BY-SA 4.0
null
2022-10-28T10:48:36.307
2022-10-28T18:59:53.963
2022-10-28T18:27:22.627
19,017,043
19,017,043
[ "flutter", "dart", "flutter-layout", "dart-pub", "mobile-development" ]
74,239,089
1
null
null
0
14
``` import { initializeApp } from "firebase/app"; import { getFirestore } from "firebase/firestore"; const firebaseConfig = { apiKey: "1234", authDomain: "demo.firebaseapp.com", projectId: "demo", storageBucket: "demo.appspot.com", messagingSenderId: "1234", appId: "1234", }; const app = initializeApp(firebaseConfig); export const db = getFirestore(app); ``` This is firebase config file. [](https://i.stack.imgur.com/vNIHh.png) This is the file we need to get the documents in firebase. But when I am trying to run this app on my android mobile device using expo go, it is getting an error as below ``` ERROR [2022-10-28T17:26:06.273Z] @firebase/firestore: Firestore (9.6.11): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds. This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend. ``` But my internet connection is working good in my mobile device. Also I have tried using different firebase versions but still didnt work for me. Can someone help me to fix this error? I am expecting to get help to connect the firebase to my react native application
Firebase firestore (9.6.11): Could not reach Cloud Firestore backend error in React Native
CC BY-SA 4.0
null
2022-10-28T17:44:09.260
2022-10-28T17:44:09.260
null
null
18,464,218
[ "reactjs", "firebase", "react-native", "mobile-development", "expo-go" ]
74,243,718
1
null
null
0
85
I have added the Liquid Swipe dependency in the pubspec.yaml file. Trying to add the liquid Swipe widget in the below code but unable to figure it out. Doubt: Where to add the liquid swipe widget and how. Also do i need to add the image and the text inside the container or the code below is correct for the same? ``` class Body extends StatefulWidget { @override _BodyState createState() => _BodyState(); } class _BodyState extends State<Body> { int currentPage = 0; final pages = [ Container( color: Color.fromARGB(255, 181, 101, 29), ), Container( color: Color.fromARGB(255, 196, 164, 132), ), ]; List<Map<String, String>> splashData = [ { "text": "Welcome to Shopuify, Let’s shop!", "image": "assets/images/splash_1.png" }, { "text": "We help people connect with store \naround India!", "image": "assets/images/splash_2.png" }, { "text": "We show the easy way to shop. \nJust stay at home with us", "image": "assets/images/splash_3.png" }, ]; @override Widget build(BuildContext context) { return SafeArea( child: SizedBox( width: double.infinity, child: Column( children: <Widget>[ Expanded( flex: 5, child: PageView.builder( onPageChanged: (value) { setState(() { currentPage = value; }); }, itemCount: splashData.length, itemBuilder: (context, index) => SplashContent( image: splashData[index]["image"], text: splashData[index]['text'], ), ), ), Expanded( flex: 2, child: Padding( padding: EdgeInsets.symmetric( horizontal: getProportionateScreenWidth(20)), child: Column( children: <Widget>[ Spacer(), Row( mainAxisAlignment: MainAxisAlignment.center, children: List.generate( splashData.length, (index) => buildDot(index: index), ), ), Spacer(flex: 3), DefaultButton( text: "Continue", press: () { context.vxNav.push(Uri(path: MyRoutes.loginRoute)); }, ), Spacer(), ], ), ), ), ], ), ), ); } ``` Please help me the code or provide me the full code if possible.Thankyou!
How do I add Liquid Swipe animation(Flutter) in this particular code
CC BY-SA 4.0
null
2022-10-29T08:00:13.330
2022-10-29T08:00:13.330
null
null
19,017,043
[ "flutter", "dart", "flutter-animation", "mobile-development" ]
74,265,999
1
null
null
0
117
I want to get all the audio files in my project which library supports both iOS and android in react native. Please suggests me some library which supports both iOS and android I want to get all the audio files in my project which library supports both iOS and android in react native. Please suggests me some library which supports both iOS and android tried this library [https://github.com/saadqbal/react-native-notification-sounds](https://github.com/saadqbal/react-native-notification-sounds) but not working I got this ``` NotificationSounds ``` is null
I want get all the audio files in my project which library supports both iOS and android in react native
CC BY-SA 4.0
null
2022-10-31T16:01:36.807
2022-10-31T16:01:36.807
null
null
19,901,270
[ "react-native", "react-hooks", "software-design", "mobile-development", "node-ios-device" ]
74,283,910
1
74,285,710
null
1
71
I'm beginner in Android development and now developing [my application](https://github.com/ksairos/Personal-Finances-App) that helps me to keep track of my personal finances. All my categories (food, shopping, etc) have a displayed color and icon (XML drawable) that should be stored inside Room database: [](https://i.stack.imgur.com/UarS2.png) What datatype or method should I use in order to store those icons inside my Room database? This is my current implementation of the Category Entity: ``` @Entity(tableName = "category") data class Category( @PrimaryKey(autoGenerate = true) var id: Int? = null, @ColumnInfo(name = "name") var name: String?, @ColumnInfo(name = "expanses") var expanses: Double?, @ColumnInfo(name = "icon") var icon: Int?, @ColumnInfo(name = "color") var color: Int?) ``` I'm using [this Icon Picker](https://github.com/maltaisn/icondialoglib) in my app.
What is a proper way to store drawables in the Room Library? Android, Kotlin, XML
CC BY-SA 4.0
null
2022-11-02T03:03:29.963
2022-11-02T07:31:05.010
null
null
14,288,309
[ "android", "kotlin", "android-room", "mobile-development" ]
74,284,437
1
null
null
-1
492
I want to link a library in react native version 0.70.1 but I got a error error: unknown command 'link' after trying this command react-native link react-native-notification-sounds[](https://i.stack.imgur.com/5d0lP.png)
I want to link a library in react native version 0.70.1 but I got a error error: unknown command 'link'
CC BY-SA 4.0
null
2022-11-02T04:44:16.433
2022-11-02T06:39:08.390
null
null
19,901,270
[ "android", "ios", "reactjs", "react-native", "mobile-development" ]
74,329,447
1
74,329,619
null
0
132
Please I'm need clarification on what the Map funtion and spread function does in flutter. ``` ...(questions[questionIndex]['answers'] as List<String>).map((answer) { return Answer(selectHandler: answerQuestion, answerText: answer);}).toList() ``` In the code above, I have Question map with keys and values, but the transformation process of the list to widget using map function with spread indicated by three dots, is what I need clarification on. Please someone help me explain to me. Thanks. Also is there any other recommendation on transforming list to wiidget without using map function?
Meaning of Flutter map Function
CC BY-SA 4.0
null
2022-11-05T16:20:45.033
2022-11-05T16:50:50.507
2022-11-05T16:22:18.297
8,446
14,511,542
[ "flutter", "dart", "material-design", "mobile-development", "flutter-widget" ]
74,331,434
1
null
null
3
200
I have the below code where the function just plays a simple button click sound audio without any loop and the function plays music in a loop.However I am unable to play both at the same time i.e. (in case the music is playing and I want to click a button for example). How can I implement that using the same instance or will I have to create two instances and change my code from being a singleton? Note: I am using the **audioplayers ** package ``` import 'package:audioplayers/audioplayers.dart'; import 'package:biblequiz/services/preferences.dart'; class AudioService { AudioPlayer player = AudioPlayer(); static final AudioService instance = AudioService._(); AudioService._() { this.player.setVolume(1.0); } void clickSound() async { await player.play(AssetSource('sounds/click.mp3')); } void loopSound() async { player.setReleaseMode(ReleaseMode.loop); await player.play(AssetSource('sounds/music.wav')); } void stopLoop() async { await player.stop(); } } ```
Flutter & Dart: How to play multiple sounds at the same time in app?
CC BY-SA 4.0
null
2022-11-05T20:57:18.240
2023-01-15T15:22:48.437
2023-01-15T15:22:48.437
10,548,214
10,548,214
[ "android", "flutter", "dart", "mobile-development" ]
74,350,500
1
null
null
0
11
I would like to call in viber using my android application but I don't know how to. I would like input a number in my android app then when I click a button I would like to redirect to viber and call that inputted number. Does anybody knows how. Big thanks!
How to call in viber using the inputted number in my android app?
CC BY-SA 4.0
null
2022-11-07T17:23:15.340
2022-11-07T17:23:15.340
null
null
20,442,536
[ "android", "android-studio", "mobile", "android-volley", "mobile-development" ]
74,373,596
1
null
null
0
57
I am trying to create an android application, of which its components are build partly on android studio and partly on unity. i can't do everything with android studio or everything with unity, so i would like a way to merge the two parts. my plan is to integrate the part built in unity as the main activity on androids studio and then create the other activities(screens) of my app on android studio and create a way to slide scroll between those screens(activities). i would like this configuration to work as a single 'precess'. is this posible to do ? I am still a beginner, so if I didn't explain well please tell me. I tried to search for information that would be useful to me but on found nothing.
is it possibile to use unity project as an android studio activity?
CC BY-SA 4.0
null
2022-11-09T10:45:19.973
2022-11-09T11:54:34.490
null
null
20,458,213
[ "android-studio", "unity3d", "mobile-development" ]
74,441,140
1
74,441,651
null
4
66
I'm trying to design this view. [](https://i.stack.imgur.com/MpOJ3.png) I already have the basic design of the cards, but i would like to know how to change the card's background color, the card's border color and add the little green square according to the width size of the current card when the user click one of them. It's important to know that only one card can be painted in green when the user clicked it. Here is my code: ``` class CategoryCardModel { final String? categoryCardModelName; CategoryCardModel(this.categoryCardModelName); } ``` ``` import 'dart:ffi'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; class CategoryCard extends StatelessWidget { final String? categoryCardName; final Function()? wasPressed; const CategoryCard({ super.key, required this.categoryCardName, this.wasPressed, }); @override Widget build(BuildContext context) { return GestureDetector( onTap: wasPressed, child: Card( shape: RoundedRectangleBorder( side: const BorderSide( color: Color.fromRGBO(212, 213, 215, 100), width: 3, ), borderRadius: BorderRadius.circular(20.0), ), child: Container( decoration: BoxDecoration( color: const Color.fromRGBO(242, 243, 243, 100), borderRadius: BorderRadius.circular(20.0)), padding: const EdgeInsets.all(10), child: Text( categoryCardName ?? 'Todas', style: const TextStyle( fontSize: 25, fontWeight: FontWeight.bold, color: Color.fromRGBO(91, 94, 99, 100)), ), ), ), ); } } ``` ``` import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'category_card.dart'; import 'category_card_model.dart'; class MyHomePage extends StatefulWidget { MyHomePage({super.key, required this.title}); final String title; @override State<MyHomePage> createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { // List of models final categoryCardModelList = <CategoryCardModel>[ CategoryCardModel("Todas"), CategoryCardModel("Smartphones"), CategoryCardModel("Accesorios para celular"), CategoryCardModel("TV") ]; List<CategoryCardModel>? _categoryCardModelListOf; @override void initState() { super.initState(); setState(() { _categoryCardModelListOf = List.of(categoryCardModelList); }); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(widget.title), ), body: SingleChildScrollView( scrollDirection: Axis.horizontal, padding: const EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: _categoryCardModelListOf! .map<Widget>((categoryCardModel) => CategoryCard( wasPressed: () { print("Hello World"); setState(() {}); }, categoryCardName: categoryCardModel.categoryCardModelName)) .toList()))); } } ``` ``` import 'package:flutter/material.dart'; import 'my_home_page.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: MyHomePage(title: "Caregory Cards"), ); } } ```
How to manage a custom widget state in SingleChildScrollView Widget
CC BY-SA 4.0
null
2022-11-15T05:55:10.220
2022-11-15T08:34:09.350
2022-11-15T06:14:40.170
17,901,132
20,395,420
[ "flutter", "setstate", "mobile-development", "statefulwidget", "singlechildscrollview" ]
74,445,284
1
null
null
0
44
I try to get a value from my stream but can't save the value inside widget. (save value in another file). I tried to change the type of the data but still get: '_BroadcastStream'. I would like the data to be the actual data from repo which is: '1.0.0'. ``` getDeviceData(Device device) async { _repositoryScannerSingleton.getScannerRepository.getDeviceCurrentVersion(); var data = await _repositoryScannerSingleton.getScannerRepository .subscribeToFWVersion(); print('VALUE FROM REPOSITORY: => $data'); } ``` Stream: ``` Stream<Version> getDeviceVersion() { //This function works, i try to minimize for simplicity. print('DEVICE VALUE :' '$value'); //This value gets printed as '1.0.0' _deviceCurrentVersionController.add(value) }); } } } }); }); return _deviceCurrentVersionController.stream; } ```
Need help to read Stream value and save as variable
CC BY-SA 4.0
null
2022-11-15T12:01:56.793
2022-11-15T12:01:56.793
null
null
20,509,914
[ "flutter", "frontend", "listener", "mobile-development", "stream-builder" ]
74,493,223
1
null
null
0
68
I followed [this](https://stackoverflow.com/questions/60390888/change-statusbar-color-for-each-screen) page to change status bar color for different screens in flutter. As per the above link, to change the status bar color for each screen we should update it before navigating to next screen but this is showing a delay in loading of other widgets as compared to status bar color update. Attaching gif below for reference. ``` // Before navigating back to home screen, updating the color of status bar. WillPopScope( onWillPop: () async { changeStatusBarColor(Colors.blue); return true; }, child: Scaffold( ..... )) ``` Is there any other way to update status bar color such that it reflects its update with other widgets on screen ? [Gif: This may seem a little fast here but its very much noticeable in actual device] [](https://i.stack.imgur.com/0a3b8.gif)
Flutter: Update of status bar color inconsistent with update of other widgets of screen
CC BY-SA 4.0
null
2022-11-18T17:15:38.480
2022-11-18T17:56:42.500
null
null
9,126,892
[ "flutter", "dart", "flutter-layout", "mobile-development" ]
74,509,752
1
null
null
0
14
Please how do I add an API key for an iOS app objective-c when developing with flutter ``` #import "GeneratedPluginRegistrant.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [GeneratedPluginRegistrant registerWithRegistry:self]; // Override point for customization after application launch. return [super application:application didFinishLaunchingWithOptions:launchOptions]; } @end ```
Adding an API key for an iOS app objective-c
CC BY-SA 4.0
null
2022-11-20T16:11:54.983
2022-11-20T16:11:54.983
null
null
11,154,531
[ "objective-c", "mobile-development", "google-location-services", "flutter-ios-build" ]
74,527,422
1
74,527,482
null
0
32
I would like to change the `top` property value of the `Positioned` widget according to screen orientation. I didn't know how to do it. Can anyone help?
How to set different values to a property based on the device orientation
CC BY-SA 4.0
null
2022-11-22T04:10:03.103
2022-11-22T05:05:16.647
2022-11-22T05:05:16.647
18,670,641
11,878,615
[ "android", "flutter", "dart", "mobile-development" ]
74,541,899
1
74,542,408
null
2
202
I'm a beginner in Flutter. I designed this page: [](https://i.stack.imgur.com/dLYLS.jpg) Instead of repeating the entire Listview.builder. I would like to use two instances of custom Listview.builder with two lists, one list for fruits, and the other for vegetables. As appeared in the above screen, I tried to display vegetables in the vegetables section through the following: Listview.builder Widget: ``` import 'package:flutter/material.dart'; import 'package:grocery_store/models/products_list.dart'; import '../utilities/add_product.dart'; import '../utilities/constants.dart'; class ProductsListView extends StatelessWidget { final String? productImage; final String? productName; final String? productCategory; final String? productPrice; const ProductsListView({ Key? key, this.productImage, this.productName, this.productCategory, this.productPrice, }) : super(key: key); @override Widget build(BuildContext context) { return ListView.builder( scrollDirection: Axis.horizontal, itemCount: fruitsList.length, itemBuilder: (BuildContext context, int index) { return ClipRect( child: Container( width: 140.0, decoration: BoxDecoration( borderRadius: BorderRadius.circular(15.0), color: Colors.white, boxShadow: const [ BoxShadow( blurRadius: 10, color: Colors.black, ), ], ), margin: const EdgeInsets.all(10.0), child: Padding( padding: const EdgeInsets.fromLTRB(20, 10, 10, 10), child: Column( children: [ Image.asset( fruitsList[index].fruitImage!, height: 80.0, width: 90.0, ), const SizedBox( height: 15, ), Row( children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( fruitsList[index].fruitName!, style: const TextStyle( fontSize: 15.0, fontWeight: FontWeight.bold, ), ), Text( fruitsList[index].fruitCategory!, textAlign: TextAlign.left, style: const TextStyle( height: 1.5, color: kDarkGrey, fontSize: 12.5, fontWeight: FontWeight.bold, ), ), ], ), ], ), Row( children: [ Text( fruitsList[index].fruitPrice!, style: const TextStyle( fontWeight: FontWeight.bold, ), ), const Spacer(), const AddProduct(), ], ) ], ), ), ), ); }, ); } } ``` Fruits and vegetables lists: ``` import '../utilities/constants.dart'; class Fruits { final String? fruitImage; final String? fruitName; final String? fruitCategory; final String? fruitPrice; Fruits( {this.fruitImage, this.fruitName, this.fruitCategory, this.fruitPrice}); } final Fruits bananas = Fruits( fruitImage: '${kFruitsImagesAsset}bananas.png', fruitName: 'Bananas', fruitCategory: 'Organic', fruitPrice: '\$4.99', ); final Fruits apples = Fruits( fruitImage: '${kFruitsImagesAsset}apples.png', fruitName: 'Apples', fruitCategory: 'Organic', fruitPrice: '\$5.00', ); final Fruits chikku = Fruits( fruitImage: '${kFruitsImagesAsset}chikku.png', fruitName: 'Chikku', fruitCategory: 'Organic', fruitPrice: '\$9.00', ); final Fruits peaches = Fruits( fruitImage: '${kFruitsImagesAsset}peaches.png', fruitName: 'Peaches', fruitCategory: 'Organic', fruitPrice: '\$12.00', ); List<Fruits> fruitsList = [bananas, apples, chikku, peaches]; class Vegetables { final String? vegetableImage; final String? vegetableName; final String? vegetableCategory; final String? vegetablePrice; Vegetables( {this.vegetableImage, this.vegetableName, this.vegetableCategory, this.vegetablePrice}); } final Vegetables okra = Vegetables( vegetableImage: '${kVegetablesImagesAsset}okra.png', vegetableName: 'Okra', vegetableCategory: 'Organic', vegetablePrice: '\$6.99', ); final Vegetables peas = Vegetables( vegetableImage: '${kVegetablesImagesAsset}peas.png', vegetableName: 'Peas', vegetableCategory: 'Organic', vegetablePrice: '\$10.50', ); final Vegetables potatoes = Vegetables( vegetableImage: '${kVegetablesImagesAsset}potatoes.png', vegetableName: 'Potatoes', vegetableCategory: 'Organic', vegetablePrice: '\$5.99', ); final Vegetables taro = Vegetables( vegetableImage: '${kVegetablesImagesAsset}taro.png', vegetableName: 'Taro', vegetableCategory: 'Organic', vegetablePrice: '\$5.50', ); List<Vegetables> vegetablesList = [okra, peas, potatoes, taro]; ``` Homepage where I want to display the two lists: ``` import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:grocery_store/models/product_cards_column.dart'; import 'package:grocery_store/utilities/constants.dart'; import 'package:grocery_store/utilities/grocery_text_field.dart'; import '../models/products_cards.dart'; import '../models/products_list.dart'; class GroceryPage extends StatelessWidget { const GroceryPage({Key? key}) : super(key: key); @override Widget build(BuildContext context) { var discountPortrait = MediaQuery.of(context).orientation == Orientation.portrait; return Scaffold( body: SafeArea( child: Padding( padding: const EdgeInsets.all(15.0), child: SingleChildScrollView( child: Column( children: [ Padding( padding: const EdgeInsets.fromLTRB(10, 0, 1, 0), child: Row( children: [ const Text( 'Grocery', style: kTitleTextStyle, ), const Spacer(), ClipRRect( borderRadius: BorderRadius.circular(16.0), child: Image.asset( 'images/apple.jpg', width: 46.0, height: 46.0, fit: BoxFit.cover, ), ), ], ), ), const SizedBox(height: 10.0), Row(children: [ GroceryTextField.groceryTextField( groceryText: 'Search...', ), const SizedBox(width: 5.0), Container( height: 50.0, width: 50.0, decoration: BoxDecoration( borderRadius: BorderRadius.circular(18.0), color: kLightGrey, ), child: Padding( padding: const EdgeInsets.all(10.0), child: SvgPicture.asset( 'images/funnel.svg', semanticsLabel: 'Funnel', color: kDarkGrey, ), ), ), ]), const SizedBox(height: 10.0), Container( height: 150, decoration: BoxDecoration( borderRadius: BorderRadius.circular(30.0), color: const Color(0xFFE9F9F2), ), width: double.infinity, child: Stack( children: [ Positioned( bottom: -150, right: discountPortrait ? -30 : 30, height: 290, width: 430, child: Image.asset( '${kProductsImagesAsset}lettuce.png', ), ), Positioned( top: discountPortrait ? 35 : 15, left: discountPortrait ? 25 : 100, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( 'Get Up To', style: kGreenTitleStyle.copyWith( fontSize: discountPortrait ? 20 : 60, ), ), Text( '%10 off', style: kGreenTitleStyle.copyWith( fontSize: 40.0, ), ), ], ), ), ], ), ), Column( children: const [ ProductCardsRow( groceryType: 'Fruits', ), SizedBox( height: 215, width: double.infinity, child: ProductsListView( ), ), ], ), Column( children: const [ ProductCardsRow( groceryType: 'Vegetables', ), SizedBox( height: 215, width: double.infinity, child: ProductsListView( ), ), ], ), ], ), ), ), ), ); } } ``` Hope someone can help
Use extracted Listview.builder with two lists in Flutter
CC BY-SA 4.0
null
2022-11-23T04:47:08.987
2022-11-23T08:19:48.847
2022-11-23T08:19:48.847
11,878,615
11,878,615
[ "android", "flutter", "dart", "mobile-development" ]
74,590,381
1
null
null
1
59
I'm still learning Flutter, so I need some help. The following page layout is in portrait mode: [](https://i.stack.imgur.com/SWyGD.png) I want it to change to the following layout in landscape mode: [](https://i.stack.imgur.com/Qf9Os.png) How can I do it without repeating the widgets? I thought to do it through a list or a map but I didn't know how to apply that to my code
How to change the page layout according to screen orientation in Flutter?
CC BY-SA 4.0
null
2022-11-27T13:21:59.467
2022-11-27T16:05:22.143
null
null
11,878,615
[ "android", "flutter", "dart", "mobile-development" ]
74,596,510
1
74,596,655
null
0
22
I'm still learning Flutter, so I apologize for any difficulty in properly explaining what I want to do In this code: ``` import 'package:flutter/material.dart'; import '../utilities/constants.dart'; class Divisions extends StatelessWidget { final String? image; final String? title; const Divisions({ Key? key, this.image, this.title, }) : super(key: key); @override Widget build(BuildContext context) { return Stack( children: [ Positioned( right: -10, child: Image.asset( '${kImagesPath}stars.png', color: Colors.blue, ), ), Container( padding: const EdgeInsets.all(20), width: 145, height: 145, decoration: const BoxDecoration( shape: BoxShape.circle, ), child: Container( decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.transparent, border: Border.all( width: 4, color: Colors.blue, ), ), child: Padding( padding: const EdgeInsets.all(8.0), child: Column( children: [ ImageIcon( size: 45, AssetImage(image!), color: Colors.blue, ), Text( title!, style: kDefaultFontStyle, ), ], ), ), ), ), ], ); } } ``` I'm trying to make a new "Divisions()" object in another dart file, with the same "Stack" children except for the "right:" property, I want "right:" to be different in that new "Divisions()" Any help would be appreciated
How to use different "right:" value in "Positioned" for an instance of a class in Flutter?
CC BY-SA 4.0
null
2022-11-28T05:54:16.417
2022-11-28T06:51:42.527
null
null
11,878,615
[ "android", "flutter", "dart", "mobile-development" ]
74,647,673
1
null
null
1
54
In my app, I putted widgets in Gridview.count() in two columns in portrait mode: [](https://i.stack.imgur.com/JMoim.jpg) And it become three columns in landscape mode: [](https://i.stack.imgur.com/y9pvi.png) I want the last widget to be in the center in both portrait and landscape modes Here's the Gridview.count() code: ``` SizedBox( height: context.isPortrait ? 660 : 610, child: GridView.count( shrinkWrap: true, padding: context.isPortrait ? portraitPadding : landscapePadding, physics: const NeverScrollableScrollPhysics(), crossAxisCount: context.isPortrait ? 2 : 3, children: const [ Divisions( image: '${kImagesPath}person.png', title: 'ولي الأمر', ), Divisions( image: '${kImagesPath}employing.png', title: 'طلب توظيف', ), Divisions( image: '${kImagesPath}links.png', title: 'روابط عامة', ), Divisions( image: '${kImagesPath}interview.png', title: 'طلب مقابلة', ), Divisions( image: '${kImagesPath}form.png', title: 'نماذج', ), Divisions( image: '${kImagesPath}calendar.png', title: 'رزنامة العام', ), Divisions( image: '${kImagesPath}call.png', title: 'تواصل معنا', // right: context.isPortrait ? -125 : -85, // left: context.isPortrait ? -15 : -16, // bottom: context.isPortrait ? -10 : 30, ), ], ), ) ```
How to center the last widget in Gridview.count() in Flutter?
CC BY-SA 4.0
null
2022-12-01T20:11:36.283
2022-12-01T21:25:08.787
null
null
11,878,615
[ "android", "flutter", "dart", "mobile-development" ]
74,760,214
1
74,760,501
null
0
85
My screen has three widgets : 1. First one is a ListView of widgets, the number of widgets can be incremented with a button. I want the ListView to take only the required space that's why I wrapped it in Flexible, but I don't want it to exceed the height of 266. (If it takes more than 266px, it becomes scrollable). 2. Second one is a widget that will take all the remaining space, it's wrapped in Expended. 3. Third one is just a button with defined height. The code is something like : ``` Scaffold( body : Column( children:[ Flexible(child: Widget1()), Expanded(child: Widget2()), Button(), ]) ) ``` I tried wrapping the Flexible in a ConstrainedBox and gave it a max height of 266, but the Widget1 took all the 266 height. In short, I want Widget1 to take the required space, but it can't exceed 266. Anyone has a solution for this?
I want to put height constraints on a Flexible widget
CC BY-SA 4.0
null
2022-12-11T10:58:39.527
2022-12-11T11:43:28.157
2022-12-11T11:02:52.323
20,747,742
20,747,742
[ "flutter", "user-interface", "mobile-development", "flutter-widget", "flutter-design" ]
74,772,284
1
null
null
0
46
I have been using launvhImage as general Splash screen for for tvOS app built using react native , recentlly i require to constrol when i want to hide the native spalsh screen of tvOS, I am using `react-native-bootsplash` to show splash screen but I am getting "Library not found for -lRNBootSplash-tvOS". I have no idea how can implement this . I tried using package "react-native-splash-screen" but that is also not working , I have same implementation in IOS app but that iss working perfectlly .
Is there a way to use BootSplash.storyboard as. splash screen in tvOs
CC BY-SA 4.0
null
2022-12-12T14:05:45.953
2022-12-12T14:05:45.953
null
null
13,824,629
[ "ios", "react-native", "tvos", "mobile-development", "react-native-splash-screen" ]
74,800,818
1
null
null
0
40
I want a Circular Indeterminate ProgressBar to be visible for a few milliseconds. I have created a function to display the progress bar: ``` fun showProg(){ binding.progBar.visibility = View.VISIBLE binding.progBar.visibility = View.INVISIBLE } ```
How to create a Circular Indeterminate ProgressBar which is visible for a few milliseconds in Android Kotlin?
CC BY-SA 4.0
null
2022-12-14T15:47:41.600
2022-12-15T18:29:11.657
2022-12-15T18:29:11.657
15,749,574
20,776,895
[ "android", "xml", "kotlin", "android-layout", "mobile-development" ]
74,814,526
1
74,814,943
null
0
62
I want to start writing an application using Flutter as it suits my needs at this stage. In the future, of course, I will need to build a team and applications in Java & Swift. But if I release the application now on Flutter and create a brand, will I be able to completely re-upload the application code? Example: for Google Play - change the Flutter code to Java. I tried googling but can't find anything...
Can I completely rewrite my app in another language after the release in the Google Play and Appstore?
CC BY-SA 4.0
null
2022-12-15T16:14:56.350
2022-12-15T17:12:00.563
null
null
20,786,186
[ "android", "ios", "flutter", "mobile-development" ]
74,829,428
1
null
null
0
29
So I'm developing this Android application which has many features, and one of them is the workout reminder. We used firebase database in setting up login authentication, and the user's information. Now for the last feature, I made a workout reminder which consists of and which also has a notification and. It only sets one alarm and I assume that if I applied and displayed it in a , it will set multiple alarms. Unfortunately, it doesn't. When the reminder is displayed in the Recycler View, and when I restart the application, the reminder is gone. Thank you in advance! Here is my code below: ``` public class AlertReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { NotificationHelper notificationHelper = new NotificationHelper(context); NotificationCompat.Builder nb = notificationHelper.getChannel1Notification(reminderAddFragment.getTitle(), reminderAddFragment.getMessage()); notificationHelper.getManager().notify(1, nb.build()); } ``` } ``` private void startAlarm(Calendar cal) { AlarmManager alarmManager = (AlarmManager) getActivity().getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(getActivity(), AlertReceiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(getActivity(), 1, intent, 0); alarmManager.setExact(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pendingIntent); } ```
Do I still need database in setting multiple alarms or reminders?
CC BY-SA 4.0
null
2022-12-16T20:24:13.623
2022-12-16T21:26:09.603
2022-12-16T20:48:04.283
17,273,649
17,273,649
[ "java", "android", "firebase", "mobile-development" ]
74,865,396
1
null
null
0
20
I am working on creating an application with the Nativescript framework. In my registration page (Clavier.vue), I used the TabView template (from my App.vue) and I put a FlexboxLayout with a height and width of 100% each. Inside I put the text fields and a save button. Problem: When I click on a text field to fill it, the keyboard automatically pops out and the elements at the bottom of my FlexboxLayout move up to be visible. I would like the elements to remain hidden by the android keyboard and only the text field of the form in question to be visible, because my form can include many text fields. Here is the code for the Clavier.vue page: Clavier.vue Screenshot Keyboard.vue Default Keyboard.vue Here you see that the 3 icons (buttons) of the tabview and the button of the form go up to land at the top of the android keyboard.
My keyboard doesn't hover over elements when I tap on a text field in my nativescript app
CC BY-SA 4.0
null
2022-12-20T15:30:42.940
2023-01-13T11:19:07.967
2023-01-13T11:18:34.923
19,894,890
19,894,890
[ "android", "nativescript", "nativescript-vue", "mobile-development" ]
74,890,098
1
null
null
0
61
I'm looking for a way to add a little icon (for example an hamburger icon) on a calendar around the time and date the user had lunch. I'm using the syncfusion calendar package. How do you think i should proceed? Thank you for your help
Add an icon on a Flutter Calendar
CC BY-SA 4.0
null
2022-12-22T14:45:41.563
2022-12-23T06:29:41.320
null
null
18,171,973
[ "flutter", "mobile", "mobile-development" ]
74,925,714
1
null
null
0
27
I have an image of a half court [half court](https://i.stack.imgur.com/v2Y2t.png) and I want to check how the user can determine if the made or missed shot was a 2pt or a 3pt, also determine the plot coordinate of an actual size of a basketball half court not just the touch coordinate of the screen. What can be the the possible functions for this? I'm using kivy python. Here are my codes used for plotting the touch coordinates for X and Y. ``` savefile = ObjectProperty(None) text_input = ObjectProperty(None) open('save_file.csv', 'w').write("Shot type,X,Y\n") def on_touch_down(self, touch): self.canvas.add(Color(rgb=(46/255.0, 172/255.0, 88/255.0))) d = 10 self.canvas.add(Ellipse(pos=(touch.x - d / 2, touch.y), size=(d, d))) with open('save_file.csv', 'a', newline='') as f: print("Made," + str(touch.x) + "," + str(touch.y), file=f) if touch.is_double_tap: self.canvas.add(Color(rgb=(220/255.0, 8/255.0, 8/255.0))) d = 10 self.canvas.add( Ellipse(pos=(touch.x - d / 2, touch.y), size=(d, d))) print("Missed," + str(touch.x) + "," + str(touch.y), file=f) def clear_screen(self): self.canvas.clear() def save(self, path, filename): with open(os.path.join(path, filename), 'w') as stream: stream.write(self.text_input.text) self.dismiss_popup() ```
How to check if the touch event is within the range of the image
CC BY-SA 4.0
null
2022-12-27T04:30:31.487
2022-12-27T04:31:50.747
2022-12-27T04:31:50.747
13,416,868
13,416,868
[ "python", "android", "kivy", "kivymd", "mobile-development" ]
75,042,540
1
null
null
0
20
I'm still learning and I'm getting an error *Warning, too much iteration done before the next frame. Check your code, or increase the Clock.max_iteration attribute. * ``` BoxLayout: size_hint: None, None size: area_img.size pos_hint: {'center_x': .5, 'center_y': .5} Court: id: area_img source: 'half-court.png' size: self.texture_size MDBottomNavigation: MDBottomNavigationItem: name: "btnSave" text: "Save" icon: "images/save.png" selected_color_background: 147/255,84/255,48/255 on_tab_release: root.show_save() MDBottomNavigationItem: name: "btnClear" text: "Clear Screen" icon: "images/clear.png" selected_color_background: 147/255,84/255,48/255 on_tab_release: root.clear_drawing() MDBottomNavigationItem: name: "btnBack" text: "Home" icon: "images/home.png" selected_color_background: 147/255,84/255,48/255 # on_tab_release: app.root.current = 'main' ``` I'm trying to include the MDBottomNavigation to the screen so I can save, clear the output of the data and can easily go back to home screen. This is my kv file. Without the MDBottomNavigation it's working well, but when I include it, that's the error being said. [How it looks like with MDBottomNavigation](https://i.stack.imgur.com/EqFtQ.png) [Without](https://i.stack.imgur.com/z52QR.png)
What causes error: "Warning, too much iteration done before the next frame. Check your code, or increase the Clock.max_iteration attribute" in Kivy?
CC BY-SA 4.0
null
2023-01-07T17:50:43.163
2023-01-07T17:50:43.163
null
null
20,937,956
[ "python", "android", "kivy-language", "kivymd", "mobile-development" ]
75,047,459
1
null
null
0
18
I'm trying to create a function that would show the shooting percentage after plotting the touch input data. I created a button and a label for it to display on the screen, but it is not showing up and I am getting an error *_apply_rule with widget.canvas.before: AttributeError: 'NoneType' object has no attribute 'before' * sample code from main.py ``` def on_touch_down(self, touch): # Add variables to keep track of shots made and missed shots_made = 0 shots_missed = 0 d = 10 if self.collide_point(*touch.pos): self.canvas.add(Color(rgb=(46 / 255.0, 172 / 255.0, 88 / 255.0))) self.canvas.add(Ellipse(pos=(touch.x - d / 2, touch.y), size=(d, d))) # Calculate the pixel location relative to the top-left corner of the image x = touch.x - self.pos[0] y = self.size[1] - touch.y + self.pos[1] # modified line # Increment the shots made counter shots_made += 1 # Update the shooting percentage label self.ids.label_shooting_percentage.text = \ f"Shooting Percentage: {shots_made / (shots_made + shots_missed):.2f}" ``` sample code from kv file ``` BoxLayout: size_hint: None, None size: area_img.size pos_hint: {'center_x': .5, 'center_y': .5} Court: id: area_img source: 'half-court.png' size: self.texture_size # pos_hint: {'center_x': .5, 'center_y': .5} z: 1 Label: id: label_shooting_percentage text: "Shooting Percentage: 0.00" ``` I tried fixing the layouts because maybe those were the problem but even if I fix it, it is still the same. Tried changing it into an item in the bottomnavigation. I'm expecting it to show the shooting percentage on screen after clicking the button "show percentage"
How to show the percentage on screen after pressing the button using Kivy?
CC BY-SA 4.0
null
2023-01-08T11:43:16.733
2023-01-08T11:43:16.733
null
null
20,937,956
[ "python", "android", "kivy", "kivymd", "mobile-development" ]
75,058,978
1
null
null
1
30
I'm trying to create a single tap and double tap inputs and what I want to happen is that when i double tap it does not get the value of the single tap. This is what I did. I tried putting "if not touch.is_double_tap:" but it still shows the single tap value. I even tried commenting out the "with open('save_file.csv', 'a', newline='') as f: print(f"Made,{x},{y}", file=f)" below the if not touch.is_double_tap. Still getting that value. ``` def on_touch_down(self, touch): d = 10 if self.collide_point(*touch.pos): self.canvas.add(Color(rgb=(46 / 255.0, 172 / 255.0, 88 / 255.0))) self.canvas.add(Ellipse(pos=(touch.x - d / 2, touch.y), size=(d, d))) x = touch.x - self.pos[0] y = self.size[1] - touch.y + self.pos[1] # modified line # Don't write to the file if the touch event is a double tap if not touch.is_double_tap: with open('save_file.csv', 'a', newline='') as f: print(f"Made,{x},{y}", file=f) # Increment the shots made counter self.shots_made += 1 if touch.is_double_tap: self.canvas.add(Color(rgb=(220 / 255.0, 8 / 255.0, 8 / 255.0))) d = 10 self.canvas.add(Ellipse(pos=(touch.x - d / 2, touch.y), size=(d, d))) self.shots_missed += 1 with open('save_file.csv', 'a', newline='') as f: print(f"Missed,{x},{y}", file=f) ``` What could be the possible solution for this?
How to fix double tap speed distance using Kivy?
CC BY-SA 4.0
null
2023-01-09T14:49:01.040
2023-01-09T15:25:45.563
null
null
20,937,956
[ "python", "android", "kivy", "kivymd", "mobile-development" ]
75,113,145
1
null
null
3
190
I am using [flutter_map](https://pub.dev/packages/flutter_map) in my app to show a map with Markers on it. The issue I'm having is that when I zoom in/out, I have a CircleMarker around each Marker and it becomes obvious very quickly that they're not centered correctly (see images below). How to correctly anchor the Marker icon so that it doesn't move around when I zoom in/out of the map? [](https://i.stack.imgur.com/cFth6.png) [](https://i.stack.imgur.com/6QTMu.png) [](https://i.stack.imgur.com/QAmj8.png) My code for making the Markers: ``` Marker marker = Marker( point: LatLng(alertLatitude, alertLongitude), width: 50, height: 50, anchorPos: AnchorPos.align(AnchorAlign.center), builder: (context) => Icon( Icons.location_on_sharp, size: 60, color: Color(aquarium), )); ``` My code for making the FlutterMap: ``` FlutterMap( mapController: _mapController, options: MapOptions( center: determineMapStartLocation(), zoom: 14, plugins: [MarkerClusterPlugin()], onTap: (_, __) => _popupController.hideAllPopups(), ), layers: [ TileLayerOptions( minZoom: 1, maxZoom: 20, backgroundColor: Colors.white, urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', subdomains: ['a', 'b', 'c'], ), CircleLayerOptions( circles: alertCirclesList, ), MarkerClusterLayerOptions( maxClusterRadius: 190, disableClusteringAtZoom: 12, size: Size(90, 90), fitBoundsOptions: FitBoundsOptions( padding: EdgeInsets.all(50), ), markers: _alertMarkers, ... )]); ```
How to keep map marker icons move when zooming in/out of map
CC BY-SA 4.0
null
2023-01-13T18:26:03.220
2023-01-17T09:48:51.530
null
null
8,846,093
[ "android", "flutter", "dart", "mobile-development", "fluttermap" ]
75,123,059
1
null
null
0
24
Everytime I click on the nextBTn and PrevBtn in "music player activity",the next/previous Items in the recyclerview of "songs activity" or it's adapter need to play the perticuclar song in "Player activity". I tried to make position++ and position-- but the items need to save in player activity I guess. How can I play next and previous song when my player activity and adapter are two different activities. How can I give the recyclerview items of the song currently playing and apply previoussongBTn,nextsongBTn? code of player.java ``` public class player extends AppCompatActivity { private ImageView imagePlayPause, forwardBtn, backwardBtn; MediaPlayer mediaPlayer; ImageView songImageIV; String song_path,image_path,song_name,album_name,sng_path,pre_song; TextView song_nameTV,albumNameTV; private SeekBar playerSeekBar; private TextView textCurrentTime, textTotalDuration; private Handler handler = new Handler(); AdapterSongs songAdapter; private int seekForwardTime = 10 * 1000; private int seekBackwardTime = 10 * 1000; // default 10 second private ChipNavigationBar chipNavigationBar;//for navigation TextView scrollingText;//song name which scrolls horizontally @SuppressLint("ClickableViewAccessibility") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.player_activity); songImageIV = findViewById(R.id.song_image); song_nameTV = findViewById(R.id.tv_songName); albumNameTV = findViewById(R.id.topBarAlbumName); textCurrentTime = findViewById(R.id.current_time); textTotalDuration = findViewById(R.id.totalDuration); playerSeekBar = findViewById(R.id.seekbar); imagePlayPause = findViewById(R.id.playbtn); forwardBtn = findViewById(R.id.forwardBtn); backwardBtn = findViewById(R.id.backwardBtn); mediaPlayer = playerInstance.getInstance(); playerSeekBar.setMax(100); SharedPreferences sharedPreferences = getSharedPreferences("songDetails",MODE_PRIVATE); song_path = sharedPreferences.getString("songPath",""); image_path = sharedPreferences.getString("album_img",""); song_name = sharedPreferences.getString("songName",""); album_name = sharedPreferences.getString("album_name",""); pre_song = sharedPreferences.getString("pre_song",""); // albumNameTV.append(album_name); Picasso.get().load(image_path).into(songImageIV); song_nameTV.setText(song_name); albumNameTV.append(album_name); scrollingText = (TextView)findViewById(R.id.tv_songName); scrollingText.setSelected(true); Log.i("tagconvertstr", "[song_path = " +song_path + "]"); Log.i("tagconvertstr", "[pre_path" + pre_song + "]"); if(!song_path.equals(pre_song)) { prepareMediaPlayer(); textTotalDuration.setText(milisecToTimer(mediaPlayer.getDuration())); if(!mediaPlayer.isPlaying()){ prepareMediaPlayer(); } } if(mediaPlayer.isPlaying()) { imagePlayPause.setImageResource(R.drawable.pause_icon); updater.run(); textTotalDuration.setText(milisecToTimer(mediaPlayer.getDuration())); } if(song_path.equalsIgnoreCase(pre_song)) { updater.run(); textTotalDuration.setText(milisecToTimer(mediaPlayer.getDuration())); } navigation();//for navigation imagePlayPause.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { playpause(); } }); playerSeekBar.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { SeekBar seekBar = (SeekBar) view; int playPosition = (mediaPlayer.getDuration()/100)*seekBar.getProgress(); mediaPlayer.seekTo(playPosition); textCurrentTime.setText(milisecToTimer(mediaPlayer.getCurrentPosition())); return false; } }); mediaPlayer.setOnBufferingUpdateListener(new MediaPlayer.OnBufferingUpdateListener() { @Override public void onBufferingUpdate(MediaPlayer mediaPlayer, int i) { playerSeekBar.setSecondaryProgress(i); } }); if(mediaPlayer!=null) { mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mediaPlayer) { mediaPlayer.stop(); mediaPlayer.reset(); prepareMediaPlayer(); playerSeekBar.setProgress(0); imagePlayPause.setImageResource(R.drawable.pause_icon); textCurrentTime.setText(R.string.zero); textTotalDuration.setText(R.string.zero); } }); } forwardBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { forwardSong(); } }); backwardBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { rewindSong(); } }); } public void forwardSong() { if (mediaPlayer != null) { int currentPosition = mediaPlayer.getCurrentPosition(); if (currentPosition + seekForwardTime <= mediaPlayer.getDuration()) { mediaPlayer.seekTo(currentPosition + seekForwardTime); } else { mediaPlayer.seekTo(mediaPlayer.getDuration()); } } } public void rewindSong() { if (mediaPlayer != null) { int currentPosition = mediaPlayer.getCurrentPosition(); if (currentPosition - seekBackwardTime >= 0) { mediaPlayer.seekTo(currentPosition - seekBackwardTime); } else { mediaPlayer.seekTo(0); } } } private void prepareMediaPlayer(){ mediaPlayer.reset(); pre_song = song_path; SharedPreferences sharedPreferences = getSharedPreferences("songDetails",Context.MODE_PRIVATE); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString("pre_song",pre_song); editor.apply(); imagePlayPause.setImageResource(R.drawable.pause_icon); try{ mediaPlayer.setDataSource(song_path); // mediaPlayer.setDataSource("https://testing-ariya.s3.ap-south-1.amazonaws.com/Faded_320(PaglaSongs).mp3"); mediaPlayer.prepare(); textTotalDuration.setText(milisecToTimer(mediaPlayer.getDuration())); mediaPlayer.start(); updater.run(); }catch (Exception e){ Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show(); } } public Runnable updater = new Runnable() { @Override public void run() { updateseekbar(); long currentDuration = mediaPlayer.getCurrentPosition(); textCurrentTime.setText(milisecToTimer(currentDuration)); } }; public void updateseekbar(){ if(mediaPlayer.isPlaying()){ playerSeekBar.setProgress((int) (((float) mediaPlayer.getCurrentPosition()/mediaPlayer.getDuration()) *100)); handler.postDelayed(updater,1000); } } private String milisecToTimer(long milliseconds){ String timerString= ""; String secondsString; int hours = (int) (milliseconds/(1000*60*60)); int minutes = (int) (milliseconds % (1000*60*60))/ (1000*60); int seconds = (int) ((milliseconds%(1000*60*60))%(1000*60)/1000); if (hours > 0) { timerString = hours + ":"; } if (seconds<10){ secondsString = "0" +seconds; }else{ secondsString = ""+seconds; } timerString = timerString+minutes+":"+secondsString; return timerString; } public void navigation() { chipNavigationBar = findViewById(R.id.chipNavigation); chipNavigationBar.setItemSelected(R.id.player, true); //getSupportFragmentManager().beginTransaction().replace(R.id.container, new HomeFragment()).commit(); chipNavigationBar.setOnItemSelectedListener(new ChipNavigationBar.OnItemSelectedListener() { @Override public void onItemSelected(int i) { switch (i) { case R.id.home: startActivity(new Intent(getApplicationContext(), MainActivity.class)); overridePendingTransition(0, 0); finish(); return ; case R.id.player: return ; } } }); } public void playpause() { if(mediaPlayer.isPlaying()){ handler.removeCallbacks(updater); mediaPlayer.pause(); imagePlayPause.setImageResource(R.drawable.play_icon); }else{ imagePlayPause.setImageResource(R.drawable.pause_icon); mediaPlayer.start(); updateseekbar(); } } } code of Adaptersongs.java public class AdapterSongs extends RecyclerView.Adapter<AdapterSongs.ViewHolder2>{ public List<SongsModelClass> songsModelClassList; Context context; Dialog customDialog; public int selectedPosition;//for next and prev song playing public AdapterSongs(List<SongsModelClass> songsModelClassList, Context context) { super(); this.songsModelClassList = songsModelClassList; this.context = context; } @NonNull @Override public ViewHolder2 onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.single_song_row,parent,false); ViewHolder2 viewHolder2 = new ViewHolder2(view); return viewHolder2; } @Override public void onBindViewHolder(@NonNull AdapterSongs.ViewHolder2 holder2, int position) { SongsModelClass songData = songsModelClassList.get(position); holder2.title.setText(songData.getTitle()); //Picasso.get().load(albumdata.getArtworkPath()).into(holder2.thumbnail); holder2.title.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { SharedPreferences sharedPreferences1 = context.getSharedPreferences("login",Context.MODE_PRIVATE); String userType = sharedPreferences1.getString("subscription",""); Log.i("tagconvertstr", "[userType" + userType + "]"); if(songData.getSongType().equalsIgnoreCase("YES")&&userType.equalsIgnoreCase("NO")) { customDialog = new Dialog(context); customDialog.setContentView(R.layout.premium_alert_box); customDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); customDialog.setCancelable(false); customDialog.show(); TextView cancel = customDialog.findViewById(R.id.changeEmail); TextView subscribe = customDialog.findViewById(R.id.confirmEmail); cancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { customDialog.dismiss(); } }); subscribe.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(context,PremiumScreen.class); context.startActivity(i); customDialog.dismiss(); } }); return; } Log.i("tagconvertstr", "[" + songData.getPath() + "]"); Intent intent = new Intent(context,player.class); intent.putExtra("song_name",songData.getTitle()); intent.putExtra("song_path",songData.getPath()); intent.putExtra("album_img",songData.getArtworkPath()); intent.putExtra("album_name",songData.getSongAlbum()); SharedPreferences sharedPreferences = context.getSharedPreferences("songDetails",Context.MODE_PRIVATE); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString("songPath",songData.getPath()); editor.putString("songName",songData.getTitle()); editor.putString("album_img",songData.getArtworkPath()); editor.putString("album_name",songData.getSongAlbum()); editor.apply(); context.startActivity(intent); } }); } @Override public int getItemCount() { return songsModelClassList.size(); } class ViewHolder2 extends RecyclerView.ViewHolder{ // ImageView thumbnail; TextView title; TextView id; public ViewHolder2(@NonNull View itemView) { super(itemView); title = itemView.findViewById(R.id.song_title); } } } ```
Is there any method to track or play the audio items which is in recyclerview outside the activity?
CC BY-SA 4.0
null
2023-01-15T05:07:31.790
2023-01-15T06:29:42.207
2023-01-15T06:29:42.207
20,839,793
20,839,793
[ "java", "android", "mobile-development" ]
75,167,155
1
null
null
-1
63
I'm setting up my Flutter environment (Electric Eel Version), and I'm trying to decide if it is necessary to install Visual Studio for mobile development only. Because I know that Visual Studio requires a large amount of storage, but the Flutter doctor says that it is necessary for Windows development. So, is it okay not to install Visual Studio for Flutter development? Does this affect my flutter environment or not? ``` Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.22621.1105], locale en- US) [√] Android toolchain - develop for Android devices (Android SDK version 33.0.1) [X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [X] Visual Studio - develop for Windows. X Visual Studio not installed; this is necessary for Windows development. Download at https://visualstudio.microsoft.com/downloads/. Please install the "Desktop development with C++" workload, including all of its default components [√] Android Studio (version 2022.1) [√] Connected device (2 available) [√] HTTP Host Availability ! Doctor found issues in 2 categories. ```
Is it required to install visual studio?
CC BY-SA 4.0
null
2023-01-19T02:16:00.217
2023-01-19T09:14:51.833
null
null
14,823,524
[ "flutter", "mobile-development" ]
75,195,950
1
75,197,041
null
0
78
I am using the package [flutter_map](https://pub.dev/packages/flutter_map) to build a map in my app, where there are circles around points. I am trying to turn this layer on/off dynamically, in accordance to the zoom level. Such as the following, where I'm trying to only show the CircleLayerOptions layer if the map zoom level is >14 (zoomed in). ``` FlutterMap( mapController: _mapController, options: MapOptions( center: LatLng(startLat, startLon), zoom: 14, plugins: [MarkerClusterPlugin()], onTap: (_, __) => _popupController.hideAllPopups(), ), layers: [ TileLayerOptions( minZoom: 1, maxZoom: 20, backgroundColor: Colors.white, urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', subdomains: ['a', 'b', 'c'], ), // HERE (show circles around the points if zoomed in enough) <--------------------- (_mapController.zoom > 14) ? CircleLayerOptions(circles: myCircles) : Container(), ] ); ``` The issue with this is that doesn't reload the map at all. ()
Using flutter_map, how to reload map on Pinch Zoom In/Out?
CC BY-SA 4.0
null
2023-01-21T19:23:30.437
2023-01-21T22:36:22.170
null
null
8,846,093
[ "android", "flutter", "dart", "setstate", "mobile-development" ]
75,215,504
1
null
null
1
34
how to make a group of radiobutton so that you can only select one? i wanted to make only one radiobutton that is selectable
how to make a group of radiobutton so that you can only select one?
CC BY-SA 4.0
null
2023-01-23T22:01:58.087
2023-01-23T22:29:11.343
null
null
16,307,513
[ "android", "android-studio", "kotlin", "mobile", "mobile-development" ]
75,241,415
1
null
null
0
86
I am working on a uni project and I've installed the react-native-google places autocomplete search. What I am trying to implement is the following: a. I wanted to have a suggestion to appear when the user enters a city or street name... however, I am not sure how to split the Autocomplete search into multiple fields. b. Since I might not be able to implement option a. I will let the user input the data and I was hoping I could in the code pass that data to the autocomplete (like an object) and fetch the results - basically do a search based on what the user input and select the first item returned. However, I don't see any attribute on the autocomplete form where I could use implement option b. The goal is to get the data through the form, pass it to the search and get the same results as I would when clicking on the dropdown. I would really appreciate any feedback or suggestion, meanwhile, I will continue trying somethings out and do some further search. [](https://i.stack.imgur.com/p9xhm.png) ``` <GooglePlacesAutocomplete placeholder='Search' fetchDetails={true} GooglePlacesSearchQuery={{ rankby: "distance" }} onPress={(data, details = null) => { console.log(data); console.log(data, details); }} query={{ key: 'API_KEY', language: 'en', components: 'country:uk', types: ["supermarket","grocery_or_supermarket","food","store", "establishment"], nearbyPlacesAPI: 'GooglePlacesSearch', radius: 30000 }} enablePoweredByContainer={false} styles={{ container: {flex:0, position: 'absolute', width: '100%', zIndex: 1}, listView: {backgroundColor:"white"} }} /> ``` [](https://i.stack.imgur.com/XhyPc.png)
Split the react-native-google-places-autocomplete into different fields
CC BY-SA 4.0
null
2023-01-26T00:53:37.810
2023-02-12T18:23:55.503
2023-02-12T18:23:55.503
18,422,887
15,039,230
[ "react-native", "google-maps", "google-places-api", "mobile-development" ]
75,264,905
1
null
null
-1
51
I'm trying to set up DeepLinks on my webview app and it's almost done but I've ran into a final obstacle. At the moment my code is working as follows: I have a function declared in SceneDelegate that is triggered when the user clicks the deep link and then proceeds to "clean" the link which is only removing the "myappname://" from the start of it. ``` func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { guard let firstUrl = URLContexts.first?.url else { return } let originalString = firstUrl.absoluteString let desiredString = originalString.components(separatedBy: "sports://").last g_url = desiredString let notificationName = NSNotification.Name(rawValue: "deepLink") NotificationCenter.default.post(name: notificationName, object: nil) } } ``` It then proceeds to store the String containing the link in a variable that is declared at the top as: `var g_url: String?` And sends a notification alert that my ViewController catches and calls the function to handle the deepLink ``` @objc func updateUrl(){ let new_url = SceneDelegate.shared?.g_url if(new_url != nil){ let request = URLRequest(url: URL(string: new_url!)!) self.webView.load(request) } } ``` Where it simply loads that link to the webview. This is where my problem lies, when it tries to load the link it throws this error: ``` WebPageProxy::didFailProvisionalLoadForFrame: frameID=3, isMainFrame=1, domain=WebKitErrorDomain, code=101, isMainFrame=1 ``` The problem I think has something to do with the way the String is being encoded or handled, especially since if I use the exact same url but hard code it into the request it works with no issue. I'm not sure what I'm doing wrong and would really appreciate some help, thank you :)
WKWebview not able to load dynamic url
CC BY-SA 4.0
null
2023-01-28T01:58:58.143
2023-02-06T23:06:56.033
null
null
16,591,356
[ "ios", "swift", "uikit", "wkwebview", "mobile-development" ]
75,282,408
1
null
null
0
207
After upgrading to Flutter 3.7.0 I got many errors when trying to run any app (Project). The following log is an example from one of my projects [](https://i.stack.imgur.com/vWc6e.jpg) Can anyone help me solving this problem?
Many errors after upgrading to Flutter 3.7.0
CC BY-SA 4.0
null
2023-01-30T09:27:56.570
2023-01-30T09:27:56.570
null
null
11,878,615
[ "flutter", "android-studio", "dart", "mobile-development" ]
75,318,486
1
null
null
0
46
I am trying to create a recycler view with data from another activity. I need to transfer data from one activity to the recycler view activity without it opening the recycler view activity. Because only when I press another button do I want to go to the next activity. I have tried using intent, however `startActivity(intent)` always opens the other activity. I also tried using Share preferences to save the data and retrieve it in the other activity. However, `Base64.DEFAULT` was not working for me. ``` public void sendData(Bitmap images, String image_class) { Intent send = new Intent(getApplicationContext(), Scanned_List_Activity.class); send.putExtra("image_class",image_class); send.putExtra("image", images); startActivity(send); } ```
How to transfer data from one activity to another in android studio without opening the new activity?
CC BY-SA 4.0
null
2023-02-02T03:47:52.353
2023-02-02T08:52:08.180
2023-02-02T08:52:08.180
21,017,714
15,399,743
[ "android", "android-studio", "android-intent", "mobile-development" ]
75,351,639
1
null
null
-1
19
I am working on a mobile app (on react-native) that will help me do a certain task (say fill a form) only if I am in close proximity to a discoverable device (say router or any other device with a valid BSSID) How do I find the BSSID of devices near me?? On ubuntu its as simple as `nmcli dev wifi` [img showing result of above command](https://i.stack.imgur.com/of627.png) How can I do this on my react-native app. I am new to react-native and mobile development and I do not know where to start.
How to find the BSSID of routers near me on phone?
CC BY-SA 4.0
null
2023-02-05T10:40:59.753
2023-02-05T10:54:05.040
2023-02-05T10:41:46.480
19,549,993
19,549,993
[ "react-native", "network-programming", "wifi", "mac-address", "mobile-development" ]
75,361,358
1
null
null
-1
18
I am working on developing a workflow for a mobile application . The application uses a 3rd party app, the use case is clear On exiting the 3rd party app by unexpected means( liking closing the window) i want some kind of event based workflow setup to indicate my application that the user has exited the 3rd party application. Is there some kind of Example Workflows that i could refer for this use case ..
Event Based Workflow for Exiting 3rd Party App
CC BY-SA 4.0
null
2023-02-06T12:32:20.190
2023-02-06T12:32:20.190
null
null
9,114,276
[ "android", "ios", "mobile-development" ]
75,362,471
1
null
null
0
20
I am trying to build a image picker using flutter. I want the user to be able to select an image and upload it onto firebase storage so that it can be later retrieved. I am using an image picker to select the image from the gallery and I am then setting the image selected as a file. I am then creating a reference called `firebaseStorageRef` and using `firebaseStorageRef.putFile(_selectedImage!)` to upload the data. ``` Restarted application in 553ms. [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: [firebase_storage/object-not-found] No object exists at the desired reference. ``` ``` import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; import 'package:flutter_blog/views/homePage.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); runApp(const MainApp()); } class MainApp extends StatelessWidget { const MainApp({super.key}); @override Widget build(BuildContext context) { return const MaterialApp( title: "Blog App", themeMode: ThemeMode.dark, debugShowCheckedModeBanner: false, home: homePage()); } } ``` ``` import 'dart:io'; import 'package:firebase_storage/firebase_storage.dart'; import 'package:flutter/material.dart'; import 'package:flutter_blog/services/crud.dart'; import 'package:image_picker/image_picker.dart'; import 'package:random_string/random_string.dart'; import 'package:firebase_core/firebase_core.dart'; class CreateBlog extends StatefulWidget { const CreateBlog({super.key}); @override State<CreateBlog> createState() => _CreateBlogState(); } class _CreateBlogState extends State<CreateBlog> { late String authorName, title, desc; bool isloading = false; CRUDMethods crudMethods = new CRUDMethods(); File? _selectedImage; Future getImage() async { var image = await ImagePicker().pickImage(source: ImageSource.gallery); if (image == null) return; final image_path = File(image.path); setState(() { _selectedImage = image_path; }); } uploadBlog() async { if (_selectedImage != null) { // Uploading image to Firestore setState(() { isloading = true; }); var firebaseStorageRef = FirebaseStorage.instance .ref() .child("blogImages") .child("${randomAlphaNumeric(9)}.jpg"); try { var task = firebaseStorageRef .putFile(_selectedImage!) .whenComplete(() => Navigator.pop(context)); } catch (error) { print(error); } } else {} } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text( "Flutter", style: TextStyle( fontSize: 22, color: Colors.black, ), ), Text( "Blog", style: TextStyle(fontSize: 22, color: Colors.blue), ) ]), backgroundColor: Colors.transparent, elevation: 0, actions: <Widget>[ GestureDetector( onTap: () { uploadBlog(); }, child: Container( padding: EdgeInsets.symmetric(horizontal: 16), child: Icon( Icons.file_upload, color: Colors.black, ))) ], ), backgroundColor: Colors.white, body: isloading ? Container( alignment: Alignment.center, child: CircularProgressIndicator(color: Colors.teal), ) : Container( child: Column( children: <Widget>[ SizedBox( height: 10, ), GestureDetector( onTap: () { getImage(); }, child: _selectedImage != null ? Container( margin: EdgeInsets.symmetric(horizontal: 30), height: 150, width: MediaQuery.of(context).size.width, child: Image.file( _selectedImage!, fit: BoxFit.cover, ), ) : Container( margin: EdgeInsets.symmetric(horizontal: 30), height: 150, width: MediaQuery.of(context).size.width, child: Icon(Icons.add_a_photo), decoration: BoxDecoration( color: Colors.blueAccent, borderRadius: BorderRadius.circular(6)), ), ), SizedBox( height: 8, ), Container( margin: EdgeInsets.symmetric(horizontal: 30), child: Column( children: <Widget>[ TextField( decoration: InputDecoration(hintText: "Author Name"), onChanged: (val) { authorName = val; }, ), TextField( decoration: InputDecoration(hintText: "Title"), onChanged: (val) { title = val; }, ), TextField( decoration: InputDecoration(hintText: "Description"), onChanged: (val) { desc = val; }, ) ], ), ) ], )), ); } } ``` ``` import 'package:firebase_storage/firebase_storage.dart'; import 'package:flutter/material.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; class CRUDMethods { Future<void> addData(blogData) async { FirebaseFirestore.instance .collection("blogs") .add(blogData) .catchError((e) { print(e); }); } } ```
Error while uploading image onto Firebase Storage
CC BY-SA 4.0
null
2023-02-06T14:14:26.440
2023-02-06T14:14:26.440
null
null
15,399,743
[ "flutter", "firebase", "firebase-storage", "mobile-development", "flutter-image-picker" ]
75,411,065
1
null
null
0
10
Does anybody know how can I create an app cross-platform or native that locks your phone selected time like in oneplus's "zen mode" app? It doesn't really matter which programing language or framework it is. I appreciate every kind of answer haven't found anything that meet my needs
Block screen for selected time
CC BY-SA 4.0
null
2023-02-10T12:23:10.843
2023-02-10T12:23:10.843
null
null
21,152,326
[ "mobile-application", "mobile-development" ]
75,423,475
1
null
null
0
26
I am trying to develop a function in my Android application that will alert me when a user changes the device fingerprint without having to call the device biometric prompt. I have attempted this using a biometric library in my code. I only generated the secret key ,when I have open the app for the first time using below code: ``` if ( secretKey == null || secretKey.isDestroyed() ){ try { Log.d("tt", "900000"); generateSecretKey(new KeyGenParameterSpec.Builder( "KEY_NAME", KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT) .setBlockModes(KeyProperties.BLOCK_MODE_CBC) .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_PKCS7) .setUserAuthenticationRequired(true) // Invalidate the keys if the user has registered a new biometric // credential, such as a new fingerprint. Can call this method only // on Android 7.0 (API level 24) or higher. The variable // "invalidatedByBiometricEnrollment" is true by default. .setInvalidatedByBiometricEnrollment(true).setUnlockedDeviceRequired() .build()); secretKey = getSecretKey(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (NoSuchProviderException e) { e.printStackTrace(); } catch (InvalidAlgorithmParameterException e) { e.printStackTrace(); } catch (UnrecoverableKeyException e) { e.printStackTrace(); } catch (CertificateException e) { e.printStackTrace(); } catch (KeyStoreException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } ``` However, when I open the settings and change only the name of the fingerprint, it alerts me that the fingerprint has changed, even though I did not add a new fingerprint. It raised an IllegalBlockSizeException error as shown in the figure [IllegalBlockSizeException error](https://i.stack.imgur.com/1pixU.png) Tried this on a Galaxy S7 Android 8 , Can someone help me figure out how to detect actual changes to fingerprints? ``` private Boolean initCipher (Cipher cipher ){ try { SecretKey finalSecretKey = getSecretKey(); cipher.init(Cipher.ENCRYPT_MODE, finalSecretKey); return true; } catch (KeyPermanentlyInvalidatedException e) { Log.e("invalidchanged","yesss"); Toast.makeText(getApplicationContext(), "Biometric changed", Toast.LENGTH_SHORT).show(); return false; } catch (InvalidKeyException e) { return false; //throw new RuntimeException(e); } catch (UnrecoverableKeyException e) { e.printStackTrace(); } catch (CertificateException e) { e.printStackTrace(); } catch (KeyStoreException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); }catch (Exception e){ e.printStackTrace(); } return false; } private void isBiometricChanged(){ Cipher cipher = getCipher(); SecretKey finalSecretKey = null; try { finalSecretKey = getSecretKey(); } catch (KeyStoreException e) { e.printStackTrace(); } catch (CertificateException | IOException | NoSuchAlgorithmException | UnrecoverableKeyException e ) { e.printStackTrace(); } // BiometricPrompt.CryptoObject(cipher); isBiometricChanged = !(initCipher(cipher)); if (finalSecretKey == null || finalSecretKey.isDestroyed()){ return; } if(finalSecretKey != null && !isBiometricChanged ){ try { cipher.doFinal( // plaintext-string text is whatever data the developer would like // to encrypt. It happens to be plain-text in this example, but it // can be anything "plaintext-string".getBytes(Charset.defaultCharset())); } catch (BadPaddingException e) { Log.e("87777777777777777", "errr"); e.printStackTrace(); } catch (IllegalBlockSizeException e) { BiometricManager biometricManager = BiometricManager.from(this); Log.e("999999999999999", "errr"); Log.e("ci:::", String.valueOf(cipher)); Log.e("ci1:::", String.valueOf(initCipher(cipher))); Log.e("ci2:::", String.valueOf(finalSecretKey.toString())); Log.e("ci3:::", String.valueOf(e)); Log.e("ci4:::", String.valueOf(isBiometricChanged)); Log.e("ci5:::", String.valueOf(finalSecretKey)); isBiometricChanged = true; Toast.makeText(getApplicationContext(), "changed ", Toast.LENGTH_SHORT).show(); e.printStackTrace(); // throw new RuntimeException(e); } catch (InvalidKeyException e) { throw new RuntimeException(e); } } } private void generateSecretKey(KeyGenParameterSpec keyGenParameterSpec) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException { KeyGenerator keyGenerator = KeyGenerator.getInstance( KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore"); keyGenerator.init(keyGenParameterSpec); keyGenerator.generateKey(); } private SecretKey getSecretKey() throws KeyStoreException, CertificateException, IOException, NoSuchAlgorithmException, UnrecoverableKeyException { KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore"); // Before the keystore can be accessed, it must be loaded. keyStore.load(null); return ((SecretKey)keyStore.getKey("KEY_NAME", null)); } ```
Detecting fingerprint changes in an Android application without calling the device biometric prompt
CC BY-SA 4.0
null
2023-02-11T21:41:45.983
2023-02-12T06:18:52.380
2023-02-12T06:18:52.380
15,021,037
15,021,037
[ "java", "android", "mobile-development", "android-biometric", "biometricmanager" ]
75,432,599
1
null
null
0
33
I have some scrolls in my app and they work perfectly in the android but in the ios they don't work properly when they are scrolled to the end. [](https://i.stack.imgur.com/ARSgH.jpg) it should be like this: [](https://i.stack.imgur.com/lBLCm.jpg) screen code: the 85 bottom padding is for bottom navigation. ``` ListView.separated( padding: EdgeInsets.only( bottom: constraints.maxHeight > (size.height - 70) ? 85 : 0), itemBuilder: (context, index) { ListModel list = bookProvider.lists[index]; return HorizontalList( list: list, itemOnTap: (index) => Navigator.push( context, MaterialPageRoute( builder: (context) => BookDetailsScreen( book: list.books[index]), )), ); ```
Flutter ios does not scroll properly to the end
CC BY-SA 4.0
null
2023-02-13T06:42:35.520
2023-02-13T07:19:38.287
2023-02-13T07:06:21.710
8,277,033
8,277,033
[ "ios", "flutter", "dart", "mobile", "mobile-development" ]
75,446,619
1
null
null
-1
16
[enter image description here](https://i.stack.imgur.com/V2Hhf.png)enter image description here* As you can see on the image, app and the other libs are seen as unresolved references I did all implementation given installation guide in mongodb web site,
Realm App could not be imported kotlin-mongo realm
CC BY-SA 4.0
null
2023-02-14T10:37:44.180
2023-02-14T10:38:52.817
2023-02-14T10:38:52.817
21,210,530
21,210,530
[ "mongodb", "android-studio", "kotlin", "realm", "mobile-development" ]
75,450,173
1
null
null
0
39
I'm a beginner in mobile app development and I'm writing an app using React Native to practice. I want to add the box on one of my pages but I don't know how to test it. [I want to try something like this picture](https://i.stack.imgur.com/XuE8y.png) ChatGPT gives lots of suggestions and I think there is some good ones, but I want to get some answers from real developers. Also this is my first question here :)
Is it possible to test 'Image Upload' function on my React Native app without database/server?
CC BY-SA 4.0
null
2023-02-14T15:46:24.967
2023-02-15T17:18:47.200
null
null
20,826,515
[ "javascript", "android", "react-native", "file-upload", "mobile-development" ]
75,451,576
1
null
null
0
23
I have an Activity called `LoginActivity` which, in turn, creates an instance of `Auth` class, passing `this` to it (`Auth` has `context: Context` in constructor): ``` override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val authinstance = Auth(this); setContentView(R.layout.activity_login) ... ``` ``` class Auth constructor(val context: Context) { ... ``` `Auth` in turn starts a new Activity: ``` val intent = Intent(context, AuthWebViewActivity::class.java) intent.putExtra("url", url) startActivity(context,intent,null) ``` From `AuthWebViewActivity` some data must come back to `Auth`. How do I handle this? I am not sure that starting another Activity from a class like this is a good idea, there is probably a better way. However I would like to keep `AuthWebViewActivity` simple and handle all the authentication code in `Auth`.
How do I return data from Activity to calling class?
CC BY-SA 4.0
null
2023-02-14T17:59:27.947
2023-02-14T17:59:27.947
null
null
6,109,708
[ "android", "kotlin", "android-activity", "mobile-development" ]
75,463,464
1
null
null
0
22
I would like to use the Huawei ML kit to implement the text recognition service in my Cordova project (Android). However, I only want to use this service and not all the other services offered by the kit. Currently, I am using the ML Kit plugin for Cordova, but when I generate the application, it takes about 150MB because it includes the whole kit. `cordova plugin add @hmscore/cordova-plugin-hms-ml` [https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides-V1/introduction-0000001050765773-V1](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides-V1/introduction-0000001050765773-V1) [https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/text-recognition-0000001051005809](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/text-recognition-0000001051005809) [https://github.com/HMS-Core/hms-cordova-plugin/tree/master/cordova-plugin-hms-ml](https://github.com/HMS-Core/hms-cordova-plugin/tree/master/cordova-plugin-hms-ml) I would like to reduce the size of the application by removing the services from the kit that I am not using and only include the text recognition service in the final application. Does anyone know how I can achieve this? I would like to know if there is any way to customize the ML Kit plugin for Cordova or if there is any other solution to achieve this goal. I would appreciate any advice or suggestions on how I can reduce the size of the application and use only the text recognition service of the Huawei ML Kit in my Cordova project.
How to Implement Text Recognition Service from Huawei ML Kit in Cordova and Reduce Application Size
CC BY-SA 4.0
null
2023-02-15T17:31:10.880
2023-02-16T09:35:48.783
2023-02-16T09:35:48.783
21,221,277
21,221,277
[ "cordova", "huawei-mobile-services", "mobile-development", "huawei-developers", "huawei-ml-kit" ]
75,476,743
1
null
null
0
9
Dear Android App Developers and Experts, Recently I submitted an Android app to Google for approval, today I received an update that app is not approved. can I check the why this app is not approved? [](https://i.stack.imgur.com/djhSY.png) [](https://i.stack.imgur.com/CYfa6.png) Thank you!
Android App Release Not Approved - Full Rollout
CC BY-SA 4.0
null
2023-02-16T18:53:43.923
2023-02-16T18:53:43.923
null
null
9,343,408
[ "android", "sdk", "mobile-development" ]
75,499,744
1
null
null
0
13
Does anybody know, if there is a way to access the transactions made from (Google/Apple)Pay on the device? I think of a way where the user first needs to grant the access to a specific card on his wallet to the app, before the sync is then started. I am looking for a way to somehow verificate billings, which are initiated by our app, without handling the payment process itself. So I just want to "observe" it. Thanks alot for any advice in the correct direction I've been researching several different API gateway solutions to process payments, or to access bank account records, but that's all not really what the users will feel comfortable with.
Access GooglePay / ApplePay transactions in mobile (flutter) app
CC BY-SA 4.0
null
2023-02-19T11:17:14.990
2023-02-19T11:17:14.990
null
null
7,057,908
[ "payment", "mobile-development", "google-pay" ]
75,570,256
1
null
null
0
14
I can not imagine how can I use located in VPS due to ? Should I try to download the database to Mobile each time I want to get some data and then implement operations with them? Or I need to create a and operate with data in the VPS itself? I just think of using SQL or Entity Framework.
VPS Database and MAUI how to use?
CC BY-SA 4.0
null
2023-02-26T06:04:31.630
2023-02-26T06:08:41.993
2023-02-26T06:08:41.993
21,287,170
21,287,170
[ "c#", ".net", "database", "maui", "mobile-development" ]
75,570,270
1
null
null
0
74
I made a form to add an image and its information in a ListView.builder(), this is the image screenshot and code: [](https://i.stack.imgur.com/1jBkD.png) ``` class _AddNewProductState extends State<AddNewProduct> { String? dropdownValue = 'Fruits'; String? productName; int? productPrice; Future<void> openMobileImagePicker() async { final XFile? pickedMobileImage = await ImagePicker().pickImage(source: ImageSource.gallery); if (pickedMobileImage != null) { setState(() { ImageFiles.mobileImage = File(pickedMobileImage.path); }); } } @override Widget build(BuildContext context) { return Scaffold( body: SafeArea( child: Padding( padding: const EdgeInsets.all(15), child: SingleChildScrollView( child: Center( child: Column( children: [ const Text( 'Add New Product To The Market', style: TextStyle( fontWeight: FontWeight.bold, fontSize: 25, ), ), Padding( padding: const EdgeInsets.all(15), child: Container( width: double.infinity, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(30), boxShadow: const [ BoxShadow( offset: Offset(0, 10), blurRadius: 30, ) ], ), child: Padding( padding: const EdgeInsets.all(25), child: Form( key: UniversalKey.formKey, child: Column( children: [ ElevatedButton( onPressed: () { setState(() { openMobileImagePicker(); }); }, child: const Text('Add Product Image'), ), const SizedBox( height: 20, ), Container( height: 120, width: 120, decoration: const BoxDecoration( boxShadow: [ BoxShadow( blurRadius: 15, color: Colors.grey, ) ], shape: BoxShape.circle, ), child: CircleAvatar( backgroundImage: (ImageFiles.mobileImage != null) ? Image.file(ImageFiles.mobileImage!, fit: BoxFit.fill) .image : null), ), const SizedBox( height: 20, ), TextFormField( onSaved: (value) { setState(() { ProductDetails.productName = value!; }); }, decoration: const InputDecoration( labelText: 'Product Name', hintText: 'Add Product Name'), ), const SizedBox( height: 20, ), TextFormField( onSaved: (value) { setState(() { ProductDetails.productPrice = value!; }); }, decoration: const InputDecoration( labelText: 'Product Price', hintText: 'Add Product Price'), ), const SizedBox( height: 20, ), DropdownButton<String>( value: dropdownValue, items: productCategory, onChanged: (item) => setState(() => dropdownValue = item), ), const SizedBox( height: 20, ), ElevatedButton( onPressed: () { listOfProducts.add( { 'productImage' : ProductDetails.productImage, 'productName' : ProductDetails.productName, 'productPrice' : ProductDetails.productPrice, 'productCategory' : dropdownValue, } ); } , child: const Text('Add Product!')) , const SizedBox( height: 20, ), ElevatedButton(onPressed: () { setState(() { Navigator.push(context, MaterialPageRoute(builder: (context) => const GroceryPage(),),); }); }, child: const Text('Go To Hompage'),), ], ), ), ), ), ) ], ), ), ), ), ), ); } } ``` When I tap 'Submit' it's supposed to add the information in a ListView.builder() , this is the image screenshot and code: [](https://i.stack.imgur.com/YiW4V.jpg) ``` class ProductsListView extends StatelessWidget { const ProductsListView({ Key? key, }) : super(key: key); @override Widget build(BuildContext context) { return ListView.builder( scrollDirection: Axis.horizontal, itemCount: fruitsList.length, itemBuilder: (BuildContext context, int index) { return ClipRect( child: Container( width: 140.0, decoration: BoxDecoration( borderRadius: BorderRadius.circular(15.0), color: Colors.white, boxShadow: const [ BoxShadow( blurRadius: 10, color: Colors.black, ), ], ), margin: const EdgeInsets.all(10.0), child: Padding( padding: const EdgeInsets.fromLTRB(20, 10, 10, 10), child: Column( children: [ Image.file( listOfProducts[index]['productImage'] , height: 80.0, width: 90.0, ), const SizedBox( height: 15, ), Row( children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( listOfProducts[index]['productName'], style: const TextStyle( fontSize: 15.0, fontWeight: FontWeight.bold, ), ), Text( listOfProducts[index]['productCategory'], textAlign: TextAlign.left, style: const TextStyle( height: 1.5, color: kDarkGrey, fontSize: 12.5, fontWeight: FontWeight.bold, ), ), ], ), ], ), Row( children: [ Text( listOfProducts[index]['productPrice'], style: const TextStyle( fontWeight: FontWeight.bold, ), ), const Spacer(), const AddProduct(), ], ) ], ), ), ), ); }, ); } } ``` But the result is: [](https://i.stack.imgur.com/BsJL1.png) How can I fix it? I tried many ways with no success, I don't know which part of the code causes the error? Relative code snippets: ``` class ImageFiles { static File? mobileImage; static Uint8List? webImage; } class ProductDetails { static File? productImage; static String? productName; static String? productPrice; } List<Map<String, dynamic>> listOfProducts = [ ]; ```
Type 'Null' is not a subtype of type 'File' problem
CC BY-SA 4.0
null
2023-02-26T06:08:39.933
2023-02-26T08:05:47.380
null
null
11,878,615
[ "android", "flutter", "dart", "mobile-development" ]
75,580,097
1
null
null
0
11
i am trying to implement SSL pinning to my flutter app. I am using a "certificate.pem" file. I have a custom HttpService class, all the http requests are made from methods which belongs to this class. ``` class HttpService { late IOClient _ioClient; static final HttpService service = HttpService._init(); HttpService._init(); // TODO: get server certificate, load and add it to the SecurityContext Future<void> setTrustedCertificate() async { final sslCert = await rootBundle.load('assets/cert/certificate.pem'); SecurityContext securityContext = SecurityContext(withTrustedRoots: false); securityContext.setTrustedCertificatesBytes(sslCert.buffer.asInt8List()); HttpClient httpClient = HttpClient(context: securityContext); httpClient.badCertificateCallback = (X509Certificate cert, String host, int port) => false; _ioClient = IOClient(httpClient); } Future<http.Response> getRequest({ required Uri path, required Map<String, String> requestHeaders}) async { return await _ioClient.get(path, headers: requestHeaders); } Future<http.Response> postRequest({ required Uri path, required Map<String, String> requestHeaders, required Object? requestBody}) async { return await _ioClient.post(path, headers: requestHeaders, body: requestBody); } } ``` Also i call the "setTrustedCertificate()" method at the main function. ``` void main() async { SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(statusBarColor: Colors.transparent)); WidgetsFlutterBinding.ensureInitialized(); await HttpService.service.setTrustedCertificate(); SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown, ]); runApp(MyApp()); } ``` But i am getting this error: ``` flutter: HandshakeException: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: application verification failure(handshake.cc:393)) ``` What might be causing this problem?
Flutter how to allow to certain certificates on http request? (SSL Pinning)
CC BY-SA 4.0
null
2023-02-27T11:48:59.290
2023-02-27T11:48:59.290
null
null
10,963,223
[ "flutter", "ssl", "mobile-development", "sslpinning" ]
75,580,549
1
null
null
0
27
[](https://i.stack.imgur.com/EQwTt.png)I have created a virtual device in android studio and when launching that VD it just terminates throwing the message " The emulator process for AVD Pixel_*5_*API_23 has terminated". I deleted the device and created another device, it still shows the same error. I have uninstalled and installed it again (Android Studio) 2,3 times, I have JDK installed, SDK is also installed and the necessary path is also provided.
Emulator process for AVD has terminated
CC BY-SA 4.0
null
2023-02-27T12:34:07.670
2023-02-27T12:34:07.670
null
null
15,049,426
[ "android", "mobile", "mobile-development" ]
75,617,728
1
null
null
-1
5
I can't install flutter due to unhandled exception. I tried but it shows unable to create dart snapshot for flutter tool.
how can solve unhandled exception occurs in terminal while flutter doctor command running
CC BY-SA 4.0
null
2023-03-02T15:44:05.803
2023-03-02T15:44:05.803
null
null
21,285,786
[ "android", "flutter", "mobile-development", "unhandled-exception" ]
75,632,963
1
null
null
0
21
I'm writing a code about the type of flower that will grow if certain conditions are met. The problem is my code skips my `if` statement and jumps straight to the `else` statement – even when conditions on `if` are met. I have tried to compare my Strings using `.equals()` instead of `==` but it still doesn't work. What could I be doing wrong? ``` public void checkButton(View view) { EditText seedColourEditText = findViewById(R.id.seedColourEditText); EditText soilTemperature = findViewById(R.id.soilTemperature); EditText soilMoisture = findViewById(R.id.soilMoisture); TextView outputTextView = findViewById(R.id.outputTextView); String seedColor = seedColourEditText.toString(); String soilMo = soilMoisture.getText().toString(); int temp = Integer.parseInt(soilTemperature.getText().toString()); if (seedColor == "red") { if (soilMo == "wet") if (temp >= 75) outputTextView.setText("Sunflower will grow"); } else { outputTextView.setText("A dandelion will grow"); } } ``` I have tried searching on the Web but couldn't find help about why my `if` statement is skipped.
If Statement Skipped
CC BY-SA 4.0
null
2023-03-04T00:41:20.593
2023-03-04T17:48:40.917
2023-03-04T17:48:40.917
2,164,365
14,860,342
[ "java", "android", "mobile-development" ]
75,633,195
1
null
null
0
19
I have designed a couple of android apps , of varying levels of complexity , but since my job puts me on the road most days, this has left me with no better options than a laptop, tablet, and phone . Now, the first two are out, due to several unrelated issues . This leaves me with an android phone , that has only 2GB of RAM.The solution I'm using is to use Google CoLab to write the APK in python. Because i have had repeated bugs appear , one following the one i just fixed, leads me to believe that there is something inherently wrong with my approach altogether; that's why I am not going to explain my previous problems , or current issues , until I can get some feedback on the efficacy of this approach to creating an apk using a mobile device . Seemingly unconnected issues , one after the other. As i eliminated one problem , a completely different one developed shortly thereafter. From errors in compiling, to apis that suddenly ignore their own configuration files. A detailed description of all the issues would be 6 or 7 times the text size of this question . Does anyone know of anything FUNDAMENTAL that I'm doing wrong here
Creating an android app using mobile phone
CC BY-SA 4.0
null
2023-03-04T01:53:32.523
2023-03-04T01:53:32.523
null
null
21,329,321
[ "android", "google-cloud-firestore", "cloud", "mobile-development", "apk-signing" ]