• Breaking News

    Monday, July 12, 2021

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

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


    Weekly Who's Hiring Thread - July 12, 2021

    Posted: 12 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]

    Jetpack data store first release candidate is released v1.0.0-rc01

    Posted: 12 Jul 2021 08:54 AM PDT

    Added Scoped Storage support to app and...

    Posted: 12 Jul 2021 09:01 AM PDT

    ...users are pissed with bad reviews (Android 11+), that they cannot directly browse the root of Internal Storage and removable SD Card in-app directly (for playing media mind you), and now have to use the SAF to pick and manually add root folders to browse in-app.

    It's a regression in term in usability, which made something simple more complicated. Some users seem to be confused with the SAF for allowing a folder to be browsed by an app (ACTION_OPEN_DOCUMENT_TREE).

    There's also no way to enumerate all the files of the Downloads folder (files owned by own app excluded). Only way to access files there is having users manually pick one file with the SAF. This sucks. Thank you Google for making developers have to downgrade their apps on Android 11+ and make both developers and users miserable. I'm evaluating reverting to targetSdkVersion 29 until it is absolutely mandatory to use fucking 30.

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

    Things you need to know before switching to Jetpack Compose

    Posted: 12 Jul 2021 07:47 AM PDT

    AR Use Cases and How to: Image Tracking

    Posted: 12 Jul 2021 06:47 AM PDT

    Changing the text color of edit text context menu (copy/paste/cut)

    Posted: 12 Jul 2021 08:09 AM PDT

    I have an input component with an EditText with custom styles, but the context menu, that appears on long click with copy/paste options, have all white text on a white background so it's practically not visible.

    Do you know of a way to change the text color of the context popup menu?

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

    Prevent App from getting tagged as game by Samsung Game Launcher

    Posted: 12 Jul 2021 07:26 AM PDT

    We have a video app that Samsung phones and tablets are seeing as a game app so it gets pulled into the game launcher.

    What code do we need to change/implement to prevent this from happening?

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

    Android App is not approved with SSL Error Handler

    Posted: 11 Jul 2021 08:19 PM PDT

    I released production Android app in last month, but I got a trouble with SSL Error Handler.

    I followed Google's tutorials and Google doesn't still approve my app.

    My code has implemented the following:

    Any Fragment or Activity that uses WebViewClient, I've controlled SSL Error like this

    public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { LogI("onReceivedSslError: " + error.getCertificate()); AlertDialog.Builder builder = new AlertDialog.Builder(ctx); AlertDialog alertDialog = builder.create(); String message; switch (error.getPrimaryError()) { case SslError.SSL_UNTRUSTED: message = "The certificate authority is not trusted."; break; case SslError.SSL_EXPIRED: message = "The certificate has expired."; break; case SslError.SSL_IDMISMATCH: message = "The certificate Hostname mismatch."; break; case SslError.SSL_NOTYETVALID: message = "The certificate is not yet valid."; break; case SslError.SSL_DATE_INVALID: message = "The date of the certificate is invalid."; break; default: message = "A generic error occurred."; break; } message += " Do you want to continue anyway?"; alertDialog.setTitle("SSL Certificate Error"); alertDialog.setMessage(message); alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, "OK", (dialog, which) -> handler.proceed()); alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "Cancel", (dialog, which) -> handler.cancel()); alertDialog.show(); } 

    So, Why does my app not approve? What should I do next?

    Thank you for your advices!

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

    How to get all file access permission for social networking app?

    Posted: 12 Jul 2021 09:32 AM PDT

    I have a social networking app which needs to access media files of all type (apk,txt,doc etc) includes media files and it shared within app's built in chat system. I recently upload app on play store to review which asked me to mention uses of scope storage permission so i mention to share files and upload a walkthrough video by showing sharing an image with other user. Can anyone please help me out how can i get manage_external_storage permission and what i need to show in video and description to google play All access storage permission.

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

    Top Android App Development Trends To Look For in 2021

    Posted: 12 Jul 2021 05:44 AM PDT

    Upload files one by one with Firebase?

    Posted: 12 Jul 2021 02:05 AM PDT

    My use case is like, I have to upload multiple documents to Firestore. Before uploading each document, I have to upload multiple files to storage, get link, put them in document, and then upload the document.

    I'm not sure how to upload multiple files one by one while uploading each document one by one. I'm unable to find any good resource for this. Any help would be appreciated. Thanks.

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

    Shopify screenshot testing

    Posted: 11 Jul 2021 09:48 AM PDT

    The Oppo and Realme phones have a Private safe feature in it ...When we move our private media files to set as private .. Can any other apps which we are allowing Storage permissions see the files moved to Private safe and get it even if we use password or fingerprint encryption ?

    Posted: 11 Jul 2021 10:38 PM PDT

    The Oppo and Realme phones have a Private safe feature in it ...When we move our private media files to set as private .. Can any other apps which we are allowing Storage permissions see the files moved to Private safe and get it even if we use password or fingerprint encryption ?

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

    Hi, I have a question for Android Studio. Is there any way I can make something like the one in the image using Android Studio? Thanks!

    Posted: 12 Jul 2021 02:31 AM PDT

    Can an Android .apk file be configured in such a way where it can only be played on a certain type of Android OS system, and therefore can't be played on a Android device that is being powered by a different Android configuration?

    Posted: 11 Jul 2021 09:57 PM PDT

    Can an Android .apk file be configured in such a way where it can only be played on a certain type of Android OS system, and therefore can't be played on a Android device that is being powered by a different Android configuration?

    For example, if Amazon created an app that they only wanted Kindle Fire HD OS to access, and did not want that same app to be accessible by any other Android OS powered devices, could they do it?

    It's basically a form of DRM and copy protection...

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

    Best practice to organize user preferences/settings?

    Posted: 11 Jul 2021 11:56 AM PDT

    I didn't find much information about this on the internet. I think this could be applied to any software (mobile apps, games, desktop software…) development.

    So, say we make a new app with initially 1 preference:

    • Preference for "theme": lets the user change between "light" and "dark" themes.

    Assume it is stored in SharedPreferences (maybe it could also be applied to databases or plain text files). So we could store it by these ways:

    0) We decide to save it as a boolean:

    • key: <"theme_is_light">, current value: ["true"]

    Pros I see: Quick to implement, few lines of code. Best performance(?).

    Cons I see: If you were to add more themes (blue theme, gray theme...), then..oops. You can't:

    • Would need to migrate "theme_is_light" boolean to another type of value (string, int or long), since booleans only allow two values.

    So I thought about the other options.

    1) Store <preference name> as key, [item name] as value. Like this:

    • key: <"theme">, current value: ["light"]

    Pros I see: If in the future you were to add more themes, it's just as easy as adding a new value (e.g. "blue", "grey"...).

    Cons I see: If you decide to delete a theme value (e.g. you delete "light"), then you'd need to keep track of old removed values to avoid unexpected behaviours when users update from old versions.

    2) Store <incrementing int/long number> as key, [item name] as value. Almost like databases do:

    • key: <"0"> (previously "theme"), current value: ["light"]

    Pros I see: Now we don't have to worry about previously used keys.

    Cons I see: Values have the same problem as before, need to keep track of old unused values to avoid potential conflicts between versions.

    3) Store <incrementing int/long number> as both key and value:

    • key: <"0"> (previously "theme"), current value: ["0"] (previously "light")

    Pros I see: Looks very flexible.

    • Want to add a new theme? Just add a new number.

    • Want to replace a theme? Remove code for old theme value and replace it by using the same number or even use a new number.

    • Want to delete a preference? Just remove the code using that number.

    • No need to keep track of which old preference names were used or deleted, you know it just by looking which numbers are being used.

    • No need for migration code that you'll need to carry for the rest of your existence.

    In fact we could have every single preference key as a number and separate the key numbers by value type (i.e. separate strings, longs, ints...). This way, we could reuse them if desired or just add a new one (for example, you probably wouldn't want to reuse a String preference that saves text typed by the user).

    So longs/ints/booleans could use numbers as keys and values, while Strings/JsonArrays/etc would use numbers only as keys.

    In case we wanted reusing, we'd need to make sure previous and new key are the same type, but I see it totally possible.

    Code handler could look like this:

    class PreferenceManager { // "Hard-coded" key numbers // We could use an Enum/IntDef here final static PREF_KEY_THEME = 0; // …more pref_keys here // "Hard-coded" value numbers final static PREF_VALUE_THEME_LIGHT = 0; final static PREF_VALUE_THEME_DARK = 1; // …more pref_values here public void handlePreference(String preference_key, int preference_value) { //SharedPreference keys are Strings, so we need to convert it to Integer int key = Integer.parse(preference_key); switch(key) { case PREF_KEY_THEME: switch(preference_value) { case PREF_VALUE_THEME_LIGHT: changeThemeToLight(); case PREF_VALUE_THEME_DARK: changeThemeToDark(); } case …: … default: Log.e("MyTag", "Preference key doesn't exist, do nothing."); } } } 

    Cons I see: Maybe not the best performance(?)

    • Requires more code. Need to declare more variables.

    • Harder to read preferences file. You open it and all you see is numbers, you depend on the code to be able to tell what the preferences do. Maybe not a problem, since the code would be legible.

    So is the 3rd approach good? Is it viable? Is there a better way?

    What do you think?

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

    How can I mock dependencies in my activities for tests?

    Posted: 11 Jul 2021 11:41 AM PDT

    So I've got an android app that I have put together using Dagger. I am in the process of writing integration tests with espresso and the test support library. I'm new to Android development in general, but I'm an experienced web dev.

    My main goal is to mock the SQLite-related classes so I can control the data in my otherwise full integration tests. All those classes come from dagger. I would think that maybe I can build a dagger component in my test and provide mocks to it, but I'm really not sure.

    Advice is appreciated.

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

    Anyone who can take in a mentee?

    Posted: 11 Jul 2021 12:01 PM PDT

    I've been developing android apps for about 6 months now. I've just finished my graduation. I am not looking for jobs. But I want to develop my own applications and make a living of it. I've learnt a lot of technologies in android. But I need some guidance for the path I'm choosing.

    If anyone can become my Mentor, I'll be eternally grateful. Anyone who is making a living by making their own apps or by start-up agency for app development. I'm not looking for anything big. I want just want to learn.

    I like to think that I'm a sincere guy. And promise it won't be a bad experience. I'll also try to be helpful to you, if you(the mentor) need anything.

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

    No comments:

    Post a Comment