• Breaking News

    Tuesday, August 24, 2021

    Android Dev - Weekly Questions Thread - August 24, 2021

    Android Dev - Weekly Questions Thread - August 24, 2021


    Weekly Questions Thread - August 24, 2021

    Posted: 24 Aug 2021 06:00 AM PDT

    This thread is for simple questions that don't warrant their own thread (although we suggest checking the sidebar, the wiki, our Discord, or Stack Overflow before posting). Examples of questions:

    • How do I pass data between my Activities?
    • Does anyone have a link to the source for the AOSP messaging app?
    • Is it possible to programmatically change the color of the status bar without targeting API 21?

    Large code snippets don't read well on reddit and take up a lot of space, so please don't paste them in your comments. Consider linking Gists instead.

    Have a question about the subreddit or otherwise for /r/androiddev mods? We welcome your mod mail!

    Also, please don't link to Play Store pages or ask for feedback on this thread. Save those for the App Feedback threads we host on Saturdays.

    Looking for all the Questions threads? Want an easy way to locate this week's thread? Click this link!

    submitted by /u/AutoModerator
    [link] [comments]

    Bypassing in-app purchases: Android vs iOS

    Posted: 24 Aug 2021 05:12 AM PDT

    Hi all,

    While iOS and Android are different in many ways, they offer very similar fundamental platform security features (signing, app sandboxing, …). But there still seems to be a common misconception that iOS is inherently more secure for apps due to how closed the platform is, while in fact very similar methods can be used to easily tamper with apps on both platforms.

    To demonstrate this, we worked out a practical example, where we unlock paid features for apps of both platforms using the same techniques:

    • Analyzing the app
    • Patching the code and repackaging the app
    • Modifying runtime behaviour through function hooking

    This shows that while the tools and some details are platform specific, it's quite easy to tamper with apps on both platforms using the same general techniques. https://www.guardsquare.com/blog/misconceptions-about-mobile-platform-security

    submitted by /u/Floni
    [link] [comments]

    Kotlin’s Sealed Interfaces & The Hole in The Sealing

    Posted: 24 Aug 2021 08:09 AM PDT

    Huge argument lists when using Jetpack Compose

    Posted: 24 Aug 2021 12:55 AM PDT

    Every screen in my app is a composable function. Between the outermost composable for every screen and the single, smaller composables that make up the screen, there is a "Body" (I guess you could also call it "Content") composable that contains all the smaller composables. For one, this helps me keep a better overview in the outermost composable, but I also need this for the preview because the outermost composable takes the ViewModel argument which the preview doesn't have.

    The problem is, of course, I have to move all the state and callbacks through this Body composable. This leads to huge argument lists. What am I doing wrong here? I hope this question is not considered a "help me" post because it's more of a general discussion on how to approach this.

    @Composable fun AddEditTaskScreen( viewModel: AddEditTaskViewModel = hiltViewModel(), navigateUp: () -> Unit, navigateBackWithResult: (AddEditTaskViewModel.AddEditTaskResult) -> Unit, ) { val isEditMode = viewModel.isEditMode val uiState by viewModel.uiState.collectAsState(null) val scaffoldState = rememberScaffoldState() val bodyScrollState = rememberScrollState() val context = LocalContext.current LaunchedEffect(Unit) { viewModel.events.collectLatest { event -> when (event) { is AddEditTaskViewModel.Event.NavigateBackWithResult -> navigateBackWithResult(event.result) is AddEditTaskViewModel.Event.NavigateUp -> navigateUp() is AddEditTaskViewModel.Event.ShowResetDayCompletedMessage -> scaffoldState.snackbarHostState.showSnackbar(context.getString(R.string.task_day_reset_completed)) AddEditTaskViewModel.Event.ShowArchiveTaskCompletedMessage -> scaffoldState.snackbarHostState.showSnackbar(context.getString(R.string.archive_task_completed)) AddEditTaskViewModel.Event.ShowUnarchiveTaskCompletedMessage -> scaffoldState.snackbarHostState.showSnackbar(context.getString(R.string.unarchive_task_completed)) } } } // how do I avoid this growing into a monster? AddEditTaskBody( isEditMode = isEditMode, uiState = uiState, onTaskNameInputChanged = viewModel::onTaskNameInputChanged, onMinutesGoalInputChanged = viewModel::onMinutesGoalInputChanged, onWeekdaySelectionChanged = viewModel::onWeekdaysSelectionInputChanged, onNavigateUpClicked = viewModel::onNavigateUpClicked, onSaveClicked = viewModel::onSaveClicked, onResetDayClicked = viewModel::onResetDayClicked, onDismissResetDayConfirmationDialog = viewModel::onDismissResetDayConfirmationDialog, onResetDayConfirmed = viewModel::onResetDayConfirmed, onArchiveTaskClicked = viewModel::onArchiveTaskClicked, onDismissArchiveTaskConfirmationDialog = viewModel::onDismissArchiveTaskConfirmationDialog, onArchiveTaskConfirmed = viewModel::onArchiveTaskConfirmed, onUnarchiveTaskClicked = viewModel::onUnarchiveTaskClicked, onDismissUnarchiveTaskConfirmationDialog = viewModel::onDismissUnarchiveTaskConfirmationDialog, onUnarchiveTaskConfirmed = viewModel::onUnarchiveTaskConfirmed, onDeleteTaskClicked = viewModel::onDeleteTaskClicked, onDismissDeleteTaskConfirmationDialog = viewModel::onDismissDeleteTaskConfirmationDialog, onDeleteTaskConfirmed = viewModel::onDeleteTaskConfirmed, scaffoldState = scaffoldState, bodyScrollState = bodyScrollState ) } 
    submitted by /u/Fr4nkWh1te
    [link] [comments]

    70+ Jetpack Compose Android App Projects for Beginners, Intermediate and Experienced Developers

    Posted: 24 Aug 2021 08:18 AM PDT

    Solo Devs, What's your app updates development to the publishing process like?

    Posted: 24 Aug 2021 04:12 AM PDT

    Hey guys,

    I am myself an indie dev for a while, after I've added all the features to the app that I have initially planned, the app has been doing good, I have added/adding some more features.

    However, I just want to know how other indie developers are doing? what's your process for each app update? do you have any checklist or stages that you follow?

    submitted by /u/sloppyind
    [link] [comments]

    Admob accounts and contacting the Admob support team

    Posted: 24 Aug 2021 05:14 AM PDT

    How do you contact the AdMob support team in 2021? An year ago, I cancelled my AdMob account along with its Adsense account. Now I have an paid app that I want to make free because there are tons of free good alternatives available and as such very few few people will go for the paid option.

    I read on the help centre that if I have used Admob before, I'll need to create a new one using a different email id so I tried that. 24hrs later I was told I already have an aob account associated with 'my_old_email'. After that failed, I tried to create a new using my father's google account. We don't live together so our addresses don't match. But even then I was told I already have an duplicate Admob account associated with 'insert_random_email_id_here'. No matter what I try, I get the same result.

    I tried contacting support but the contact support flow doesn't display the email option anymore. There is only community option. I asked the same question that has been asked in the community probably a thousand times but got no answers.

    I found a support form for account login issues on Admob support center but the form's submit button doesn't work. It says "please refresh and try again.."

    So, now I'm basically waiting for the Admob support team to fix the support form so I can get an Admob account and monetize my existing and future apps.

    I could try going for unity ads but I heard they only provide video ads. Also, I mean this respectfully, I have never used facebook and don't plan to.

    What do y'all think?

    submitted by /u/_a_wandering_spirit
    [link] [comments]

    Need a simple and easy-to-use Image Carousel for your awesome Android project? Try Why Not! Image Carousel! library. ��

    Posted: 24 Aug 2021 04:38 AM PDT

    WearOS Tile Feature Pray Times Application

    Posted: 24 Aug 2021 08:13 AM PDT

    When I first saw the WearOS Tiles feature, I thought about a Pray Times application could be a good use case to see all of the times with just one swipe directly from watchface. So I have developed a basic pray times application.
    https://github.com/volkansahin45/Pray-Times

    submitted by /u/volkansahin45
    [link] [comments]

    An upgraded version of an app made for #AndroidDevChallenge week #1 using all the latest Jetpack Libraries and more

    Posted: 24 Aug 2021 08:12 AM PDT

    An upgraded version of an app made for #AndroidDevChallenge week #1 using all the latest Jetpack Libraries and more

    After the stable release of Jetpack Compose, I had a reason to re-visit the app I had made for the challenge to play around with the stable release. Information coming from PetFinder and cached in Room for the detail screen. More details on the GitHub repo.

    Open sourced it to invite discussions, learn something or to give an example of how to use any of the included libraries for whoever might be curious.

    Built using:

    • Jetpack Compose
    • MVVM
    • Dagger2 + Hilt
    • Jetpack Navigation
    • Accompanist Navigation
    • Accompanist Insets
    • Coroutines + Flow
    • Retrofit
    • KotlinX Serialization
    • Room
    • Jetpack Datastore
    • Coil

    https://i.redd.it/w0kmh274nbj71.gif

    submitted by /u/StylianosGakis
    [link] [comments]

    Do you people also send sensitive information like username/password or Gift card number/pin without encryption to API? What security practices do you follow?

    Posted: 24 Aug 2021 04:09 AM PDT

    Hi, Android developer here.

    We send sensitive information like username/password etc without encryption in HTTPS POST API. When I asked this to my backend Developers, they said that HTTPS is the only security measure in our organization and if HTTPS is compromised then all bets are off.

    I see that even Flipkart(competitor of Amazon in India) sends Gift card number and PIN in API as it is when I try to add a new gift card. Same with login by password and OTP.

    Is not this lead to easier MAN IN THE MIDDLE attack?

    Let me know if I am wrong and what's the use of SSL Pinning? We don't use that also in app.

    Flipkart sends username and password without encryption

    submitted by /u/HigherFurtherFaster9
    [link] [comments]

    What to do if an entire category is being ignored on Google's Issue tracker?

    Posted: 23 Aug 2021 08:25 AM PDT

    Back in July, Google released the beta 3 of Android 12 along with final APIs. So I decided to start working on implementing the latest APIs into my app only to realize that Android 12 deprecates both Display#getRealMetrics) and Display#getRealSize). This wouldn't be a problem if they offered a true alternative. Their current alternatives can't work in my case because they are not offering the size of the display anymore but of the window. My app allows users to see the specifications of their devices, so these 2 APIs are quite important.

    So I did what a developer should do: I created an issue on Google's issue tracker. I created my issue under the component (category) "Android Public Tracker > App Development > SDK". I wasn't sure where to post that, but I figured that since the APIs were marked as final, and since both of the APIs I need are marked as deprecated in the SDK, I would post it under SDK.

    Knowing that both APIs were deprecated, but that Android 12 was still (and still is) not released, In hope that I would get a response faster, I decided to post my issue on both Twitter and Telegram, and ask users of my app that would understand why these APIs are important to star the issue (without replying to it). So, to this date my issue has 24 stars.

    So I waited for a while but didn't get any response. I decided to look at other issues in that same component only to realize that since the beginning of this year only 1 issue in that component was assigned to someone.

    I still decided to wait for a while but it's been more than a month. I don't think I can recreate the issue in another component as this may be considered as spam? But I also can't move the issue myself.

    Unfortunately, this impacts anyone who created an issue under "Android Public Tracker > App Development > SDK". I'm not sure why the component still exists if it's being ignored/abandoned.

    submitted by /u/evowizz
    [link] [comments]

    My app got reviewed by androidportal. Is it against play store policy to upload some screenshot saying "Reviewed by AndroidPortal" or "Awarded as best XYZ by AndroidPortal" to boost downloads?

    Posted: 24 Aug 2021 01:33 AM PDT

    Title says it all.

    Is is against play store policies to upload such screenshot? Their policies are (as always) kinda vague and only similar things I found mentioned are also vague (jesus christ...they can not even provide examples, their own images can not be loaded OMFG):

    Examples of common violations in app title, icon, or developer name

    • Images or text that indicate store performance or ranking, such as 'App of the year,' '#1,' 'Best of Play 20XX,' 'Popular,' award icons, etc.
    • Images or text that indicate Google Play programs, such as 'Editor's choice,' 'New,' etc.

    But how about if I get reviewed by big portal, can I "brag" about it in my app screenshots?

    submitted by /u/throwaway41142095
    [link] [comments]

    App was removed, how many times I can submit the update ?

    Posted: 24 Aug 2021 03:12 AM PDT

    Hello,

    As title, my app was removed due to "Disruptive Ads" policy. I have to upload a policy compliant update to bring back my app to store. The problem is the Google support doesn't want to tell me how and where to fix the violation, even though I disabled all the ads and removed Admob SDK.

    I'm guessing the scanning bot detected certain non-compliant SDKs used in my app so I'm trying to remove one by one to find the culprit. So far I have uploaded 10 updates but still rejected. I'm not sure if I continue this way, will it result to app suspension ?

    Does anyone have similar experience, how many updates you can upload after your app was removed ?

    Thank you.

    submitted by /u/davbin
    [link] [comments]

    Interesting Project: LocalSTT

    Posted: 23 Aug 2021 03:13 PM PDT

    What is LocalSTT?

    LocalSTT is an Android Speech Recognition Service using Vosk/Kaldi and Mozilla DeepSpeech.

    https://github.com/ccoreilly/LocalSTT

    I stumbled upon this while trying to find a way to regain the ability to use voice typing after getting rid of the Google app.

    I'm not a developer and honestly don't have any idea how any of it works. Its easy to get the needed packages on there though.

    It's a PoC right now, but I believe it has some awesome potential, especially for those who develop or want an environment that's free of Google.

    I have decided to share this here to get the Dev and their project some exposure.

    Here is a demo video on YouTube :

    https://youtu.be/Hu1lUo82Uzw

    submitted by /u/weirdsideofreddit1
    [link] [comments]

    Android Studio Bumblebee Canary 9 available

    Posted: 23 Aug 2021 01:02 PM PDT

    New Downloadable Fonts Not Working

    Posted: 23 Aug 2021 02:05 PM PDT

    I'm trying to use downloadable fonts to integrate Atkinson Hyperlegible into my app. The font is hosted at fonts.google.com and is licensed under the Open Font License. The documentation for downloadable fonts explicitly states:

    Which fonts can I use? The entire Google Fonts Open Source collection! Visit https://fonts.google.com to browse.

    However, I cannot get Atkinson Hyperlegible (or any of the top 10 fonts when sorting by "new") to download. I know my code works because I can get other fonts to work (here's an example app showcasing the issue). The explicit error code is FAIL_REASON_FONT_NOT_FOUND, which implies that the font is not available to be downloaded, despite being hosted on fonts.google.com.

    Is this a known issue? If so, is there something I can do, other than including the .ttf files in my binary? If not, can someone at Google take a look at what might be getting in the way?

    submitted by /u/MrMannWood
    [link] [comments]

    Kotlin property delegates for Datastore Preferences library

    Posted: 23 Aug 2021 08:52 AM PDT

    Selling In-App Products on Android: Implementing Google Play Billing

    Posted: 23 Aug 2021 02:18 PM PDT

    Selling In-App Products on Android: Implementing Google Play Billing

    Codeible.com Image

    View on Codeible or on YouTube.

    Hello, in this tutorial, I will show you how to use the Google Play Billing Library to start selling IN-APP products on your apps.

    We'll go over how to

    Add IN APP products to your app from the Google Play Console.Launch a Purchase Flow UI to allow users purchase the itemVerify the purchase with a Back-end server using Firebase Cloud Functions and the Firestore DatabaseAcknowledge the purchase to finalize and receive paymentsHow to unlock the product so the user purchase the item again

    0:00 - Start of Video

    0:33 - Implementing the Google Play Billing Library

    1:28 - Setting up for Testing

    6:22 - Adding In-App Products

    8:09 - Displaying the Items

    16:17 - Launching the Purchase Flow

    17:49 - Verifying the Purchase with Back-end using Firebase Cloud Functions and Firestore

    19:58 - Creating a Cloud Functions Project

    28:00 - Communicating with Cloud Functions using the Request URL with Volley

    32:41 - Acknowledging the Purchases using acknowledgePurchase()

    36:03 - Acknowledging and Unlock the Purchases using consumeAsync()

    38:02 - Handling Purchases while the App is closed

    Follow Codeible on Twitter

    submitted by /u/Codeible
    [link] [comments]

    help embedded bluetooth (4.0) hid app to android phone

    Posted: 23 Aug 2021 12:17 PM PDT

    I am using a tivac 129 with a cc256x bluetooth chip. The project I am trying to make is a bluetooth hid gamepad. I also want to establish command and control data over this connection if possible. I would love to hear anybody that might have got something similar working. Thanks.

    submitted by /u/russianbot5555
    [link] [comments]

    Internationalization and third party libs

    Posted: 23 Aug 2021 09:28 AM PDT

    Is there a good way other than manually trying to invoke every possible state to test that the libraries I am using are not producing text visible to the user and if they have strings/text is it possible to provide translations for them through the usual locale values folders or something else.

    submitted by /u/makonde
    [link] [comments]

    WifiNetworkSuggestion config for enterprise network

    Posted: 23 Aug 2021 09:14 AM PDT

    I am not sure how to add key management setting in WifiNetworkSuggestion.
    In WifiConfiguration it was added using WifiConfiguration.KeyMgmt.WPA_EAP and WifiConfiguration.KeyMgmt.IEEE8021X how can I do the same with WifiNetworkSuggestion ?

    submitted by /u/Wheel_Comfortable
    [link] [comments]

    No comments:

    Post a Comment