• Breaking News

    [Android][timeline][#f39c12]

    Saturday, May 2, 2020

    App Feedback Thread - May 02, 2020 Android Dev

    App Feedback Thread - May 02, 2020 Android Dev


    App Feedback Thread - May 02, 2020

    Posted: 02 May 2020 05:28 AM PDT

    This thread is for getting feedback on your own apps.

    Developers:

    • must provide feedback for others
    • must include Play Store, GitHub, or BitBucket link
    • must make top level comment
    • must make effort to respond to questions and feedback from commenters
    • may be open or closed source

    Commenters:

    • must give constructive feedback in replies to top level comments
    • must not include links to other apps

    To cut down on spam, accounts who are too young or do not have enough karma to post will be removed. Please make an effort to contribute to the community before asking for feedback.

    As always, the mod team is only a small group of people, and we rely on the readers to help us maintain this subreddit. Please report any rule breakers. Thank you.

    - Da Mods

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

    "It's a virus I hope you burn in hell!" is a valid Google Play Store review

    Posted: 02 May 2020 06:48 AM PDT

    A reminder that Single Activity App Architecture has been the official Google recommendation since 2 years ago (May 9, 2018)

    Posted: 01 May 2020 10:18 PM PDT

    Play console just stopped counting downloads yesterday at 11 PM, ok I guess?

    Posted: 02 May 2020 01:46 AM PDT

    Tests in the multi-module app

    Posted: 02 May 2020 02:53 PM PDT

    Hi Redditors.

    I'm curious where do you keep tests, especially instrumented test in multi-module architected apps?

    Do you create a separate module for tests or keep them in the `app` module altogether. I'm practising how tests might represent in multi-module apps, in a single module app, everything looks straightforward.

    For instance, if you have Test Suite which includes all major instrumented tests to test against the different flow, where do you keep those tests? As I mentioned in an `app` or in separate modules under their source code and invoke specific tests for an individual module? if that's so, how do you create whole test suite? I need Dagger in tests so I need some kind of initial TestComponent to have as well.

    Thanks in advance!

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

    Basic Android Application Development for young developers

    Posted: 02 May 2020 12:24 PM PDT

    Do I need an LLC or DBA for a nonprofit app?

    Posted: 02 May 2020 04:03 PM PDT

    I intend to make a couple of free, no ad, open source apps in the app store for the purpose of medical education or helping with patient note taking or something similar with no intentions of receiving any sort of revenue from them. I am concerned about what sort of things could i possibly be held liable for and if i need some sort of liability protection. The reason I ask is if someone does something stupid with the app or if I make a mistake and it gives wrong information about performing a medical task, or if i unintentional use copyrighted code. Can I offer these apps with no warranty and use at your own risk? Do I need to make an LLC? Does 'doing business as' offer any sort of protection?

    I am doing this as a hobby so I can learn programming and app development, and I am very much a beginner. And I am totally clueless about the legal side this sort of thing.

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

    With the Android Development world moving so fast, how do you cope up with fear of getting left behind? Are you always catching up on new libs/frameworks, feeling burned out and wondering you don't know enough?

    Posted: 02 May 2020 12:54 AM PDT

    I would like to find a way to hide these locked apps from recent panel. I don't want these apps to appear even though I clicked the "close all" button. (The reason behind locking these apps is that I want them to launch faster). Thanks in advance!

    Posted: 02 May 2020 02:42 PM PDT

    What should I program my game on

    Posted: 02 May 2020 02:36 PM PDT

    I'm planning to program a simplistic 2d Android game. I don't know how I should program it.

    Should I use unity, the Android dev kit, or any other viable options?

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

    Can someone please help me with banner ads to be displayed as an overlay for the activity?

    Posted: 02 May 2020 02:05 PM PDT

    I am using constraint layout for my app and have placed the ad in the end but as all real world apps display banner ads for the whole time what do I need to use for that? Cz my ads are only shown when I scroll down to the bottom. Can someone link a tutorial or any stackoverflow answer for it? Unable to find it. Thanks.

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

    Does AdMob have a criteria before it can start displaying ads in a published app?

    Posted: 02 May 2020 01:53 PM PDT

    My app has been in internal testing for a while and I published it today for all the users and it still doesn't show any banner ads. (Never showed in internal trst too. I have checked the code using test ad units and that works.)

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

    How do you manage the different file management code for different android versions?

    Posted: 02 May 2020 01:27 PM PDT

    Hi!

    I just recently started programming on android because of work and already face the problem of having to manage files in the device and the many different correct ways to do it depending on the API, so far I've been able to find alternatives to not to do so, but I fear the moment will come when this is not possible.

    For example, getexternalstoragedirectory() is now deprecated (alongside many others) but still works for API<29 (AFAIR) so if I have an app that has to runs in all APIs>20 how can I make that possible?

    I have yet to find a code that will let me manage files in API>29 since most of my attempts trigger a FileUriExposedException and AFAIK file manager only works on API>24 and I don't know if integrating that into my app will cause problems for phones trying to run it in APIs<24

    Is there a code that works fine for all APIs?

    This whole topic of managing files on Android has become a real pain for me and before I have to face a problem I can't find an alternative to I would like to find an answer.

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

    Android Emulator - how to use my own DNS?

    Posted: 02 May 2020 01:23 PM PDT

    Hi,

    for testing purposes I want to change IP of my website. I tried to modiffy etc/host but after countless unsuccessful attempts I gave up (read-only file system, images that can't be rooted, ...) and decided to change DNS. I am starting the emulator with -dns-server 10.0.2.2 and on my local machine there is a DNS server installed on port 53. The DNS works fine, all the DNS traffic goes through it, but the Android emulator just ignores it. If I run nslookup from within Android emulator, the website for which I have created a zone and overridden the IP resolves to the original IP. When use nslookup from Windows (local machine), it resolves to 10.0.2.2 properly. So it almost looks like if Android emulator ignored the dns. I have checked DNS settings and that was the case, DNS is set to 10.0.2.3. So I am wondering, how to change it? Why -dns-server doesn't work?

    I have read tens and tens of articles where people describe it should work, but I must be doing something wrong. Any idea?

    Thank you.

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

    How to reduce LiveData observers code in Fragments?

    Posted: 02 May 2020 07:12 AM PDT

    Hello, I am refactoring our android code and can't deal with the following issue. Some of our fragments contain too much code ( ~1000 lines of code), partially because of our business requirements and partially due to my incompetence... Basically our business requirements are the following.

    1. We can dynamically update our boolean flags from the backend.
    2. Our fragment should handle additional UI depending on boolean flags from the backend.

    I am following ViewModel + LiveData style to handle our UI logic. Basically some of our Fragments observe 5-7 different LiveData observables from our VM. Each of LiveData observers produce 20-100 lines of codes. They handle colors changing, the appearance of different dialogs, snack bars, or bottom sheets and etc.

    Right now I would like to reduce code in Fragments, but I am not sure how should I approach this problem.

    One solution which immediately comes to my mind is to use inheritance. For instance our fragment would extend FragmentFeature2->FragmentFeature3->FragmentFeature4->FragmentFeature5. All of them would observe particular LiveData inside of onViewCreated.

    Still, I think that inheritance seems like a hacky solution and will cause more issues in the future. Ideally, I would like to have the following scenario:

    Our fragment would create a different class per feature, which would act as a manager for particular LiveData. Problem is that you can't observe LiveData in a class, which doesn't have view-lifecycle owner. Perhaps I am missing something and someone can correct me :)

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

    Registration and Login Fragment

    Posted: 02 May 2020 12:38 PM PDT

    Hey guys,

    im developing and app where there is registration and login screen. Both layout files are almost identical. The only difference is that registration layout file uses one more EditText and different titles.

    Should I use just one fragment where I control the visibility of that EditText and Textview based on types (Login, Registration). Or should I have Login and Registration fragment which uses same layout file and then I control the visibility of views based on which fragment is shown.

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

    Made a Covid-19 related Flutter app. Tried to give it a neomorphic design.

    Posted: 02 May 2020 11:59 AM PDT

    Hello,

    I am a final year (Senior) student at University, studying Computer Science. During this quarantine period, I tried my hands on Flutter, and came up with this simple application related to Covid-19. I have done some Android development previously using Java and Kotlin, but this was my first using Flutter.

    Here are the features:

    • Global numbers for COVID-19 updated on a frequent basis.
    • Detailed statistics for each country.
    • Cool graphs for viewing the trends in the virus strain.
    • Important Links and other necessary information.

    You can download it here

    The source code is in github

    I hope you people can suggest me how to improve the app, and give me honest feedback. Thanks!

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

    Track Google Sheets Data

    Posted: 02 May 2020 11:38 AM PDT

    Is there a way to track data from a publically available Google Sheets doc and implement it in an app?

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

    I don't get it, when I check sys/fs/selinux/enforce or getenforce, it returns 1/Enforcing. But on my logs, it says permissive=1. Is SELinux enforcing or not?

    Posted: 02 May 2020 11:35 AM PDT

    Any insight would be helpful!

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

    In App Purchase Code Example

    Posted: 02 May 2020 11:10 AM PDT

    So, I'm trying to properly implement a simple non consumable In App Purchase for my app. I'm not using a backend server, everything will be handled inside the app.

    I have created a similar thread here

    But since then after lots of experimentation and searching I've managed to piece together this code, which seems to work fine after a test purchase I did. I've commented some parts to understand more easily. Also I'm using the latest version of the Billing Library.

    public class MainActivity extends AppCompatActivity implements PurchasesUpdatedListener { private BillingClient mBillingClient; // Add any managed product IDs you've added in Google Play console here. The product ID must be exactly the same. private String unlock = "unlock_app"; // A list to add all product IDs declared above private List<String> skuList = new ArrayList<>(); // Just a buy button to start the billing process private Button buyBtn; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Have the free app features here, such as ads banners. // Call setupBillingClient method setupBillingClient(); } private void setupBillingClient() { mBillingClient = BillingClient.newBuilder(MainActivity.this).enablePendingPurchases().setListener(this).build(); mBillingClient.startConnection(new BillingClientStateListener() { @Override public void onBillingSetupFinished(BillingResult billingResult) { if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) { // When BillingClient response code is OK, call the loadAllSKUs method. This will launch the billing flow. loadAllSKUs(); // This will check if the user already purchased any IAP. Then calls the handlePurchase method to unlock the app if any purchase is found. Purchase.PurchasesResult purchasesResult = mBillingClient.queryPurchases(BillingClient.SkuType.INAPP); for (Purchase purchase : purchasesResult.getPurchasesList()) { if (purchase != null) { handlePurchase(purchase); } } } } @Override public void onBillingServiceDisconnected() { } }); } private void loadAllSKUs() { if (mBillingClient.isReady()) { // Here add all declared Product IDs to skuList ArrayList. skuList.add(unlock); // Then if any Product ID is found in the skuList will start the purchase process // Finally if the purchase process was successful Google Play automatically calls the onPurchasesUpdated method. SkuDetailsParams.Builder params = SkuDetailsParams.newBuilder(); params.setSkusList(skuList).setType(BillingClient.SkuType.INAPP); mBillingClient.querySkuDetailsAsync(params.build(), new SkuDetailsResponseListener() { @Override public void onSkuDetailsResponse(BillingResult billingResult, List<SkuDetails> skuDetailsList) { if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK && skuDetailsList != null) { for (final SkuDetails skuDetails : skuDetailsList) { if (skuDetails.getSku().equals(skuList)) { buyBtn = findViewById(R.id.buyBtn); buyBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { BillingFlowParams flowParams = BillingFlowParams.newBuilder() .setSkuDetails(skuDetails) .build(); mBillingClient.launchBillingFlow(MainActivity.this, flowParams); } }); } } } } }); } } @Override public void onPurchasesUpdated(BillingResult billingResult, @Nullable List<Purchase> purchases) { // Check is BillingClient response code is OK and also that any purchase was successfully made // If both conditions are true the handlePurchase method is called. if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK && purchases != null) { for (Purchase purchase : purchases) { handlePurchase(purchase); } } } private void handlePurchase(Purchase purchase) { if (purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED) { // Unlock the premium app features here, for example remove any ads banners // Then remove any unnecessary features, such as the buyBtn buyBtn = findViewById(R.id.buyBtn); buyBtn.setVisibility(View.GONE); buyBtn.setEnabled(false); // Finally this will check if purchase is not Acknowledged and will do so if is not. // This is necessary since if any purchase is not Acknowledged it will be automatically refunded. if (!purchase.isAcknowledged()) { AcknowledgePurchaseParams acknowledgePurchaseParams = AcknowledgePurchaseParams.newBuilder() .setPurchaseToken(purchase.getPurchaseToken()) .build(); AcknowledgePurchaseResponseListener acknowledgePurchaseResponseListener = new AcknowledgePurchaseResponseListener() { @Override public void onAcknowledgePurchaseResponse(BillingResult billingResult) { } }; mBillingClient.acknowledgePurchase(acknowledgePurchaseParams, acknowledgePurchaseResponseListener); // You can also add a Toast message here if you want, such as "Thanks for buying". } } else if (purchase.getPurchaseState() == Purchase.PurchaseState.PENDING) { // I don't know if this else if statement is necessary but I added it either way. } } } 

    So my question is to someone experienced with this, is if anything is missing from my code.

    As I said I didn't experience any problem with the test purchase I did, but still I'm not sure that everything will work as it should.

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

    Android Manifest File Tutorial 2020

    Posted: 02 May 2020 10:54 AM PDT

    How can you pause a Foreground Service when the phone is asleep/locked?

    Posted: 02 May 2020 10:49 AM PDT

    I don't want the service to continue running when the user isn't using the phone, as in it's locked or asleep.

    I've used PowerManager powerManager = (PowerManager) getApplicationContext().getSystemService(getApplicationContext().POWER_SERVICE); for knowing if the phone is on.

    My question is:

    How can I pause, or stop the service when the phone screen is off, then continue, or start the service again when it's turned on?

    Is there another way than using an if else statements with stopService/startService? Or is that the only way?

    Thank you.

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

    Google play console stats acting weird.

    Posted: 02 May 2020 05:41 AM PDT

    Today all installs are touched zero. I guess something is wrong with stats or counting. Anyone having same issue?

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

    Does anybody knows how to fix this? I have change the .vmoptions but it still doesnt work. Please help.

    Posted: 02 May 2020 09:26 AM PDT

    Best way to avoid 1-star reviews on Google Play (due to known issues)

    Posted: 02 May 2020 07:11 AM PDT

    I have an alarm clock app for Android, rating is mostly positive - around 4.5, but I do get the occasional 1-star due to the alarm not triggering.

    Obviously, for most users the app works as expected, but then for a small percentage it doesn't - and i don't necessarily understand why.

    It could be the alarm broadcast not being triggered, or the service being killed due to some battery-saving feature, or just the MediaPlayer failing to play the file.

    I obviously have some safe-handling around these, but some users still experience.

    I am no longer trying to "chase" Android's alarm api shenanigans, but i am trying to minimise the damage.

    Other than a popup that says "please setup a backup alarm for the first few days" or something like that, what else could I do? Any suggestions are appreciated.

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

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel