• Breaking News

    Monday, July 26, 2021

    Android Dev - Weekly Who's Hiring Thread - July 26, 2021

    Android Dev - Weekly Who's Hiring Thread - July 26, 2021


    Weekly Who's Hiring Thread - July 26, 2021

    Posted: 26 Jul 2021 06:00 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/AutoModerator
    [link] [comments]

    Tips to improve my app. I'm creating this app for fun and learn, I'm looking for suggestions on UI design. This post should fit the rule 1, if not I'll remove it

    Posted: 26 Jul 2021 03:37 AM PDT

    How to create a Navigation Drawer with Jetpack Compose

    Posted: 26 Jul 2021 04:34 AM PDT

    Fixing TreeDocumentFile#findFile lousy performance (SAF)

    Posted: 26 Jul 2021 06:34 AM PDT

    This may not be a discovery for those of you familiar with the SAF, but TreeDocumentFile#findFile has horrible performance. It only concerns DocumentFile pointing to a SAF tree Uri.

     

    findFile() is implemented in DocumentFile as:

     

     public DocumentFile findFile(@NonNull String displayName) { for (DocumentFile doc : listFiles()) { if (displayName.equals(doc.getName())) { return doc; } } return null; } 

     

    listFile() and getName() are abstract functions implemented in DocumentFile subclasses.

    For type TreeDocumentFile, getName() is implemented as a query to DocumentsProvider which is.... slow. So you can see the problem here, repeatedly invoking getName() above and how it gets slower as the number of files increase and the displayName to find is eventually down the list. And if not to be found, it is even slower.

     

    The workaround is to rewrite findFile() to combine above loop in a single query, based on the implementation of TreeDocumentFile#listFile:

     

     @Nullable static public DocumentFile findFile(@NonNull context, @NonNull DocumentFile documentFile, @NonNull String displayName) { if(!(documentFile instanceof TreeDocumentFile)) { return documentFile.findFile(displayName); } final ContentResolver resolver = context.getContentResolver(); final Uri childrenUri = DocumentsContract.buildChildDocumentsUriUsingTree(documentFile.getUri(), DocumentsContract.getDocumentId(documentFile.getUri())); Cursor c = null; try { c = resolver.query(childrenUri, new String[] { DocumentsContract.Document.COLUMN_DOCUMENT_ID, DocumentsContract.Document.COLUMN_DISPLAY_NAME, }, null, null, null); if(c != null) { while (c.moveToNext()) { if (displayName.equals(c.getString(1))) { return new TreeDocumentFile(documentFile, context, DocumentsContract.buildDocumentUriUsingTree(documentFile.getUri(), c.getString(0))); } } } } catch (Exception e) { Log.w(TAG, "query failed: " + e); } finally { IOUtils.closeQuietly(c); } return null; } 

     

    Note that for accessing package protected class TreeDocumentFile, you will have to put function above in a helper class in package androidx.documentfile.provider. After this, replace all invocation to DocumentFile#findFile by this replacement or a Kotlin adaptation of it.

    Why this horrible performing code has not been fixed by Google, I don't know.

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

    How to handle large ViewModels in a scoped nav graph?

    Posted: 26 Jul 2021 07:41 AM PDT

    Let's say a nav graph has 6 steps, a ViewModel is scoped to this graph and in the last step all the information from the 6 steps is gathered to make a network request. The problem is that this ViewModel is not only acting as a data holder for the 6 steps but also handling events and providing additional information that each view needs, causing it to have hundreds of lines of code and also each view has access to a lot of things that it doesn't care.

    How can this situation be handled?

    My first thought was to create 1 graph scoped ViewModel that acts as a data holder (handling process death) and 6 non-scoped ViewModels that handles each view behavior (state, events, effects) but the problem is that each view will have 2 different scoped ViewModels and I'm not sure about it.

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

    How the app called 9Gag is monetizing using Admob even though the app violates AdMob's policies?

    Posted: 26 Jul 2021 03:42 AM PDT

    Here's the link to the app: https://play.google.com/store/apps/details?id=com.ninegag.android.app

    According to AdMob, any links to other 18+ pages or app is considered a violation of its policies. But this app used ads on pages that don't have 18+ content and switch off ads on pages that have 18+ content. But why Google doesn't stop ads for their app. They've been monetizing for a long period.

    Here's a link to their website also, they're using Adsense there too: https://9gag.com/

    submitted by /u/Ok-Duty-3411
    [link] [comments]

    Easy UI And Screenshot Testing On Android

    Posted: 26 Jul 2021 12:19 AM PDT

    [VIDEO] Android 11+ insets animation API, the keyboard scrolls down following the text cursor

    Posted: 26 Jul 2021 06:17 AM PDT

    Cat controls button android 11

    Posted: 25 Jul 2021 11:59 PM PDT

    there's a new Cat Control Button in android 11 but there's not a single tutorial or any docs how to make it so can anyone explain in comments making that Water Bubbler Button 🤔 that would be awesome.

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

    An android app which let us power on/off generator at our home.

    Posted: 26 Jul 2021 08:36 AM PDT

    Hey there!

    I'm mid level android developer with java.

    I live in a place where we frequently use emergency generator as our secondary power source for that we have to go to a certain range to press button of remotes to turn it on/off.

    Now I want to help my home with my android skills. To make an app that let us power on/off the generator from across the home( aprox: 30meter square).

    Need help with that.

    Thanks in anticipation.

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

    There's a lot of ways to do background tasks. Which ones are worth learning today? (HandlerThread, IntentService, WorkManager, etc)

    Posted: 25 Jul 2021 12:45 PM PDT

    I've been reading up a lot about means of doing background processing lately. One thing I've realized is that Android has a lot of different ways to handle background work. It's confusing trying to figure out which of these is actually useful today and which of these I should avoid investing time into learning because it's being moved away from.

    Out of the list of concurrency systems below, which ones are worth learning?

    Coroutines (I know this one is important)

    HandlerThread

    IntentService

    JobIntentService

    Service (Seems like this is handled by WorkManager or ForegroundService now?)

    ForegroundService

    WorkManager (I know this is the modern way of handling deferrable background work)

    Maybe more...?

    And to be clear, I understand an argument can be made that I should learn all of these in order to support legacy apps. However, in a world of finite time I would rather focus on the current best practices than learn AsyncTask.

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

    Why can't this subreddit have THREE pinned threads?

    Posted: 26 Jul 2021 06:41 AM PDT

    I could not find the questions thread, because the two pinned "Weekly"s were "Hiring" and "Feedback"; I had to search for it. This not only makes it difficult to ask a question, but probably fewer people would be willing to actively search for the questions thread just to spend their time answering someone else's questions for free.

    Why can't this subreddit have 3 pinned weekly threads at the top? Is this a limitation of Reddit? Even if so, I cannot understand why. Why is it so difficult to allow 3 pinned threads?

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

    What's the best SQL database deployment option for a beginner

    Posted: 26 Jul 2021 06:29 AM PDT

    Hey, I'm in the middle of developing my first android app and am somewhat lost in the options available for database deployment. I'm a student, so would rather spend zero dollars on hosting and the database itself is a very simple SQL one with 4/5 tables so i don't need anything fancy, but I do need to host it online somewhere as opposed to using an SQLite local DB

    PS: If anyone has a link to a simple guide to help with sending info from fragments I'd be very thankful, finding it horrible

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

    Distributing my app outside google play

    Posted: 25 Jul 2021 10:31 PM PDT

    Hi,

    I have this app released on play store that I want to make available on my website. I tried downloading the signed apk via the Google play console and use that, but some users in China have issues installing it.

    They get a message like this while installing: "Your device does not support Google Play Services and cannot install <app name>"

    I have a few Google sdk bits referenced in my project (signin, safetyNet, ads) which I would assume I need to delete before building for this apk version.

    What about signing? Can I simply build without the said code and distribute it? (Generate release apk in android studio) Or do I need to upload to play console and download the one signed from google?

    Please let me know if you have any clues on this, been banging my head around for a few days already.

    Cheers 👍

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

    Tracking down source of change in user aquisition

    Posted: 26 Jul 2021 05:49 AM PDT

    Just looking back on analytics, I'm trying to find out the source of this decline in new users in the end of October 2020

    https://i.imgur.com/BxGXWLd.png

    I feel it's either a Google Play algorithm change and/or suddenly ranking much differently for certain keywords. What possibilities do I have to try to figure this out?

    I looked at AppAnnie for keyword data, but for some reason the chart only renders ~3 months of keywords. Is this a glitch (can you see the whole year for your app(s)?) - any other way to get this information?

    https://i.imgur.com/zf1kAUD.png

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

    Which watch to develop with wear os?

    Posted: 26 Jul 2021 05:46 AM PDT

    I'm considering purchasing a smartwatch, to develop something in my free time for WearOs.

    Do you recommend some watch in particular for this purpose?

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

    Make sure to update your StateFlow safely in Kotlin!

    Posted: 26 Jul 2021 04:49 AM PDT

    Tic Tac Toe Game Development | Android Studio Tutorial | In 30 Minutes | Confetti Particle System

    Posted: 26 Jul 2021 04:28 AM PDT

    How do some developers get limited time events on Google Play? Is there a beta program for this?

    Posted: 26 Jul 2021 03:50 AM PDT

    AdMob Policies - Optional or Not?

    Posted: 25 Jul 2021 08:42 PM PDT

    I'm about to make an app that contains some sexual content and mostly non-sexual content. I've read the AdMob policy but one point that made me wonder was the below:

    while you can choose to monetize content covered by these Google Publisher Restrictions, this content will likely receive less advertising than other, nonrestricted content. 

    This means that If I have content that violates the Admob policy then Still my content can be monetized right?, but only it'll receive fewer ads, or Is there something wrong with what I've understood.

    Here's the link to the full AdMob policy: https://support.google.com/admob/answer/9335567?hl=en&ref_topic=2745287&visit_id=637628174163262647-1006654468&rd=1

    Also, my app doesn't show sexual content very explicitly. Can you please describe the full details of AdMob policy? Because I only understand the contents listed by them but I don't know whether it's optional or not.

    And If your answer is not optional, then take an app like Instagram(just imagine). If they use Admob then How will that be valid? because Instagram contains many contents(18+, sexual) that violate their policies? If your answer is optional, then I'm happy with it.

    submitted by /u/Ok-Duty-3411
    [link] [comments]

    No comments:

    Post a Comment