• Breaking News

    Tuesday, September 7, 2021

    Android Dev - Weekly Questions Thread - September 07, 2021

    Android Dev - Weekly Questions Thread - September 07, 2021


    Weekly Questions Thread - September 07, 2021

    Posted: 07 Sep 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]

    Building Realtime Applications with Appwrite - the new Firebase OSS Alternative ��

    Posted: 06 Sep 2021 09:57 PM PDT

    European Android devs: What about your region should I know as an Android developer from the USA?

    Posted: 06 Sep 2021 06:15 PM PDT

    Working for a new company that is in Europe but all of us (mostly the eng team) is in the USA. What phones should we buy to test with? Is play services available on Huawei devices? Any other quirks around that region that'd be helpful?

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

    Another Jetpack Compose cookbook for Android Dev!

    Posted: 06 Sep 2021 09:14 PM PDT

    Feel free to request features or suggestions for improvements. Many more examples to come...

    Compose Cook Book: Why Not Compose!

    You can also check out my other repo Simple MVVM, a collection of common libs and ready-to-use extension functions and, many more.

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

    what technical questions/side questions would you ask or like to discuss during an interview?

    Posted: 07 Sep 2021 08:16 AM PDT

    for example how you manage pull requests or how do you prefer to use comments and things like that. I'm running some interviews and I need a few things to bring up during the conversation. thanks!

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

    Why write in Kotlin when I could just write in Java and convert it to Kotlin?

    Posted: 07 Sep 2021 08:12 AM PDT

    I know I'm going to get roasted for this question, but do you even have to learn kotlin when you can just have IntelliJ convert your java files for you?

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

    How do you actually load data into espresso test?

    Posted: 06 Sep 2021 07:48 PM PDT

    I have a page (fragment) that is dynamically generated. The content of a list is dependent on the result of an API call. I want to test, if the ViewModel return this list of data, a particular list item should be showing.

    But do you actually go through the login and call API during UI test? No right. But google didn't mention a word on how to handle this.

    I don't know dagger and Hilt, so a ​few solution I considered:

    1. Instead of mocking the viewModel. Use the mock API result as input to call the fragment's update view method. However: putting @VisibleForTesting on the method doesn't actually do anything (still need to make that method public). I prefer to keep that method private.

    2. Write FragmentFactory and pass in the viewModel Factory in the constructor. This could work, but inside the factory I need to do a switch statement on all the fragment to decide which fragment to initialize. To much work for all fragment only for testing!

    3. Make the viewModel variable inside the fragment public and var. And replace that viewModel with mock version during test. But I don't want to any changes the code much only for testing. I want to keep the viewModel variable private and val.

    4. Make a copy of this fragment, append a Test in the name, different with the original by accepting a viewModel input. Obviously this is not good for maintain.

    Please tell me what is my best option. Thank you.

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

    Project structure of modularized app with instant delivery - i'm confused

    Posted: 07 Sep 2021 07:32 AM PDT

    Im facing the task to add instant delivery, and thus modularization, to a pretty big monolithic app.
    Reading docs, articles and sample projects for a few days im kind of struggling with getting my head around this task, either cause i can't find what im looking for, or i have a serious case of the stupid.

    The app is a single module monolithic app, one MainActivity with multiple Fragments. It has tons of content, but for the sake of simplicity let's assume i have the screens/features home, news, events and partners.
    Im struggling with setting up the new project setup by splitting up the existing app module. The code is already well structured, but i don't fully understand which type of modules to use.

    This is how wi would set this up, maybe some of you guys have a bit of experience and could tell me if im on the right path, or totally wrong:

    :app (application module, dynamic feature)

    :core
    - :networking (android library)
    - :utils (kotlin library)
    - :model (kotlin library)

    :features
    - :home (android library)
    - :news (android library)
    - :events (android library)
    - :partners (android library)

    :instant
    - :news (instant dynamic feature)
    - :events (instant dynamic feature)

    In this example, :app would be the fully installed app, and contains everything from :core and :features. My instant apps, for example :news, would only contain the code from :core and :features:news. Am i right here, or am i completely lost?

    ANY help is appreciated, let me know if i need to clarify stuff!

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

    Where do I go to check status of a ticket submitted to Google Play Developer Support team?

    Posted: 07 Sep 2021 07:22 AM PDT

    I got an email response when I opened the ticket with a ticket number. I have not seen another email ( 1 week now) and can't find any place in any of the consoles to see any status.

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

    Play Store update review taking forever ?

    Posted: 07 Sep 2021 01:18 AM PDT

    I've submitted an app update 1 week ago and it is still in review. It's for an app that has been published on the Play Store since forever, with many updates that usually went live within a few hours. Shall I submit a new update in case something is stuck somewhere in the process ?

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

    Any way to get an expedited review on Play Store?

    Posted: 07 Sep 2021 01:14 AM PDT

    Hi all, we've hit a snag with one of our apps preventing users from logging in. Was wondering if there's any way to request an expedited review from the Play Store team like there is in the iOS app store? Any help is appreciated.

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

    Get parent fragment viewModel from child fragment inside viewPager2

    Posted: 07 Sep 2021 05:21 AM PDT

    I have a parent fragment with ViewModel and viewPager2 inside it creates 4 child fragments, I want to get parent viewModel from child fragment that created by viewPager2.
    Note: I used Navigation and Hilt libraries and tries some solutions on StackOverflow that didn't work

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

    Email subject: Drive API requires updates to your code before Sep. 13, 2021

    Posted: 07 Sep 2021 01:31 AM PDT

    Good day! Has anyone received an email with a subject like this? Are android apps affected by this? As far I know, the only thing that connects my app and google drive is by using an intent, uploading a .jpg or .txt file.

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

    Bundle -> data class library

    Posted: 07 Sep 2021 05:13 AM PDT

    I'm looking to use or write something that converts a bundle (from a notification payload) into a data class. I haven't been able to find any libraries that do this, although in theory it sounds similar to what the navigation safe args plugin does under the hood.

    Does anyone know of a library that does this out of the box?

    If not, here are some solutions I have thought of

    1. use reflection to extract the bundle values into a data class
    2. convert the bundle into a Map<String, Any>, convert that into JSON, and then deserialize that JSON (with GSON, Moshi, etc.)
    3. use code gen similar to navigation safe args
    submitted by /u/firmwaves
    [link] [comments]

    Verifying ID with Google Play

    Posted: 06 Sep 2021 05:24 PM PDT

    Anyone having any issues with their ID verification for Google Developer console?

    I really don't understand this.

    I submitted all my information with my U.S. State Driver's License, you can clearly see the entire card with no corners cut, and the address matches my address that I put on my profile. Both in all capital letters because I read online to make sure I do that for whatever reason.

    Then I get this email.

    Hello, Your identity documentation couldn't be verified.

    You have reached the maximum number of verification attempts. Contact the Play Console team to request a refund.

    Sincerely, The Google Play Team

    After I click the link in the email, it sent me to a request to explain what happened and request a new verification.

    After doing that I get this email…

    Hi there,

    Thanks for contacting Google Play Developer support.

    Unfortunately, we are unable to verify your ID to complete your Play Console registration.

    Please note that your account will still be accessible but you won't be able to publish any apps.

    Please let me know if you have any additional questions.

    Regards, Lia Google Play Developer Support

    Okay, fine. I asked Lia what else I need to do or provide for verification? I offered other forms of ID. Then I get this email.

    Hi there,

    Thanks again for contacting Google Play Developer Support.

    As much as I'd like to help, I'm not able to provide any more information or a better answer to your question.

    Unfortunately, we are unable to revert your ID verification status.

    Thanks again for your understanding and your support of Google Play.

    What the hell do I need to do? They won't explain anything at all and without this I can't submit any apps? I'm a born and raised US citizen with a valid ID and they can't approve me or give me information on why my verification was failed or how to move on?

    Does this mean I need to keep creating new Google Accounts and trying over and over or is there someone I can reach out to?

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

    Weekly "who's hiring" thread!

    Posted: 07 Sep 2021 04:22 AM PDT

    Looking for Android developers? Heard about a cool job posting? Let people know!

    Here is a suggested posting template:

    Company: <Best Company Ever>
    Job: [<Title>](https://example.com/job)
    Location: <City, State, Country>
    Allows remote: <Yes/No>
    Visa: <Yes/No>

    Feel free to include any other information about the job.

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

    Using “sealedSubclasses” in Kotlin to manage large lists of objects

    Posted: 06 Sep 2021 10:28 AM PDT

    Does the Play Console give payments seperately from Admob?

    Posted: 07 Sep 2021 03:11 AM PDT

    I have apps with in-app purchases and with AdMob ads. I can see a Payments page in both the Play Console and in Google AdMob site. Are these two payments separate? Meaning does the Play Console just show the earnings from the app purchases while AdMob shows the earnings made from ads? Or does the Play Console's Payment page include both the earnings from purchases and ads?

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

    What to use for database storage for Android or Apple apps

    Posted: 06 Sep 2021 07:16 PM PDT

    I'm new at development and trying to make an app that will create customers and eventually I will generate a PDF formatted report from input that inclufes pictures.

    What I cannot wrap my head around is where to store it. Back in college we had database servers but all things are cloud now.

    I am wondering if there is a small free type of resources people use for Android and IOs apps where I can do this.

    Please help.

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

    Trying to use Java 11 java.time in a project

    Posted: 06 Sep 2021 10:35 AM PDT

    The java.time package in Java 9+ has a method called datesUntil which returns a list of dates from the specified start date and a given Period.

    I'm building a calendar view in compose, so I'm trying to get the dates for each week by using the datesUntil method but it's giving me an unresolved reference error. I've set the source and target compatibility to JAVA_VERSION_11, set the gradle jdk to version 11 and invalidate caches/restart.

    However, it still produces the error. One thing I did notice that was odd, was when android studio restarted after invalidating the cache, it would say "Indexing jdk 1.8" or something along those lines. So I'm assuming it's still using Java 8, but if I run java -version in the terminal it shows version 11.

    Not sure what else to try; any suggestions?

    The AGP version I'm using is 7.0.2

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

    Going back to the market after 2 year hiatus

    Posted: 06 Sep 2021 01:32 PM PDT

    2 years ago I quit my job and started to work in my dad's company and freelancing with some external clients, unfortunately most of my projects focused on database architecture, microservice development or web apps development. Also I learned Flutter so I used it for all my mobile projects.

    These past few months my income has not been that great and I have to go back to the market so I want to get into native Android again but as I can see jetpack compose changed a lot of how things are done and I haven't touched native Android in 2 years.

    So aside from learning compose what are some new tools or libraries that I should learn and which subjects should I focus on relearning to make sure I'm fit enough to get into a developer position? 2 years ago I was very familiar with Kotlin, dagger, livedata, room, mvvm, retrofit, etc.

    Thanks!

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

    Java 11 for AGP 7

    Posted: 06 Sep 2021 09:02 AM PDT

    I am trying to update to the latest AGP and it requires Java 11. Is there any difference between the vendors? Android Studio is suggesting a few options there (AdoptOpenJDK, Amazon Corretto, Azul Zulu, etc. seems there is no Oracle OpenJDK for version 11, only 16)

    On a side note, what if we download and use the Oracle JDK 11? Do we need a license for it?

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

    I'm excited to announce our new library for progress button. It's built for jetpack compose. Please go and check out it now.

    Posted: 06 Sep 2021 09:01 AM PDT

    Analog Watch Face for Wear OS

    Posted: 06 Sep 2021 12:16 PM PDT

    Hi everyone! 👋

    Now that WearOS is officially not dead 🤞, hopefully, more people will want to jump into WearOS development. So if you are one of those people I have an open-source project that could help you start.

    3 years ago I created a simple analog watch face for Wear OS as a demo project for my Pluralsight course. Slowly it grew into a pretty nice and feature-rich watch face thanks to the ideas of people who used it.

    Here are some of the highlights:

    • Custom complications
    • Small size (~1.5 MB)
    • Adjustable color and visibility of every element of the watch face
    • Adjustable size of hands
    • Unique ticks layouts
    • Optimized for square watches
    • Doesn't require a companion app

    If you would like to try it here is the link: https://play.google.com/store/apps/details?id=com.vlad1m1r.watchface

    The watch face is and will always be free and open-source. So if you are a developer feel free to contribute. All contributions are welcome (refactoring, adding tests, adding new features, adding new watch face designs, fixing typos ...), but if you are planning a big change it would be great if you could contact me beforehand. Here is the repo: https://github.com/VladimirWrites/AnalogWatchFace

    Some of the bigger tasks that I am planning to do (and where you could help) in the next couple of months are:

    • Improving compatibility with Galaxy Watch 4 devices
    • Integrating new wear libraries (currently in alpha)
    • Adding tests
    • Refactoring codebase

    Beware that the watch face is drawn directly on Canvas, and the position of pretty much everything is calculated in Polar coordinates, so feel free to approach me if you have problems understanding the calculations.

    Junior devs are also welcome, and I can provide you help and guidance if you want to jump into WearOS development and help me on this project.

    If you don't want to code in your free time, but you still want to contribute 😊, you could help me translate it to some of the languages supported by WearOS, or review the existing translations.

    Here are the links for contributing:

    Keep in mind that not all languages are supported on Wear OS devices. Make sure to check if the language is supported before adding it and investing time into translation.

    It would be great if you could try it, and give me your feedback. If you like it, I would be thankful if you could rate it on the Play Store ⭐. Also, if there is some feature that is missing, feel free to pitch it.

    Finally, if you are already using the watch face, thank you! You are the best! 😍

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

    Historically iOS only, but wondering if Android is better for this 'Dad's Carputer' idea.

    Posted: 06 Sep 2021 05:50 PM PDT

    Hi all, I hope you'll go easy on me, as I'm a react native developer who has historically just made iOS apps. But now I have a new baby and thus some very niche needs that an Android app on a tablet may be better suited for.

    I'd like to use the OS's split screen to have native Google Maps navigation on the left, and my app running on the right.

    In the app I'd like to do two primary things:

    1. Connect to my bluetooth OBD2 adapter to display some vehicle data, enter trip purpose (for business/tax) for auto-logging miles, verbose maintenance reminders, etc.
    2. Stream video from a baby carseat camera so I can see baby in rear facing carseat at a glance without trying to line up two mirrors. Bonus if I can connect multiple cams so I can add a better backup cam, blind spot cams, etc.

    The thing I haven't figured out an ideal approach to is the camera(s). I considered running a Raspberry Pi as a server to ingest the camera footage and OBD2 data and have the app just act as a surface layer UI to interact with the Pi.

    But whether it's the Pi or the camera connecting to the tablet, does the OS give you a way to access that? How would you go about this?

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

    No comments:

    Post a Comment