• Breaking News

    Tuesday, February 2, 2021

    Android Dev - Weekly Questions Thread - February 02, 2021

    Android Dev - Weekly Questions Thread - February 02, 2021


    Weekly Questions Thread - February 02, 2021

    Posted: 02 Feb 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:

    • 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]

    Can I include a "Buy me a coffee" button in my game?

    Posted: 02 Feb 2021 05:06 AM PST

    Hi guys, I'm wondering if in my free game(no in-app purchase/no ads) I can add a button that redirect to my PayPal.me link via browser if people want to support my game. So no API, no donation inside the game. People have to login via browser in their PayPal account and choose the amount of the donation. It's against Google policy? Should I publish my game declaring that contains "in-app purchase option"?

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

    "Notice me senpai!" In Android Docs...

    Posted: 01 Feb 2021 10:53 AM PST

    "Notice me senpai!" In Android Docs...

    Found this gem while reading the docs of the Broadcasts

    Intent().also { intent -> intent.setAction("com.example.broadcast.MY_NOTIFICATION") intent.putExtra("data", "Notice me senpai!") sendBroadcast(intent)

    }

    Reminded me of:

    https://preview.redd.it/y059l2nfxwe61.png?width=596&format=png&auto=webp&s=0f4c9b8bc49a7e7b4fde111aca2eea828d360e7c

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

    How to handle Context within library module

    Posted: 02 Feb 2021 07:20 AM PST

    Hello,

    I am developing a library which contains classes that rely on having context passed to them. For example I have following use case:I provide a custom ViewGroup that can be used, this view group contains an object of another class, lets call it MyPlugin.class, which does some extra work in the background.

    MyPlugin provides a functionality (e.g. copying files from my assets in the project to a specific place in the internal storage of the app), which runs in a runnable.

    Now, to trigger this task of copying within the runnable, i need the context to get the internal storage files dir. I dont want to pass the context from view group to my plugin to my runnable, because it doesn't feel right and if the user of my library passes the activity as context, i fear it might lead to memory leaks.

    I was thinking to solve this by providing some static context reference, but I am not sure, what is the best way to solve this?

    edit:

    this is just a very simplified example, the real usage is more complex, but i would need some general advice in what is the best way to handle this problem, where context is getting passed around too much in such a library module

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

    +16% Installers with New Logo

    Posted: 01 Feb 2021 11:31 PM PST

    +16% Installers with New Logo

    I'm getting +16% first-time installers with a single logo change. I replaced the logo that my engineering ass made after dozens of iterations, with the one my ux designer brother whipped up in like 10 minutes.

    I guess I shouldn't be surprised that he outdid me? I'm still a little butt hurt tbh.

    https://preview.redd.it/rscmecioo0f61.png?width=1295&format=png&auto=webp&s=80f69aa3dc3ab1b559c38e1cafd38bffd85fe43d

    https://preview.redd.it/mm59x16hu0f61.png?width=2249&format=png&auto=webp&s=1cb3dd2fdc4f9902d7fbf50d8964e8cb550e0461

    Do you guys agree with the results? Where do you guys go to get your logos made?

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

    Tired of Admob, what is the best Ad network based on your experience

    Posted: 02 Feb 2021 05:24 AM PST

    Hi, hope you all doing well, I've used AdMob since 2017, but this year, AdMob start to place the ads limit in my account randomly, I tired of contacting them, changing the way I display the ads in my apps, but nothing changes.

    I tried to use FAN, but the eCPM is too low compared with AdMob, based on your experience what is the best alternative of AdMob I should use.

    Information about my traffic :

    120K - 140K: Ad Request

    Countries: Brazil, Mexico, Russia, Indonesia, USA

    Thank you

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

    Overlapping views in design (xml)

    Posted: 02 Feb 2021 06:32 AM PST

    So there is a view and when a button is clicked this view should be replaced with some other view (both of them are static). Because they are at the same place inside the view hiearchy, I have a situation that inside the xml they are overlapping each other. In code I handle the state where just one of them is being shown (with some fancy animation in betwen). It all works, but I was wondering how you guys handle overlapping views in design (inside xml) because it can get fast pretty ugly. Do you put them in a vertical Linearlayout or is there some trick to do it a little bit cleaner

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

    connecting phone to app

    Posted: 02 Feb 2021 08:07 AM PST

    so for my uni assignment i need to use android studio and run the app on a physical device, the problem is my phones usb port is broken, is there any other ways i can connect my phone to android studio?

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

    Unleash your emulator power speed using CLI command line

    Posted: 02 Feb 2021 07:51 AM PST

    I pretty sure u all having this problem, (I'm using API28 in my case), for anyone who using Windows 10 LAPTOP that comes with INTEL + NVIDIA display, your emulator must be slow. Why? because your emulator always consume only INTEL display and never NVIDIA. Even you have choosen "Hardware - GLES 2.0" in AVD manager, it just never run from NVIDIA. I am so doubting what is the purpose of "Hardware - GLES 2.0"??? It doesn't change anything AT ALL! I got 2 laptops and this is proven working.

    If your emulator is slow, please do following:

    first:
    cd "D:\your_sdk_path\emulator\"

    then check your available avd name by run this:
    emulator -list-avds

    this will return your emulator names.
    Finally run this to launch your emulator:
    emulator -avd <EMULATOR\_NAME> -gpu host
    or
    emulator -avd <EMULATOR\_NAME> -gpu on

    note for "-gpu on" or "-gpu host" at the end.

    You can now unleash your POWER!!!!!!!!

    Demo result

    You can also check from Task Manager so that it consume your GPU engine

    Task Manager

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

    How much device specific code is in your app?

    Posted: 02 Feb 2021 07:41 AM PST

    Im maintaining an app with 20k+ users and our crashlytics is going through the roof. Some of the issues seem to specifically appear on samsungs and some on huaweis (mostly to do with foregroundServices).

    We're considering trying out device specific code, but Im not how normal or necessary this is contrary to just finding the root cause of the bug.

    But I don't know. What are your experiences with seemingly device specific bugs?

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

    Is this the best way to implement my design??

    Posted: 02 Feb 2021 05:41 AM PST

    Hi,

    I am using Java to create my first android app and I am on a tight timescale. It is an app for weightlifting. I'm using Firebase Auth for user creation and sign-in. The user will use the app to record their weights, reps and RPE (Rating of perceived exertion) for selected compound exercises (Squat, Bench, DL, OHP, Row). The app should initially ask the user to input their 1 rep max for each of these exercises. From there the user will input the weight and reps each time they complete an exercise. The app will store this information and use it to calculate what weight and reps the user should complete when next doing the exercise. The app needs to look at the users historical completions of each exercise and be able to determine what level of progression fits the user..i.e are they a beginner, needing a linear progression or are they more advanced needing a wave loaded progression scheme.

    There will need to be an array of some sort to store the information about the exercises such as: Exercise, SessionID, Weight, Reps1 (set 1), Reps2 (set 2), Reps3 (set 3), RPE (only relevant to last set).....What is the best way to do this? I want to be able to display the progression to the user in the form of a chart or graph also.

    I am very new to Firebase, how can I link a user's information such as Squat 1 Rep max to their login details? Do I need to link them? 1 Rep max will be calculated and updated from the information in the suggested array above.

    I would also like to be able to view the progression for each exercise and be able to do things like implement a 'deload' session if the user hasn't hit their target weight and reps for so many sessions in a row.

    Would Firebase Database be a good solution?

    Sorry for such a loaded post but I'm a bit confused and stressed, please feel free to ask me to elaborate on anything....Thanks!!

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

    Finally emulator is available inside android studio for M1 !!!

    Posted: 01 Feb 2021 12:11 PM PST

    Kotlin Multiplatform for production?

    Posted: 02 Feb 2021 04:36 AM PST

    Hey, I am about to start a new project for a startup, where I have to choose a cross-platform framework for this.
    Multiplatform is one I was thinking through, as I am an Android developer myself and have a good idea about Kotlin. Do you think it is good to go to production? I know it is in Beta but yes my use case it more like a todo app where I need to upload the image and add some text. That's it.

    Or Shall I consider using React Native to be on safer side?

    submitted by /u/hi-manshoe
    [link] [comments]

    Can't find my app in Google Play Store

    Posted: 02 Feb 2021 03:07 AM PST

    Hey there, yesterday, I uploaded an app to Google Play, but you can only access to it using the link.

    If you try to search for it tou won't find it, unless you write pname: your.package.name

    Even if I select all the filters to reduce apps, appear way different apps and not mine. Not even in 'new apps'.

    Is this normal? Because if it is not promoted when it is released it is gonna be buried below other apps.

    Thank you for your help :)

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

    Fast migration from Kotlin Synthetics to View Binding- Tips and Tricks

    Posted: 01 Feb 2021 10:24 AM PST

    A Complete Tutorial to Connect Android with ASP.NET Core Web API

    Posted: 02 Feb 2021 02:45 AM PST

    An app that donates an X% of profits to a charity

    Posted: 02 Feb 2021 02:43 AM PST

    Hey everyone!

    I was wondering if anyone had experience with developing an app that has a donation of profits to a charity as a part of it.

    I have looked into guidelines on the App Store, and everything charity-related seems to be banned there. From what I have read, Android seems to not be as strict.

    Would any of you know what the guidelines are and where I can get such information from?

    Also, would it be allowed to market an app and state that a portion of the profits is donated to charity?

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

    Why are some methods in the android docs marked with a "#" instead of a period?

    Posted: 01 Feb 2021 08:42 PM PST

    A light and simple kotlin library for deep link handling on Android

    Posted: 02 Feb 2021 01:21 AM PST

    Store username/password in clear | I think i'm missing something

    Posted: 02 Feb 2021 12:49 AM PST

    So i'm reading a lot of security material (in general) especially into mobile context and i think i miss something. The problem for me is: why NOT storing username/password inside shared preferences/database in clear is such important? Let me explain.

    Let's say i access to my secret server via username and password. I run an app (i made) on my non rooted phone. I save my username-password pair in clear text INSIDE THE APP (NOT ON SERVER, where is encrypted,salted and such) to avoid to type in every time i enter in this app (i now i could save the token server send me but's not the point).

    So what's the danger here? You should say, if some hacker enter your phone they can read the username and password so they can enter in your secret server. But how ?

    App is sandboxed, phone is not rooted, access to my phone is blocked by pin/password/fingerprint. App is in release mode so he can't attach debugger.

    So why bother ? I guess i'm missing something. If anyone can give me any hint, it would be of very help

    EDIT: maybe it's not clear enough i'm talking about store on the phone the username and password to re-login the user without enter it manually. I'm not talking about storing on the server where i'm aware all the security should be in place

    EDIT: the point in my question is what are the ways that some one can use to exfiltrate that plain text information stored in my phone.

    EDIT: username - password are not hardcoded into source code

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

    How can I check my system has a running remote control app?

    Posted: 02 Feb 2021 12:07 AM PST

    Hi, guys.

    Is there any broadcast or something in the android system to notify a remote control app like TeamViewer is running?

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

    Create an App as a complete Beginner?

    Posted: 01 Feb 2021 10:38 PM PST

    Hi guys,

    i was searching for a certain app and couldnt find anything on the store..So i thought i might as well try and do it myself, since it doesnt seem like a complicated app.

    Now i would like your assessment of how difficult it would be to create an app with following functionalities:

    -Show Data on the screen when phone is locked (Display Data on always on display)

    -Show a list of Data in the notification bar (each item shown for a couple of seconds and then the next one follows)

    -Pull the Data from an online resource.

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

    Regarding the new Google FIT API updates (Android SDK 20.0.0)

    Posted: 01 Feb 2021 08:23 PM PST

    Google recently announced that they are making some privacy changes to google fit and the oauth scopes (most of them being changed to sensitive.) Has anyone else figured out what to do for the verification process? In the cloud dashboard, my app is in production but I do not have a webpage nor a terms and condition (user base is very small and app is just for private purposes). Shall I switch to testing? how would that affect the number of users in my app (testing allows only reduced number of users)?

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

    No comments:

    Post a Comment