• Breaking News

    Tuesday, July 6, 2021

    Android Dev - Weekly Questions Thread - July 06, 2021

    Android Dev - Weekly Questions Thread - July 06, 2021


    Weekly Questions Thread - July 06, 2021

    Posted: 06 Jul 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]

    IG's color shifting chat UI, made with Jetpack Compose

    Posted: 05 Jul 2021 08:28 AM PDT

    With Android powered gaming handhelds emerging on the market, does that mean that Android can be utilised in order to make a high quality "traditional" console / handheld game?

    Posted: 06 Jul 2021 06:12 AM PDT

    With Android powered handhelds like the Retroid Pocket 2, Retroid Pocket 3, KT R1, and Odin emerging on the market, does that mean that we've now gotten to the point where Android can finally be utilised in order to make high quality games that would normally be seen on traditional consoles and handhelds - like PS4 and Switch Lite?

    If someone like Nintendo, Sony, or MS were to create an Android powered gaming system, and on a purely technical level, would they still be able to craft the kind of games that they are renowned for? And would their (hypothetical) Android powered gaming systems allow third party developers to create full fledged console / handheld gaming experiences like Call Of Duty?

    In short, why aren't we seeing a more mass-market push by gaming hardware companies in wanting to make Android powered gaming hardware? What's the reason for their hesitation? And on a purely technical level, can it be overcome?

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

    I am new to mobile development and have a question

    Posted: 06 Jul 2021 05:34 AM PDT

    I decided to learn kotlin but i want my apps to run on Android and IOS i know about flutter but i don't want to use dart so my question is how can i write a kotlin app but still be able to run it on android and ios?

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

    Common mistakes when using Architecture Components

    Posted: 05 Jul 2021 01:33 PM PDT

    Is there a way to delete old App bundle on Googleplay console?

    Posted: 06 Jul 2021 01:57 AM PDT

    SDK emulator directory is missing

    Posted: 06 Jul 2021 04:48 AM PDT

    Hi, i am using android studio on windows 7 but it gives me error "sdk emulator directory is missing" How can i fix this

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

    Career questions

    Posted: 05 Jul 2021 11:10 PM PDT

    Hello everyone. Hope you all are well.

    I am a student from Bangladesh, and I just graduated. For the past year and a half, I have been making Android apps as part of a startup part-time. Most companies here expect you to work for free, but they actually pay me a small salary. Things had been going good, or so I thought.

    The (remote) startup is basically a group of 4 people, and two of them are the bosses. They give me and my colleague an app to make, and we figure out how to make it. I went into this knowing nothing about Android, and a basic knowledge of Java. They told me what feature to add, and I googled how to add it, copied some code, watched a tutorial for that specific topic, barely understood it and so on. They are not Android developers themselves, and are busy with their own work, so there is no office environment and getting help from them is easy only for things that aren't directly related to Android.

    In about a year, we (mostly I) managed to make the app, release it to the Play Store. It works relatively well, however, it is not a well written program. There are not really any downloads. Most of the work is done in one class. I have not used OOP principles properly so there is redundant code. No design pattern was followed. They did look at the code and we used VCS but their input wasn't that much. To be fair, I don't blame them. I just think that maybe if I was in an Android development environment, it would have been easier to follow and learn proper Android development.

    Now I am left with fragmented knowledge of Java, VCS and Android development. I found that out the hard way when I applied for a job and couldn't answer basic questions like how to do long running tasks (I've actually used threads, but didn't know the name) and how services work, what is encapsulation, etc.

    Where do I go from here? I am watching tutorials on YouTube and writing the code to understand how Android works, but then I need to watch Java videos in between to understand the why, when and how. I don't know what topic to read next, as all "Android start to end guides" leave me in the place where I am now. I try to incorporate a design pattern I've learned, but it falls apart quickly and becomes spaghetti again. Is there any tutorial that will guide me to junior/intermediate level programming for Android.

    Thank you.

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

    Will google moving away from APKs to AAB stop my users downloading a modded version of an app?

    Posted: 05 Jul 2021 02:10 PM PDT

    Google claim to have fixed the problems with the Jetpack Navigation Component- including having multiple back-stacks and saving fragment state, especially with Bottom Navigation.

    Posted: 05 Jul 2021 08:25 AM PDT

    So according to this issue tracker which I've been following for two years, this has been finally fixed:

    https://issuetracker.google.com/issues/80029773#comment136

    The changes are also announced here:

    https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0-alpha01

    And here:

    "Ensure that any usages of NavigationUI's onNavDestinationSelected() API or APIs that use it internally (such as the setupWithNavController() methods for NavigationView and BottomNavigationView) use the popUpTo API with saveState = true and setRestoreState(true) to ensure that any popped destinations have their state saved and restored when you navigate back to that destination (either via selecting the same menu item again or manually using the setRestoreState(true) API."

    https://android-review.googlesource.com/c/platform/frameworks/support/+/1700707

    The above is basically the exact behaviour I want- I want fragment states to be retained when the user clicks back to that menu item on the bottom nav (without having to use workarounds), but it still doesn't seem to be working as far as I can tell. There doesn't yet seem to be proper documentation and all the documentation I can find claims that the issues have been solved and using BottomNavigationView.setupWithNavController(navController) will now automatically manage backstack and save state. I'm using a parent nav_graph with child nav_graphs for each tab- have already tried to merge everything into one nav_graph but that gave me the incorrect backstack behaviour (simply using one backstack rather than multiples). There seem to be some new values added to navControllers, namely "restoreState" and "popUpTo" which can be seen in these examples:

    <action android:id="@+id/swap_stack" app:destination="@id/second_stack" app:restoreState="true" app:popUpTo="@id/first_stack_start_destination" app:popUpToSaveState="true" />

    // Use the navigate() method that takes a navOptions DSL Builder navController.navigate(selectedBottomNavRoute) { launchSingleTop = true restoreState = true popUpTo(navController.graph.startDestinationId) { saveState = true } }

    So I'm wondering whether I need to override the NavController to ensure it is restoring state when the user tabs between fragments on the BottomNavigationView. But, although this issue has been fixed I can't find any code examples or proper documentation anywhere. Has anybody worked this out yet?

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

    How does Uber bypass location settings?

    Posted: 06 Jul 2021 04:37 AM PDT

    Now please correct me if I'm wrong, but I've just tested this on my phone and I'm perplexed.

    I:

    • deactivated location from the drawer
    • disconnected from wifi

    But if I open Uber the app still knows exactly where I am.

    What's happening? How did they achieve this and is it something I can replicate?

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

    Is Google's Firestore good for large scale applications?

    Posted: 05 Jul 2021 04:37 PM PDT

    A little bit of googling has brought me here: https://www.quora.com/Should-I-use-Firebase-Firestore-for-a-big-app-with-more-than-100-000-users but that was 2 years ago.

    I have been using firestore for quite awhile and I am now starting to notice many limits. For instance, I am developing a chat application with twitter like posts and the querying is very very limited.

    - Where In cursors are only limited to 10.
    - You cannot exclude/include items based on one key and order by another.

    Yes i know you can fetch using multiple queries, but I cannot do that. There can be 1000s of users with different ids and 1000s of posts with different amounts of data.
    I use pagination and using firestore is very limited when you try to filter it with pagination.

    Maybe there is an alternative or possibly a library to make this a little bit easier?

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

    Created my first Kotlin & Jetpack Compose app. I'm asking for feedback.

    Posted: 05 Jul 2021 08:18 AM PDT

    Hello!

    After creating some "legacy" apps with Java, I decided to jump into the modern stuff, and made a very simple app using Jetpack Compose:

    https://github.com/Gtomika/note-composer

    There is still a lot I don't properly understand, this was the first project where I ever used any of these:

    • Kotlin
    • Jetpack Compose for UI
    • Room for database management
    • Hilt (I didn't even know what dependency injection is before)
    • Model-View-ViewModel architecture

    I'd love to hear your thoughts about this project, from code style to architecture. What should I do different, and how? Is there something that is very bad, inefficient in there (I'm sure there is)? This would be very useful for me, so that I can learn this new Android world the right way and don't get used to bad patterns.

    Thank you.

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

    Support multiple screens — Android

    Posted: 05 Jul 2021 09:43 AM PDT

    https://medium.com/@ruben.quadros/support-multiple-screens-android-b4ff758a3326
    Challenges of supporting multiple screens and devices in a single codebase.Btw this is my first medium article! Feedback much appreciated! If you liked the article don't forget to leave a clap and follow me!

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

    ELI5 Keystore and keytool used to provide SHA keys.

    Posted: 05 Jul 2021 12:42 PM PDT

    I have been struggling to understand the Keystore which is used to store debug and release keys for an app. Keytool a java utility to access them.

    I am confused about both the Software/tools and what is their significance?

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

    What does the future hold for Android and gaming?

    Posted: 05 Jul 2021 09:32 AM PDT

    With Android being one of the most popular Operating Systems on the market, what do you think the future holds for Android and gaming?

    Can Android gain the recognition and respect that is usually reserved for other gaming platforms like Windows and PS4?

    Where do you think the market will be in 3-5 years time?

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

    A Career Question ❓

    Posted: 05 Jul 2021 08:34 AM PDT

    I am a sophomore CSE student and I am really passionate about android development and looking forward to a career in it . Recently I have been looking at the requirements for android developers specifically senior level positions , and I had some questions

    I am thinking of building my experience by building personal apps and learning on my own , would I fit a senior level position if have decent projects build on my own that is without working for any company ? If so what counts as decent projects ?

    Should I apply for internships ? (I havent done any )

    People who work as senior Android developers how was the interview experience like ?

    submitted by /u/100thRedditAc
    [link] [comments]

    New to Android, Why Can't I Just Write SQL?

    Posted: 05 Jul 2021 02:27 PM PDT

    So I'm brand new to Android, I'm a professional software engineer with a background in webapps. I'm working with SQLLite and Android for the very first time. I've discovered the SQLiteOpenHelper class, which is what I'm using so far.

    I just got up to writing my first select query, and I am utterly horrified. There's some abominable SQL wrapping API that is forced upon me. Seriously, wtf Android. I'm really hoping there are other options that will just let me write normal SQL queries. If I want helper libraries and abstractions, I'll use them. SQL is not hard, and I really hope Android's philosophy isn't to treat devs like babies and deny them the ability to write normal queries. Creating an API for the lowest common denominator leaves such a bad taste in my mouth.

    Just hoping there's a good way to bypass this mess so I can write my SQL in peace.

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

    can SNORT be ported over to Android ?

    Posted: 05 Jul 2021 07:57 AM PDT

    Hi guy, I am currently doing a final year project. The project is to create a mobile app that helps to manage a open source IDS(e.g. SNORT,Zeek,Suricata) with the app running in the background. If yes, which is a better development route ? Flutter or Kotlin ? Information online is pretty limited, I found something call SwineDroid,but it looks deprecated. Would highly appreciate any input ! Thank you

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

    No comments:

    Post a Comment