Android Dev - Weekly Questions Thread - December 07, 2021 |
- Weekly Questions Thread - December 07, 2021
- If you're collecting analytics data using Firebase, you should connect it to BigQuery right now!
- Reverse engineering Android apps
- App rejected due to lack of information in app access section
- How to securely use Google Maps API Key in Android, iOS, or Flutter Project
- Nullable !! practice
- Styles and themes in xml are hard to work with
- Switch button on android wear too big
- When does the view model call onCleared() when it’s connected with two fragments?
- WebView not found? Time to crash everything!
- Android 12 and Notification Trampolines
- What are some cheap aso tools for app developers?
- Having issues connecting to an API to display search results to the user in an app.
- Best way to pass data to a fragment and prevent Transaction Too Large exceptions?
- Communication between UI and Logic
- Device wont switch on programatically
- How to achieve this Z-Axis animation
- Best way to manage a fleet of Android devices and push app updates (without prompting Google login challenges)?
- Building a library for Jetpack Compose UI and screenshot testing
- Alternatives to Pendo
- What's the best no code tool for publishing an MVP/beta ?
- The problem with mobile development, in one image
- Room Database | Android Jetpack
Weekly Questions Thread - December 07, 2021 Posted: 07 Dec 2021 06:00 AM PST 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:
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! [link] [comments] | ||
If you're collecting analytics data using Firebase, you should connect it to BigQuery right now! Posted: 08 Dec 2021 12:22 AM PST I wish I had known this before - Firebase does not allow exporting detailed analytics data for your projects which it has been collecting for years. The export option that you see on the events page exports a csv only with event-names and event-counts which does not help in the least to study the data. However, if you connect your project to BigQuery, the complete analytics data is exported to it on a daily basis. From there you can export the data in JSON, CSV or AVRO format and run your own scripts and queries on it as you want. Note here that the data from Firebase is only exported from the date you connect it to BigQuery. No historical data is exported. So you should connect your Firebase project to BigQuery right now so that the data keeps exporting and you can then download and own your data and process it. Edit - You can use this guide to connect https://firebase.google.com/docs/projects/bigquery-export [link] [comments] | ||
Reverse engineering Android apps Posted: 07 Dec 2021 04:58 PM PST I'm wondering if there are any communities around reverse engineering Android apps? I've noticed there seems to be some that are more security focused but I'm primarily interested in ones that are more focused on reverse engineering for performance analysis/benchmarking. [link] [comments] | ||
App rejected due to lack of information in app access section Posted: 08 Dec 2021 02:10 AM PST The app have OTP based authentication. I have clearly mentioned it in app access section. But Google Play keep rejecting for same reason. [link] [comments] | ||
How to securely use Google Maps API Key in Android, iOS, or Flutter Project Posted: 08 Dec 2021 01:23 AM PST Are you using Google Maps Api Key securely ? 🤔 If you're not sure or just want to learn more about the topic, be sure to give our latest blog a read 👀 Damian Kasperski expands on this topic with his professional knowledge, explaining how to keep API keys secure in Android, IOS and Flutter projects whilst being able to use them in local development as well as on CI 🤯 📷 Link to blog (8min read) [link] [comments] | ||
Posted: 07 Dec 2021 02:59 PM PST If a piece of code expect a nullable to be none null, would you prefer to use !! to enforce invariant and let it crash or handle it safely? The thing is this. I want to do safety check but
Update: one strong argument against using !! Is if server return null or bad data. Instead of crashing entire app for every user in extreme cases. It's better to have a semi usable app that could make you some revenue instead of 100% loss of revenue. [link] [comments] | ||
Styles and themes in xml are hard to work with Posted: 07 Dec 2021 04:40 AM PST Hi everyone, for context i come from a web background, and i find styles and theming overly complicated in Android. They're hard to work with compared to css, which i know has its own challenges as well. to be clear i dont mean working with views like constraintview, ... etc and their attributes (i.e width, height, alignment), in fact this part is clear and works pretty much like css, but rather the structure of styles and themes in the res directory that makes styling these views reusable and organized. but then again i don't haven't much experience on android so it might just need getting used to. and what makes matters worse, is that there aren't many resources explaining this stuff. so what do you think? [link] [comments] | ||
Switch button on android wear too big Posted: 08 Dec 2021 02:07 AM PST I am creating app that should work with casual Android phones and Android wear too. Switch buttons look amazing on casual Android phones. However, switch buttons are too large on wear devices. What can I do to make switch buttons smaller on wear? [link] [comments] | ||
When does the view model call onCleared() when it’s connected with two fragments? Posted: 07 Dec 2021 03:44 PM PST Imagine I have a view model and I'm using it for two or more fragments. So does the viewModel call onCleared() when all of the fragments are destroyed? Or when a single fragment is destroyed? [link] [comments] | ||
WebView not found? Time to crash everything! Posted: 07 Dec 2021 10:33 AM PST WebView's distribution has been decoupled from the OS which leads to issues such as: "Failed to load WebView provider: No WebView installed" Have you ever come up against this, and if so, how do you handle it? [link] [comments] | ||
Android 12 and Notification Trampolines Posted: 07 Dec 2021 08:15 AM PST As a new Android developer, I never realized I was using an anti-pattern with a broadcast receiver to start a third-party app/activity and perform some internal operations when a user selects an action button in my app's notification. I thought this was the preferred method to do this. Fast forward to Android 12 and this is forbidden per https://developer.android.com/about/versions/12/behavior-changes-12#notification-trampolines. If I was starting my app's activity from a notification, I can easily address this, but I'm uncertain of the best way to handle this when starting a third-party app/activity. In perusing Stack Overflow, the accepted answer at https://stackoverflow.com/questions/69238026/android-12-notification-trampoline-restrictions is to use a "transparent" activity, which just seems like another anti-pattern to me (and someone else mentioned this in the comments there). How is everyone else handling this in the third-party app/activity case? What am I missing? I'd love to get my targetSdkVersion up without investing in yet another anti-pattern. Cheers. [link] [comments] | ||
What are some cheap aso tools for app developers? Posted: 07 Dec 2021 10:43 AM PST please advise me some affordable aso tools that give good results [link] [comments] | ||
Having issues connecting to an API to display search results to the user in an app. Posted: 07 Dec 2021 10:12 AM PST I am trying to create an app that will link to this api "https://api.covid19tracker.ca/reports?after=" which store an array "data" with objects in it for various information in int. However, I am currently getting a "org.json.JSONException: Value unsuccessful of type java.lang.String cannot be converted to JSONArray" just trying to display the results into a RecyclerView. I will be using an event click listener to link the search to a button but I just want the API to work and display everything first. I appreciate any help that anybody can offer. MainActivity.java
DataCovid.java AdapterCovid.java
activity_main Layout File [link] [comments] | ||
Best way to pass data to a fragment and prevent Transaction Too Large exceptions? Posted: 07 Dec 2021 01:45 AM PST I think this is a common issue I'm seeing with code at work. Commonly, there's some sort of object we parse from a network API, then pass this object around. For example, let's say we have a typical master detail list. On the master list screen, we fetch the objects and display it in a list. On the detail screen, we pass the the object clicked to display. I'm finding some users then get Transaction Too Large exceptions, which I think are from bundles that are too big. Sometimes the objects we parse from the JSON may have long Strings and I think the bundles with restoreInstanceState or something in the main activity seems to be growing larger over time. What are some of the ways to pass data? My thoughts:
These are the ones I'm most familiar with. But I've also heard of perhaps using a repository to somehow do this? Would it be some sort of shared flow? Or maybe saving it to a Room database and retrieving it? Any thoughts on passing JSON objects which can be potentially too big? [link] [comments] | ||
Communication between UI and Logic Posted: 07 Dec 2021 04:38 AM PST Hey devs, I would like to know, how you guys implement the communication between the UI and the Logic. Let's say we use MVVM (View as the UI and ViewModel as the Logic) and there is a scenario where the user clicks on a button, an AlertDialog pops up and the user can click on further actions on the Dialog. I was wondering, how detailed the communication should be: Option 1: Options 2: Option 1 seems a little more consistent, because every single action from the user goes to the ViewModel. But at the same time, it seems a little bit too much. Especially if you have more Dialogs in a feature and there is a big ping pong between View and ViewModel. Options 2 could be not really consistent, but maybe the View is able to handle "UI-Logic" by itself and can trigger the ViewModel, when its really necessary. This would help to avoid a lot of code. What do you think? [link] [comments] | ||
Device wont switch on programatically Posted: 07 Dec 2021 04:12 AM PST I am working on a app, a part of which allows the user to specify a off/on time for the device. The app works fine of the emulator, and my Samsung S7 Note, but I also have a large screen interactive whiteboard that has a Android on-board system. On this system, the app switches the display off OK, but for switching on we hear the 'click' sound the device makes when turning on, but the display remains off. We think there might be a Android system setting affecting this, but if so which one? The code to turn the device back on is:
[link] [comments] | ||
How to achieve this Z-Axis animation Posted: 07 Dec 2021 03:49 AM PST I noticed this effect in Bundled Notes (note taking app for Android) When opening a BottomSheetDialogFragment, the activity/fragment behind it gets animated up/down based on the bottom dialog's offset. Getting the offset of the dialog is quite easy, but then using that value to change the view behind it is proving difficult. I've tried messing with the window/decorView, modifying the translationZ and also the X/Y scale, but nothing works. Does anyone know how to achieve this? Thanks. [link] [comments] | ||
Posted: 06 Dec 2021 12:07 PM PST Hi there, here is my use case: I am an app developer who ships my app pre-deployed on Android devices to various customers (the device is used only to run this app). These devices are logged in to a specific Google Workspace account and updates are pushed through Google Firebase App Distribution (tied to that Google account). I recognize this is not the intended purpose of Firebase App Distribution. I have turned off 2FA for this Google Workspace account. The problem I am encountering is that after some time if the session expires, or if Google detects a "suspicious login", when they try to access Firebase App Distribution it will force the user to re-authenticate the Google account which then prompts a Google "verify it's you" login challenge showing on all other logged in users' Android devices which is a very poor experience. Q: Is there any kind of provisioning I could perform on the Android devices before shipping them out that would enable me to continue to be logged in to a Google account and still use Firebase app distribution, but would never prompt the user for a login challenge? Does Google Workspace MDM allow for this (indefinite session)? If not, what is my best alternative? Using a third party MDM provider such as Scalefusion instead of Firebase App Distribution that doesn't depend on Google account sessions? Thank you. [link] [comments] | ||
Building a library for Jetpack Compose UI and screenshot testing Posted: 06 Dec 2021 12:29 PM PST
| ||
Posted: 06 Dec 2021 04:48 PM PST Hi everyone! I currently use pendo to gain insight into customer usage of a web client. I was looking into adding an Android license, but found out it was going to cost 5k per application. While this isn't unfeasible, I was wondering if any of ya'll knew of any free/cheaper alternatives. Thanks! [link] [comments] | ||
What's the best no code tool for publishing an MVP/beta ? Posted: 06 Dec 2021 11:00 PM PST Hi, I'm a backend python developer (I do some frontend dev in vueJS too) and I have a few mobile apps ideas. I don't have a lot of time lately but I still want to be able to dev MVPs on weekends and publish them to see if it's worth spending more time on a project. So I started looking at some no code tools, but there are so many of them ...I saw for example : appgyver, Adalo, glide that seem to do front and back end, things like xano for back end but no front, and bravo that transforms figma designs into apps. The best tool for me would have a variety of templates to work from and would help deploying the app to android (ios would be a nice to have) playstore. The best tool should also be the fastest one getting you from idea to deployed app with a clean result. Do you have any experience with this kind of tools ? What do you recommend ? [link] [comments] | ||
The problem with mobile development, in one image Posted: 07 Dec 2021 03:08 AM PST
| ||
Room Database | Android Jetpack Posted: 06 Dec 2021 10:15 PM PST
|
You are subscribed to email updates from Developing Android Apps. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment