• Breaking News

    Friday, May 8, 2020

    Android Dev - Weekly "anything goes" thread!

    Android Dev - Weekly "anything goes" thread!


    Weekly "anything goes" thread!

    Posted: 08 May 2020 05:40 AM PDT

    Here's your chance to talk about whatever!

    Although if you're thinking about getting feedback on an app, you should wait until tomorrow's App Feedback thread.

    Remember that while you can talk about any topic, being a jerk is still not allowed.

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

    Open Source: Medium Unlimited - Android App (Unlock articles behind paywall)

    Posted: 08 May 2020 04:40 AM PDT

    I developed a small application "Medium Unlimited" for Android, which lets you unlock articles behind the pay wall. You can also login and clap the unlocked articles.

    Link: https://github.com/firefinchdev/medium-unlimited-android/

    I am open to suggestions for improving the app. You can open issues suggesting improvements, bugs and feature requests. Would welcome PRs for the same. I will be actively working on them.

    Also, please star the repo for updates.

    P.S: For those who can afford, please consider buying a subscription from the official app. It involves a lot of efforts to maintain a platform like Medium, and writers deserve to be awarded for their excellent content.

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

    ConstraintLayout 2.0.0 beta 5

    Posted: 07 May 2020 05:20 PM PDT

    NHS Covid-19 android app source code

    Posted: 07 May 2020 02:29 PM PDT

    My app indexing government bills was suspended - thinking of replacing with a "censored by google" message - looking for other suggestions too

    Posted: 07 May 2020 03:21 PM PDT

    (this relates to the recent policy change around apps mentioning coronavirus)

    I'm working on an app that shows upcoming, ongoing, and past bills before parliament (in Australia), and going through the process for getting a closed pre-alpha distributed for testers. An unfinished part of this is allowing verified electors/voters to securely cast an (unofficial, nonbinding, etc) vote on whether they support a bill.

    Part of this is, of course, showing the title of bills, and since there are 4+ bills with "coronavirus" in the title the app's not only been denied the first review it went through it was also suspended (this was just for alpha release channel - tho not sure if a review here would let us publish this version).

    Anyway, given this is meant to accurately show what's going on in a democracy, simply hiding the solution isn't a long term solution since the user isn't notified of something being hidden.

    My idea currently is for this (and any future censorship 🤔) to show a red card with white text saying something like "This bill has been censored by <Google>. Tap for more info", and then replace the description-esq info with a similar message also including

    • a censorship ID (i.e. would be the same for all coronavirus censorships)
    • a reason, in this case something like "displaying this bill violates Google's policies for app distribution."
    • a link to a website that explains the censorship and quotes the Developer Distribution Agreement.
    • A link to a website that indexes the same information sans censorship.

    That said, it might not elicit the best response from google, so I'm curious if anyone has any suggestions.

    Another interesting thing is that this app (or a very related app) would be an interface between represented (non-government) parliamentarians and voters, which raises an interesting dilemma because we would not fall into any of the exemptions (similarly to how the Democrats in the US wouldn't be exempt)

    Furthermore, YouTube and all news apps should be removed since they aren't exempt either 😡

    Screenshots
    submitted by /u/646463
    [link] [comments]

    Haven't developed Android apps in a while, trying to get up to date is a nightmare

    Posted: 08 May 2020 08:28 AM PDT

    The last Android app I developed was about 3 or 4 years ago: I used Java, Butterknife, Retrofit, and Objectbox for persistence. Now I'm trying to get up to date to develop a new app using Kotlin, but trying to find out what I should use is a nightmare:

    • Butterknife is deprecated, but with Kotlin I can use something called synthetics. But wait, that is no longer recommended. Maybe I should use this DataBinding thing. But there is an even newer thing called ViewBinding!

    • I heard that with Kotlin I can use Anko to make things easier. But that is deprecated, now I can use Kotlin Extensions. But the official link about Kotlin Extensions redirects to a different web that talks about something called KTX. Is that the same thing?

    • AsyncTask task is no longer recommended. What should I use instead? Coroutines?

    • Coroutines are supposed to make working with callbacks (in Retrofit, for example) easier, but boy, after watching youtube tutorials I think I'll stick with callbacks.

    Anyway, my main complaint is that there are dozens of ways and tools to do the same thing, every couple of months there is a newer one, and every tutorial/course/book I check uses different methodologies (even official Google tutorials), so I don't know what I should use. Can you recommend me sources that are up to date so that I can learn what are the current de facto practices, tools, libraries, etc?

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

    Is it necessary to not do any non-UI work on the UI thread?

    Posted: 08 May 2020 07:30 AM PDT

    When you are writing non-UI code that is trivial, e.g. setting some local variables, subscribing to some listeners, etc; then do you believe you should offload the non-trivial operation off to a BG thread?

    I agree that IO should always be performed on a BG thread, or expensive computational operations such as calculating exponential decay, but not sure about the non-expensive, trivial tasks.

    I see many different opinions on this, so asking what the community believes is OK and not OK.

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

    MIUI 12 has a smooth screen rotation animation, so why don't Google fix this for Android?

    Posted: 07 May 2020 04:16 PM PDT

    Cannot figure out the role of findviewbyid()

    Posted: 08 May 2020 07:17 AM PDT

    I was working a piece of code that uses setOnClickListener on textviews. The for loop at the end sets the click listeners to each of textview in List. However, both of list I declared work perfectly depsite the fact that list colorViews is just the list of id of view, not the view itself as determined by findViewById().

    Are findViewById(R.id.something) and 'something' of type? If not please tell why the code below is working fine when it shouldnt.

    I am new to Android and tried googling to no avail. Any help is appreciated.

    val boxOneText = findViewById<TextView>(R.id.box_one_text) val boxTwoText = findViewById<TextView>(R.id.box_two_text) val boxThreeText = findViewById<TextView>(R.id.box_three_text) val boxFourText = findViewById<TextView>(R.id.box_four_text) val boxFiveText = findViewById<TextView>(R.id.box_five_text) val redButton = findViewById<TextView>(R.id.button_red) val greenButton = findViewById<TextView>(R.id.button_green) val yellowButton = findViewById<TextView>(R.id.button_yellow) val rootConstraintLayout = findViewById<View>(R.id.constraint_layout) val clickableViews = listOf(boxOneText, boxTwoText, boxThreeText, boxFourText, boxFiveText, rootConstraintLayout,redButton, greenButton,yellowButton) val colorViews =listOf(box_one_text,box_two_text,box_three_text,box_four_text,box_five_text) for(i in clickableViews) { i.setOnClickListener{makeColored(i)} } 

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

    Beyond Basic RxJava Error Handling

    Posted: 08 May 2020 05:59 AM PDT

    Android Studio 4.1 Canary 9 available

    Posted: 07 May 2020 03:50 PM PDT

    How do you manage your application's preferences?

    Posted: 07 May 2020 09:37 PM PDT

    Hi, Android devs!

    So the other day I was asking myself this question: how do you manage your preferences? I mean, not if using the SharedPreferences API, an encrypted Json or a plan text file in the user's internal storage, but in the application, the activity of handling the settings (e.g. notifications, colors, etc.).

    Do you use a library? Do you make the activity manually and the a java class where you save the changes?

    I'd be glad to know how you manage this!

    Thanks!

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

    How do you experiment with new features in mobile apps?

    Posted: 07 May 2020 01:12 PM PDT

    Hey r/androiddev,

    I'm Carmine, a researcher at the University of Zurich. Together with other researchers from Canada, The Netherlands, and Spain, I'm currently investigating how mobile app developers are experimenting with new features in their products.

    For developers, it is hard to predict the success of a feature. For example, they cannot discover all defects during the testing phase and some defects will only appear after products are deployed to production. To mitigate the risk of delivering buggy features to users, developers often adopt incremental releasing strategies, such as Continuous Experimentation (CE). CE also helps developers to determine if the new features are successful in serving the business goals and refine or revert them if needed.

    Rather than delivering content directly through the web browser, mobile app users install applications on their mobile devices (e.g., smartphones, tablets). Mobile app developers need to deliver new releases from a software organization to app stores that curate mobile apps and make them available to users. In such a scenario, app stores might act as a bottleneck between software organizations and users, which may impose delays in the release process.

    To better support mobile app developers, we ask you to share your expertise and experience by answering a few questions in the following survey: http://tiny.uzh.ch/131

    Our ultimate goal is to understand the state-of-the-art in applying CE in mobile apps. We are going to share the anonymized answers together with the analysis of the results with your community.

    Comments and feedback to this post are very welcome!

    Best regards,

    Carmine Vassallo

    Doctoral Student at the University of Zurich, Switzerland

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

    Huawei offered me thousands of dollars to integrate their SDK and publish my apps into their huawei app gallery.

    Posted: 07 May 2020 11:16 AM PDT

    This is too good to be true, so what's the catch? I'm from Europe, and not from the USA, so I don't think there would be a problem (because of the USA banning Chinese businesses). It looks like I need to integrate their SDK and remove anything Google related (IAP, SDK, etc) and register in their platform, providing ID + credit card photo. Well here is the problem. I'm not okay with providing these details. Have you guys registered as developers in huawei's site?

    Edit: Not the guy who contacted me asked me fro my ID and for my credit card! It's on their website! -> https://developer.huawei.com/consumer/en/doc/help/100103

    Edit2: They also offered me a lot of benefits (revenue share for ads + in app purchases) like in the first year 100% for the developer and huawei 0%, then 90% - 10% and finally 80% - 20%.

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

    Best way to model Object Classes linked to other Object Classes?

    Posted: 08 May 2020 05:55 AM PDT

    I'm trying to make a sports stats app in Java/Android + Realm.

    I have the following classes:

    Season Player Matches 

    I would like the Season to contain a "list" of all the players that played that season and Players to have a "list" of matches. So when I click on a season, it will show me a list of all the players in the season, similarly with Players and Matches.

    I currently have actual lists as attributes to each class. For example the Player class:

    public class Player { String name; Int wins; Int losses; List <Matches> matches; } 

    Where I would just use the .add function to add to new matches to the player. Also I did take off some syntax related to Realm for simplicity, but this would be a RealmObject.

    Is there a better way to do this? I noticed issues with this implementation, like if I wanted to get all the Matches associated with the season. I would have to go through each player, and account for duplicates. Similarly if I wanted to view all players regardless of Season.

    What would the better way be?

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

    How to compare a arraylist with nested arraylist in kotlin?

    Posted: 08 May 2020 04:50 AM PDT

    I am new to kotlin . I am trying to create simple tic tac toe game app.

    In many tutorial i have seen most of them using if statement to find the winners.So i tried to modify with predefiend values and check them with players input.

    \\ this funtion checks the winner , where player1 and player2 are arraylist. \\ example : player1 = [1,2,8] and player2 = [4,5,6] fun checkWinner(player1,player2){ var possibleCombos = arrayListOf( arrayListOf(1,2,3), arrayListOf(4,5,6), arrayListOf(7,8,9), arrayListOf(1,4,7), arrayListOf(2,5,8), arrayListOf(3,6,9), arrayListOf(7,5,3), arrayListOf(1,5,9)) for(items in possibleCombos) { if(a.containsAll(items)) { Toast.makeText(this,"Winner is A $a",Toast.LENGTH_LONG).show() } else if (b.containsAll(items)) { Toast.makeText(this,"Winner is B $b",Toast.LENGTH_LONG).show() } else { Toast.makeText(this,"Game is tie",Toast.LENGTH_SHORT).show() } } } 

    It is not working and the else part is executing always. I want to toast the result.

    Any solution?

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

    Need help with android screen mirror

    Posted: 08 May 2020 04:41 AM PDT

    Hello guys i want a create an application where i can stream my android screen to web browser via http but cannot figure out how to transmit internal audio over it... as far as i have researched MJPEG doent support audio and how can i use a different format?

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

    Android MessagingStyle Notification As Clear As Possible

    Posted: 08 May 2020 12:55 AM PDT

    Android Dev Conf status?

    Posted: 07 May 2020 07:06 PM PDT

    Any word on what will happen this fall for the Android Developers Conference at Google headquarters? Usually in October. I've posted this in the weekly questions, but theres been no response, and no word from Google.

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

    Answers to common questions about App Signing by Google Play

    Posted: 07 May 2020 01:09 PM PDT

    Move file from externalFilesDir to Downloads?

    Posted: 08 May 2020 02:24 AM PDT

    My app creates some pdf files. The user can view a list of these pdf files and choose which one he wants to download. When he clicks download, the pdf file should be "downloaded" into the download directory of the device. So far i have made it so that the app copies the pdf file into the download directory and notifies the user with download manager. Until recently it still worked, but since my device has now updated to android 10, I get the error message EACCES (Permission denied). However, i don't want to enable legacy support because the problem with android 11 is back again. So what should i do now?

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

    So I filed a suggestion at Googles Issue tracker for Android Studio... I guess they have the same treatment when it comes to terminated developer accounts?

    Posted: 08 May 2020 01:51 AM PDT

    Mobile App User Testing on a Budget: A Practical Guide

    Posted: 08 May 2020 01:10 AM PDT

    What are these trichrome packages using data?

    Posted: 08 May 2020 01:10 AM PDT

    imgur.com/a/OxMnG3K

    I'm wondering what those two are at the bottom of the list? I understand trichrome is an underlying library for both Chrome and System WebView, but I have never seen these use data before, and these packages aren't actually in my systems app list when I look either. The 2.04mb of data was used May 1st, which was a day that my browser was hijacked by one of those "Congratulations on the billionth search!" with a bunch of confetti messages while browsing Google for answers on an unrelated issue related to Xbox Gamepass. I know they are probably unrelated as those hijacks are generally not used to distribute zero day malware but still makes me a bit nervous. Anyone ever seen these packages use data before?

    Using an Xperia 5 running Android 10. Sorry if this is slightly off topic but there aren't any good places to ask for support on Reddit for Android, oddly. The Android sub tells you to ask support questions on brand specific subs but that really narrows the answers you can get and in my case the Xperia sub is pretty dead. I suppose this is also slightly dev related anyway though, given trichrome is supposed to be the underlying structure for web browsing in Android 10.

    submitted by /u/Asuka-02-
    [link] [comments]

    No comments:

    Post a Comment