• Breaking News

    Wednesday, January 29, 2020

    Android Dev - Engineering blogs you follow

    Android Dev - Engineering blogs you follow


    Engineering blogs you follow

    Posted: 29 Jan 2020 06:18 AM PST

    Any engineering blogs you follow? Right now I'm following Netflix's engineering blogs on Medium.

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

    FragmentContainerView is now the recommended View to use in order to host Fragments instead of the previously common way of using FrameLayouts.

    Posted: 29 Jan 2020 01:07 AM PST

    Doing animations with Jetpack Compose

    Posted: 29 Jan 2020 08:35 AM PST

    x86 secretly deprecated by Google?

    Posted: 29 Jan 2020 07:31 AM PST

    I have an Asus Zenfone with Intel CPU and notice that more and more apks lack the right native libraries it requires.

    It started with a banking app on a version change, but more apps followed soon. There was always only a minor version bump, no major release, no complete overhaul. Everything except armeabi-v7 and arm-64 gone in a sudden.

    Was there some accouncement i have missed?

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

    Why commitNow does not set fragment to null?

    Posted: 29 Jan 2020 07:49 AM PST

    I have tried to use commitNow for ensuring that fragment transcactions are synchronous. However, after my testing, I found that for some reason commitNow does not remove fragments immediately.

    I have added a Handler with postDelayed 100 milliseconds and the fragment was still not null. After that, I changed postDelayed to 1000 mmiliseconds and finally, fragment was null.

    How can I ensure that the fragment is null immediately after I call commitNow? I tried to add supportFragmentManager.popBackStack(), but no help.

    If it is impossible to make fragment null immediately, how can I check if that fragment is no longer in the stack, before adding the same fragment?

    UPDATE I found that if I removed setCustomAnimations, then transactions are indeed occurring immediately. How can I observe when setCustomAnimations have finished?

    val fragment = supportFragmentManager.findFragmentByTag(DEMO_FRAGMENT) if (fragment != null) { Log.d("test", "DEMO_FRAGMENT is not null") val fragmentTransaction = supportFragmentManager.beginTransaction() fragmentTransaction.setCustomAnimations(R.anim.custom_fade_in, R.anim.custom_fade_out) .remove(fragment).commitNow() supportFragmentManager.popBackStack(); Log.d("test", "is fragment null:${supportFragmentManager.findFragmentByTag(DEMO_FRAGMENT) == null}") Handler().postDelayed({ Log.d("test", "is fragment null:${supportFragmentManager.findFragmentByTag(DEMO_FRAGMENT) == null}") }, 1000) } } 
    submitted by /u/wellbranding
    [link] [comments]

    Google Suspended our App and Threatened to Delete all our Google Accounts Over Nothing

    Posted: 28 Jan 2020 01:37 PM PST

    Developer support [bot] is just getting *even* worse

    Posted: 28 Jan 2020 09:32 AM PST

    Developer support [bot] is just getting *even* worse

    Brace yourselves... I thought it was impossible but now even the bots are failing to fill the email about policies violation.

    May the gods help the android developers... \o/

    < INSERT EXAMPLE TEXT >

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

    Livedata ? Coroutines ? Full RxJava ? What is the best suited ?

    Posted: 29 Jan 2020 09:26 AM PST

    Hello, I'm a junior developer trying to build a small app using up to date best practices and architecture. I'm running into issues that I don't know how to handle and feel a bit lost about it, especially since all the examples I find seems strongly opinionated.

    My current architecture is the following

    I have 3 parts: View, ViewModel & Services.

    I use LiveData in my ViewModels to expose data to the view. ViewModels directly calls service's methods, using simple coroutines if they need to run on a background thread (I just use GlobalScope.launch() for now, I don't use scopes yet, nor channels, flows, ...)

    My current problems and possible improvements

    My ViewModels seems to have too much responsibilities and that cause me troubles (especially with Firebase, which can trigger a model update at any time), so I would like to add a Repository layer as it seems to be the right thing to do.

    I'm not sure how to do it. Should the Repository methods return raw data ? Should they expose LiveData like the ViewModel ? Should they expose "coroutine's streams" and handle lifecycle manually ? RxJava on another hand, seems to do it better, especially for error handling. Do you have good examples of code ?

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

    Recyclerview multiple viewtypes with Room, Livedata, Paging

    Posted: 29 Jan 2020 01:52 AM PST

    Anyone using Room along with Livedata, Paging (Jetpack)? Have a query. Use case: Think like Facebook news feed. It has story bar (horizontal recyclerview) at top. Then posts. In between posts, sometimes they display the story bar again! My app will have somewhat similar scenario. How to implement it using recyclerview, room, paging? Previously, while using dummy data, I created recyclerview with recyclerview.adapter, the adapter will handle a generic feed item type class. Then both posts and storybar will extend feeditem. While passing the list of posts to the recyclerview, I'd add those storybars in appropriate position. In the recyclerview adapter, onbindviewholder, I'll check their types, and populate them accordingly. It was working fine as long as I didn't try to implement database (room). When using room and paging, recyclerview adapter must be PageListAdapter. How to inject those storybars in the adapter items? Please note that if possible, I don't want to store storybar as say dummy post (with all actual post fields empty) in the database. If this is the only solution you think, please mention that also. Don't know if I clarified properly. If anyone is interested, and wants further clarification, please say so.

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

    Learning proper ("popular/mainstream") look of aps

    Posted: 29 Jan 2020 08:49 AM PST

    Hey, I have tried to create app to keep information about products in my fridge (like quantity, exp date, is it open or not) then I wanted make next element of app with dishes (recipes) and show user dishes that he can create with his products or make shopping list with missing products.

    I have suspended the project because I have seen how little I know about elements which I can use in my app and how bad it looks

    Just look at this screen, its terrifying. (text on screen is in polish)

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

    I know about https://material.io/design/ . Is there something more which could help me?

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

    Is there anyone that could help me with Retrofit with MVVM ?

    Posted: 29 Jan 2020 08:20 AM PST

    here is my question :

    https://stackoverflow.com/questions/59970882/android-mvvm-with-retrofit-and-livedata-issues

    im new to mvvm so any advice, hint or corrections would be really appreciated <3 <3

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

    Coroutines and Java Synchronization Don't Mix

    Posted: 28 Jan 2020 10:46 AM PST

    How important is your regression testing?

    Posted: 29 Jan 2020 07:58 AM PST

    As our app gets bigger regression testing is becoming more and more important. Currently we have a single QA performing this task manually. As you can understand this is time consuming and not efficient.

    So I'm asking, what do you do? And how important is it to your process?

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

    Android Studio project behaving strangely after recovering from apk.

    Posted: 29 Jan 2020 12:26 AM PST

    Hello, Android Studio messed up my project and overwrote 90% of my files with useless code. All layout files except for content-main and all activities except for the MainActivity are affected, even the grade settings. During this recovery maybe something got messed up in the textViews are sometimes displayed too small, text inside of the buttons is stuck to the top left corner, all of this cannot be changed, the setting for that is just not available. All constraint layouts are now transparent, they used to be white. I hope someone has seen this behavior before. Just to make it easier for you and me I have already posted this on Stackoverflow with source code and screenshots.

    Thanks in advance!

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

    With a shifting Android roadmap on Storage, is it better for independent Android developers to sit out the Storage Apocalypse (and is iOS a better long term platform for independent developers) ?

    Posted: 29 Jan 2020 02:56 AM PST

    Android is now the dominant mobile platform

    The need to develop Android apps will remain for companies that want app versions for both iOS/Android - thus company and contract work will always remain.

    And Android is a robust platform which is now more dominant than iOS across the world.

    HOWEVER, for independent developers the last few years have been bumpy. The lack of a stable roadmap, combined with a reversal of Android's long standing "old apps will run on new Android versions" mantra means that independent developers now face a greater burden of support - having to look back at apps that were mature, having to reengineer workarounds, and handle support calls. All without extra revenue. And being distracted from working on newer apps and new revenue streams.

    The backtracking in their code to fit new rules that apply retroactively, elimination of entire niches of apps (which may render them suddenly economically unsustainable to continue with Android), and the increased support costs as earlier users who were happy, now complain that now their app has failed them.

    The last year or two has been especially distracting - it has distracted certain classes of developers (those niches that got affected) so they could not focus as much on new development, but wound up working to bring old users into line with new Android policies and restrictions - this was all work which did not bring added revenue (more work, without return, or just to stay in place).

     

    Android as a bait-and-switch "open" platform

    Whether this is a result of a colossal bait-and-switch is open to debate - whether the "open platform" and all that was just to bring users and developers into Android vs. iOS during Android's early years, with intent to switch to an iOS-like format eventually.

    However, the practical impact of this is that Android has a roadmap that is not reassuring for independent developers.

    Google's policy changes have affected whole classes of apps (Call/SMS affecting call recorder apps, offline SMS backup apps, U.N. polio monitoring apps).

    Google's changes for Storage promise a disruption of bigger scale than before - for example, compared to their Call/SMS fiasco.

     

    Android is not a separate entity

    What is worse, Android is not a separate company, but serves as the subservient unit to Google's wider interests in search and advertising. Thus Android's direction as a mobile platform of global import is compromised to the unrelated needs of Google's other needs. This may be one reason why Android seems to shoot itself in the foot sometimes - harming developers with their changes, and users one year later as those changes appear without challenge on user devices.

    Users and developers are merely participants without a say in it's eventual direction. This is untenable for a mobile platform that increasingly has strategic value to the world.

     

    Android is not iOS

    Given the vast diversity of devices and android versions which don't update in lockstep (like they do for iOS), has always made Android a more difficult platform to support for independent android developers.

    However, that was with the Android mantra of "old apps always work on newer Android versions".

    Now that Google has dispensed with this mantra in the last few years - Call/SMS changes being one example where earlier apps stopped working (call recorder apps could not work as before), and Storage being the next big one (and will be of greater impact) - it raises new questions about the viability of Android as a platform for independent developers.

    Independent developers for the last few years have had to deal with:

    • app niches which disappear at a whim (which leads to revenue shortfalls the disrupt independent developers' viability).

    • bot-driven app bans and unresponsive support that is not answerable to anyone. And the outrageous concept of some abstract threshold for irreversible lifetime career ban on a developer create a climate of master over slave. While early Android needed developers to drive their store, now Android seems to relish in the ways it can extend it's cruelty to developers. The more arbitrary the punitive punishments the more "power" a rule seems to enjoy. Meanwhile in the real world, the "3 strikes and you are out" rules are recognized as oppressive policy - that hasn't filtered into the think tanks within Google.

    • reversal of age old mantra "old apps will work on newer Android versions" - leading developers to now be responsible for previous work, reversals, and it's attendant support costs. This means independent developers now have less time to devote to build new apps, but are now expected to keep changing old apps (without extra revenue expectations), and have less time for new apps and the attendant revenue from new efforts. Google management is exercising a hostile attitude towards independent developers that reflects a class-conscious mentality - where Google has stopped thinking how it feels to be an independent developer.

    • Google's power allows them to change such basic things as Storage and it doesn't get advertised to users (most users still are unaware what Android 10 has in store). Google's power means they do not fear harming developers or even violating regulatory practices in the short term. Everything is curable by paying some regulatory penalty. Penalties which would be prohibitive for Android if it was a standalone organization become easy to pay for Google the search/advertising behemoth. This is a powerful reason for the separation of Android from Google - until that happens, the world's mobile ecosystem will not develop in a rational way - that benefits the mobile ecosystem (and not some other entity primarily).

    • Developers have no voice in Android roadmap or about how inconsiderate these changes may be for users and developers (also related to above - if Android is not standalone it will never be responsive to mobile ecosystem concerns).

    • Users never find out about changes in the pipeline until they are a fait accompli - mainstream media only covers the positives of Android 10 for example, and repeat it continuously for effect. Again, if it was Android as standalone company, it would not exercise the same power. But Google the behemoth can. Negative stores on call recording vanishing, or Storage going away are occasional and easily forgotten. The next Android version gets delivered and becomes a fait accompli.

    • Google does not answer for user concerns - all ire from bad Android decisions falls on developers. Google is an entity that cannot be questioned about Android, and does not have to conform to any expectations of users. Users buy what appears on the market every year, and they will complain to developers (who did not cause those changes). This is a system designed to to not be fixed - the circle of responsibility does not come back to Google.

    • Android always has had a greater support burden, because of device diversity, and Google unwillingness to enforce consistency where it mattered for the ecosystem. Instead their primary concern is that manufacturers include their Google search, and Google Play Store and other such services. As Commonsware reports, one of the replacements for file storage, the Storage Access Framework (SAF) is inconsistently enforced across manufacturers (rendering that "alternative" less effective). These types of random variations multiply the support burden for independent developers (who have to do both development and support).

     

    iOS support burden vs. Android - for indep devs

    It could be argued that the same thing happens on iOS as the OS evolves.

    However, the less discussed problem with Android is it's API stability and consistency. What is advertised for Android, may not be what is delivered a few months later. Worse, Oreo 8.0 may deliver the first promise, and Oreo 8.1 may deliver a changed promise (as happened with the new audio engine for Oreo) - and BOTH versions remain in the market for months (unlike iOS which has intrinsic capability of updating devices in lockstep - a far greater percentage of devices run the latest iOS than the latest Android OS).

    Take the Storage changes - it is quite possible that Google reverses some of the changes if problems emerge.

     

    Constrained iOS may be stabler than a slowly-constraining Android

    Now compare to iOS - where Storage has always been more closed. While viewed negatively by most Android developers as a constrained system, it could be now argued that THAT is a far better system, because that constrained system appears as a standard. Reducing the developer burden.

    Meanwhile on Android, things are still in flux. It is not clear where Storage policies will end up in the near future, of when finally delivered.

    With iOS you at least know how things are to be done, and there are no hodge-podge alternatives that half-work or may not for Storage for Android:

    • where there is a pre-built expectation among users that their files are persistent - developers will have to deal with how to placate these users (Google won't deal with these users directly) when users encounter different behavior. Some of our users reported their call recordings were now all silence after upgrading to Android 10, or for storage they will find that files are in a sandbox, and not really where they used to be.

    • Pre-existing code will no longer work as before - without performance penalties (with SAF) and sometimes requiring redesigning (to suit SAFs workflows, or limitations that you can't use fopen() in your C code) - all this extra work will not earn independent developers any more revenue. And users will not value this as something to pay extra for - since all that work still produces a less efficient than before app!

    • there will be no ONE way to save files - but multiple intersecting ways (and with it the user expectation of how file access works or should work) - save to app-specific storage, some MediaStore stuff, or SAF - all adding to extra confusion during support calls.

    • there is a cloud hanging over SAF - whether file manager apps too will need to fill a Permissions Declaration Form - and what about apps which are not "primarily" file manager apps (similar situation as Call/SMS fiasco - where apps had to be either dialer handlers, or SMS handlers)

    • it is unclear how the Storage story will settle - and if Google will reverse some of the changes if problems emerge. In such a climate is it better to continue avoiding the Storage changes as long as possible, or better to restructure your apps on a still nascent roadmap ? Unevenness in implementation is also an issue - how well will the promised Google solutions find currency in the wild ? Commonsware is reporting that Storage Access Framework (SAF) is unevenly implemented across manufacturers. Google never bothered to make conformance to one behavior part of Android certification.

     

    iOS and Android - which is now more difficult for independent developers ?

    Under these conditions, I wonder if the already-constrained world of iOS (in terms of Storage) is a vastly more stable development environment ?

    While iOS may change from version to version, they at least have fewer of the device diversity, and manufacturer variation-in-implementation issues (since iOS devices are updated to newer iOS versions in near lockstep).;

    When Android makes radical changes, developers should expect to face a few years of fallout as all the "diversity of devices" is multiplied by the "diversity in API behavior" - and appears as support issues.

    Would it be wise for independent developers to sit out the Storage Apocalypse until it's roadmap is clear ? Or to devote more effort on their iOS projects ?

    As Android looks set to be a support s**tshow for the next year or two - due to Storage.

     


    References:

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

    Custom video player application

    Posted: 28 Jan 2020 07:12 PM PST

    Hi I'm trying to make a custom video player application. I have an MP4 file with 2 videos and 1 audio. I have 2 extractors and 2 decoders. They extract the two videos and renders to surface using surface view. I can change which video to render to surface using

    decoder.configure(format,null,null,0); to \n>

    decoder.configure(format,surface,null,0);

    How to make this change on the fly while running the application using click of a button or something or is it possible?

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

    Is ASO crucial for the success of your app/game?

    Posted: 28 Jan 2020 11:03 AM PST

    Is ASO crucial for the success of your app/game?

    From chatting to a few android developers, I learned they don't know much about ASO. That sounds crazy when you hear that over 60% of all downloads are generated by ASO.

    Thus I decided to write a whole series about ASO this is just a first part, my goals with this series are:

    1. Help you get more downloads and grow your app/game.
    2. And to simplify learning of ASO.

    Why is ASO important?

    • For the majority of apps, ASO is the number one driver of all downloads.
    • As of today, there are over 2.7 million apps in the Google Play app store, If potential users/customers can't find your app it doesn't matter how good your app really is. ASO helps you with that.
    • It is irrelevant how you get downloads, as long as you use Google Play, ASO will impact your growth.

    What is ASO - App Store Optimization? ASO is the process that has two main goals:

    1. To get you more downloads by improving the conversion of traffic.
    2. To get more traffic to your app listing page.

    1. Conversion of Traffic

    CT answers the question: Why would somebody visit your app listing page and download app/game?

    This is part of CT

    • CT helps you stand out.
    • CT invites people to visit your app listing page.

    Here you can read more about CT.

    CRO

    App Listing Page

    The process of improving the app listing page in order to get more downloads is called CRO.

    2. How To Get More Traffic

    There are three main ways of getting traffic inside of Google Play.

    2.1. Being Featured

    Google Play team selects apps they think are a good representation of quality or trend.

    • Editors' Choice

    Charts

    • Top Free
    • Top Paid
    • Top Grossing
    • Trending

    2.2. Search And Ranking

    Google Play ranks keywords from your app based on factors like app ratings, android vitals (crash rate, battery usage, the average time a user spends using your app) and many other factors.

    How higher ranking impacts downloads.

    Ranking for an app is the same as the location for a shop.

    https://preview.redd.it/a3kqupumdkd41.png?width=3085&format=png&auto=webp&s=974dfea206f293b47f633cda4ea0279dbd5f2ab5

    Of course, this is an oversimplified version. But you should get a point.

    More downloads = higher ranking in search. And a higher ranking in search means even more downloads.

    This creates a positive loop. Therefore even a small improvement in CT and CRO of 10% can be huge for your app/game. Success breeds success.

    The better location gives you credibility. The higher ranking does too.

    Let's look at google search data:

    • The first page gets 95% of all traffics.
    • The very first organic result on the first search engine results page sees about 32.5% of overall search traffic in terms of clicks. The 2nd domain sees 17.6%, while the 7th only sees 3.5%

    Google search is similar to Google Play, the top 8 apps will get a large portion of traffic and the first app gets the highest % of traffic.

    In addition, being first in search means your app is seen as the "best" and the majority of people use your app.

    That's why the first search result is the default choice for most people.

    A great way to change that is to improve your CT.

    2.3. Search Ads

    They are great ASO/Search tool.

    Search Ad

    Mind map of what you learned today + two types of searches.

    Thank you for reading. In this post, you learned some of the ASO fundamentals.

    I am writing a series about growing and marketing android apps/games here on Reddit.

    You can check it here and read more about CT

    submitted by /u/Story-Line
    [link] [comments]

    Suggestions For Frame-Work/Engine/SDK For Multi-Platform Gamified Utility App Development?

    Posted: 29 Jan 2020 02:01 AM PST

    What kind of framework should I use to make a gamified utility app? Something like habitica.com

    I need something with multi-platform support (iOS, Android, web, maybe windows).

    It has to be lightweight and able to handle large amount of simultaneous online users.

    Is there some framework that would work best for this?

    I was recommended flutter and was told Unity will be too "heavy" for creation of lightweight utiliy app. Then again visually it DOES have to look like a game (very simple one though).

    Looking for more recommendations of what is the best approach for this. I understand that programming it native would be best, but we currently don't have access to such a large team, so would prefer to use a single framework / engine / SDK?

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

    Issues implementing contact intent on button (noob looking for educational pointer)

    Posted: 29 Jan 2020 01:57 AM PST

    Hi,

    For educational purposes I am playing with intents, I ran into an issue trying to implement the below code taken from this resource:

    Button loadContact = findViewById(R.id.loadBtn);
    loadContact.setOnClickListener(new View.OnClickListener() {
    u/Override
    public void onClick(View v) {
    Intent intent = new Intent(Intent.ACTION_PICK);
    intent.setType(ContactsContract.Contacts.CONTENT_TYPE);
    if (intent.resolveActivity((getPackageManager())) != null) {
    startActivityForResult(intent, REQUEST_SELECT_CONTACT);
    }
    }
    });
    }

    u/Override
    private void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == REQUEST_SELECT_CONTACT && resultCode == RESULT_OK) {
    Uri contactUri = data.getData();
    Toast toast = Toast.makeText(this, "success", Toast.LENGTH_SHORT);
    toast.show();
    }

    }
    }

    The error I'm getting is:

    error: onActivityResult(int,int,Intent) in MainActivity cannot override onActivityResult(int,int,Intent) in FragmentActivity

    attempting to assign weaker access privileges; was protected

    I was able to find developers with similar issues, example here, yet I am a bit stuck and require a bit more 'noobish' explanation, in order to fully understand what I am doing wrong and how to correct it.

    Appreciate the help!

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

    Parameters in onesignal

    Posted: 29 Jan 2020 01:57 AM PST

    Get custom parameters from pushnotifications with onesignal

    https://www.thejadav.in/2020/01/android-handle-additional-parameter-in.html

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

    Need help a specific use of LiveData and Firestore

    Posted: 29 Jan 2020 01:45 AM PST

    Hey guys i have posted a question on StackOverflow and i have managed to get many solutions out of this problem and actually solved it in the best form i have found so far. I am just curious to get some more people involved and get to the bottom of it why it does work like that. Do you guys mind sharing your thoughts here?

    Here is the topic i have made: https://stackoverflow.com/questions/59951394/android-livedata-categories-in-tablayout

    Really appreciate the feedback on it since it bugs me and i want to see if there is any other way to achieve this.

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

    Google Play store: edit one of the images of my app

    Posted: 29 Jan 2020 01:12 AM PST

    Hey guys,

    I see guides out there on how to upload a new version of your app to Google store, but in my case I'm not interested in uploading a new apk, I would just like to change one of the uploaded preview images of my app. Is it possible?

    Thanks in advance

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

    How to Integrate Facebook Login Feature in Android Application?

    Posted: 29 Jan 2020 04:39 AM PST

    AdMob Paying less for Interstitial Ads ?

    Posted: 28 Jan 2020 11:54 PM PST

    So as the title says, in November the app that I have published on Google Play, on an Interstitial Ad click gave me about $0.4.

    This was all good until the CCPA came, and i have choosen the second option from it "Restrict Data".

    Now, this month for Interstitial Ad Clicks i am getting between 0.01 to 0.06 dollars, which is very low...

    What has happened to Admob ?

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

    How can I access/analyze all network traffic leaving an Android phone?

    Posted: 28 Jan 2020 01:34 PM PST

    I'm trying to build an app which will require the function to monitor outgoing packets of data from all sources on the Android device. I know TCPDump would work but if I'm not mistaken that only works on a rooted device. I'm trying to bundle this into a distributable application. How would I go about catching all outgoing network traffic on an Android device?

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

    No comments:

    Post a Comment