• Breaking News

    [Android][timeline][#f39c12]

    Wednesday, April 3, 2019

    Do you have anything to say about Scoped Storage? Google wants to hear from us. Android Dev

    Do you have anything to say about Scoped Storage? Google wants to hear from us. Android Dev


    Do you have anything to say about Scoped Storage? Google wants to hear from us.

    Posted: 03 Apr 2019 10:27 AM PDT

    Android Developers Blog: Android Q Beta 2 update

    Posted: 03 Apr 2019 10:38 AM PDT

    Can someone explain to me why AAC is trying to force people to use ViewModels for making objects survive configuration changes?

    Posted: 03 Apr 2019 09:33 AM PDT

    Bit of history, Activities had an onRetainNonConfigurationInstance() method since API 1, it lets you pass any object from the Activity to survive configuration change. You can retrieve it with getLastNonConfigurationInstance(), and it gives you an Object (whatever you passed in is passed back to you). It's null if the system had never called onRetainNonConfigurationInstance() yet.

    If you hadn't heard of this method, then it's worth remembering: you could make an object survive across configuration change of an Activity since API 1, there was a lifecycle callback for it. If you wanted an onCleared() callback, you could use if(isFinishing()) { in onDestroy.



    onRetainNonConfigurationInstance() was initially deprecated in API 11, because AppCompatActivity FragmentActivity was using it to retain the support FragmentManager.

    Then Jake Wharton fought to get it undeprecated, in which case the Support Library devs realized that apparently you can just make FragmentActivity.onRetainNonConfigurationInstance() into final after overriding it, and you don't need to deprecate it in android.app.Activity if it's only the android.support.v4.FragmentActivity that's trying to rely on it.

    Eventually, they still kept android.app.Activity.onRetainNonConfigurationInstance() deprecated saying:

    Note: For most cases you should use the Fragment API Fragment#setRetainInstance(boolean) instead; this is also available on older platforms through the Android support libraries.

    Meaning "don't use this API, use retained headless fragments instead".


    Let us be aware of the fact that on top of retained headless fragments, they added Loaders at around 2012, also meant to "load data and keep it across configuration changes".

    Loaders have since then been deprecated in Android P, in favor of using ViewModels.


    So that brings us to "about now", because Loaders were deprecated, nobody ever talked much about retained headless fragments, nobody ever really talked about non-configuration instances either (even though the FragmentManager heavily relies on it), and ViewModels were introduced.

    ViewModels are persisted across configuration changes using onRetainNonConfigurationInstance(), as the ViewModelStore is directly passed out as part of the FragmentActivity.NonConfigurationInstances.

    /** * Retain all appropriate fragment state. You can NOT * override this yourself! Use {@link #onRetainCustomNonConfigurationInstance()} * if you want to retain your own state. */ @Override public final Object onRetainNonConfigurationInstance() { Object custom = onRetainCustomNonConfigurationInstance(); FragmentManagerNonConfig fragments = mFragments.retainNestedNonConfig(); if (fragments == null && mViewModelStore == null && custom == null) { return null; } NonConfigurationInstances nci = new NonConfigurationInstances(); nci.custom = custom; nci.viewModelStore = mViewModelStore; nci.fragments = fragments; return nci; } 


    For some reason though, they seem to have changed the comments in the latest AndroidX:

    /** * Retain all appropriate non-config state. You can NOT * override this yourself! Use a {@link androidx.lifecycle.ViewModel} if you want to * retain your own non config state. */ 

    and also

    /** * Use this instead of {@link #onRetainNonConfigurationInstance()}. * Retrieve later with {@link #getLastCustomNonConfigurationInstance()}. * * @deprecated Use a {@link androidx.lifecycle.ViewModel} to store non config state. */ @Deprecated @Nullable public Object onRetainCustomNonConfigurationInstance() { return null; } 

    What's interesting about onRetainCustomNonConfigurationInstance() is that it was deprecated in 2018 November, then it was undeprecated in 2019 January, and now it's deprecated again.

    Does anyone know the benefit of using Android Architecture Components ViewModel in favor of onRetainCustomNonConfigurationInstance(), and why we're forced to use ViewModels even in this scenario?


    NOTE: I can barely wait for the following depreciations:

    • Fragment.setRetainInstance with "please use ViewModel instead"

    • onSaveInstanceState(Bundle) with "please use SavedStateAccessor and SavedStateHandle instead"

    • FragmentTransaction class and fragmentManager.beginTransaction() method with "please use NavController.navigate(destination) instead, you don't need to use fragment transactions anymore directly so instead it throws an exception if you target Android R"

    • Android Framework View class with "please use Flutter instead for your UI layer" 🤔

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

    Announcing Android Q Beta 2

    Posted: 03 Apr 2019 10:49 AM PDT

    AndroidX April release is here

    Posted: 03 Apr 2019 11:50 AM PDT

    Real-life example of multi-module Android app

    Posted: 03 Apr 2019 01:25 AM PDT

    WorkManager 1.0.1-rc01 and 2.0.1-rc01 now available !

    Posted: 03 Apr 2019 10:24 AM PDT

    Does anyone know how Stetho works internally ? Could it work with Firefox dev tools ?

    Posted: 03 Apr 2019 06:50 AM PDT

    The only reason I currently have Chrome installed on my machine is cause of Stetho. We mainly just use the Network Debugging aspect of stetho, and it has been great.

    I'm definitely going to take time to dig into the source code to get a better understanding, but am curious to know if there's a resource out there already or if someone has some knowledge of how it works. Mainly cause I'd want to know if at all it is possible to have a similar feature work on Firefox with its devtools instead.

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

    Announcing Android Q Beta 2

    Posted: 03 Apr 2019 11:00 AM PDT

    Is this the reason for endless stream of half-backed APIs, arch components, etc.?

    Posted: 02 Apr 2019 10:54 PM PDT

    Very insightful comment from Hacker News:

    Warning: Personal opinion ahead

    To understand why this keeps happening, you need to understand the product and engineering culture at Google. As a group, Google engineers and PMs are obsessed with promotion. At the heart of every conversation about system design or product proposal lies an unspoken (and sometimes spoken) question: will working on this get me promoted?

    The criteria for promotion at Google, especially at the higher levels like SWE III -> Senior and especially at Senior -> Staff and above, explicitly talk about impact on the organization and the business. This has consequences for the kind of teams people try to join and kind of work they choose to do. Maintenance engineering is so not-rewarded that it's become an inside joke. Any team that isn't launching products starts bleeding staff, any project that isn't going to make a big splash is going to be neglected, and any design that doesn't "demonstrate technical complexity" will be either rejected or trumped up.

    This is as important in the product management, people management, and general leadership roles as in engineering. The incentive throughout is to create a product, launch it, apply for promotion, and move on to bigger and better things as soon as possible. In my time at Google I saw organization after organization pay lip service to rewarding maintenance and "preferring landings over launches" and "improving product excellence" but (at least in my experience) nothing stuck.

    Usually an organization starts with a top-down direction and the rest of the company is compensated for executing it. Not at Google. The "let a thousand flowers bloom" approach that developed from the early days of twenty percent time and total engineering independence has created a disorganized mess of a company. Multiply the individual incentives fifty thousand times and you get a company that throws stuff at the wall to see if it sticks, and if it doesn't kills it immediately.

    Edit/Addendum:

    This is also why GMail, YouTube, Search, GCP, Android, and others aren't going anywhere. They're making money, they're core to the business, and there's plenty of opportunity to work on them and get promoted. They all also share one thing in common: deep down they're frontends for search or advertising (GCP and Apps are an exception because they make money on their own). Measuring and proving impact on search numbers is a well-known promo narrative at Google, so those products are a safe bet for employees and users. Streaming game services, not so much.

    I always wondered why Google releases so many crappy APIs and frameworks for Android at a steady pace, but can't give us what we need.

    For example:

    • It took them 9(!) years to support fonts specification in XML (eventually released alongside an entire framework for downloadable and shareable fonts that no one needed)
    • AndroidStudio's quality couldn't be improved without Project Marble
    • Soft keyboard hasn't been refactored into something more usable despite innumerous complaints.

    and much more.

    The above description seems to explain the situation pretty good. Crappy frameworks that waste everyone's resources get you promoted, but fixing soft keyboard isn't. Fixing many small bugs in AndroidStudio isn't impressive, but Project Marble sounds cool.

    Here is an idea: call it Keyboard Architecture Component and get it fixed -> promotion!

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

    Dagger Assisted Injection - the missing piece in your Dagger setup

    Posted: 03 Apr 2019 02:44 PM PDT

    How can I implement machine learning on an android app?

    Posted: 03 Apr 2019 06:28 AM PDT

    I started learning android development and I made a connect three game, so I thought of using machine learning to make a single player mode. how would I do this? should I use tensorflow lite? What framework would suit my needs?

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

    Crashlytics - migration from fabric to Firebase.

    Posted: 03 Apr 2019 07:51 AM PDT

    Hello,

    I use Crashlyitcs with Fabric implementantion in my production app. When Google took over Fabric I integrated my Fabric console with Firebase console. But is it enough?

    I analyzed https://get.fabric.io/roadmap and it says that " We'll support Fabric until late 2019 ".Does it mean that all apps that currently use fabric API should remove it to the end of year and replace it with the new one that will appear in mid 2019? (" Complete your transition to Firebase by installing the new Crashlytics SDK, which is optimized for your new home. ") Or only fabric site will be shut down and after integrating Fabric with FirebaseConsole crashes will be normally send to firebase console without any additional changnes in android/ios app needed?

    Its confusing that situation is not clear because planing of relases is hard when you dont know if app will be working properly because of changing sdk and what and when exactly should be done...

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

    Beware BiometricPrompt

    Posted: 03 Apr 2019 10:02 AM PDT

    Samsung seems to have integrated their fingerprint, iris and facial recognition systems with the system BiometricPrompt in their Android P update for at least the S8, S9 and S10. Unfortunately the facial recognition support is broken if you're trying to use a CryptoObject-wrapped Signature. The resulting Signature in the onSuccess callback always throws a KeyStoreException with "Key user not authenticated" when you try to use it.

    Google has closed the issue reports as wont fix, and Samsung hasn't responded at all. Hopefully this can save someone else the hours of headache I had tracking this down and switching back to FingerprintManager.

    See https://issuetracker.google.com/issues/123997468

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

    Locked out of play console

    Posted: 03 Apr 2019 02:49 PM PDT

    A former employee at my company created the play store account. Now none had admin access, nor the order number for developer about registration. I submitted a support twist but got no response. Does anyone have any ideas?

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

    Creating an Android app for automatic background replacement with image segmentation

    Posted: 03 Apr 2019 10:40 AM PDT

    Is this the proper way to implement a REST backed autocomplete?

    Posted: 03 Apr 2019 10:34 AM PDT

    Let me preface this by saying, my code works. I am not looking to fix a problem. I'm looking more for critique on my implementation. I'm trying to take my skills to the next level, but have no one to bounce my code off of.

    I am pulling some AutoComplete details from a server.

    In my view I have a textview that onTextChanged, fires a query to the AutoComplete server.

    On every letter change, there is a new RestCommunicator created. I have a feeling this isn't a good practice. But I can't seem to find any recent documentation that might help me better fix my code.

    Look at the searchText(string) method. This is what I feel like is wrong.

    For brevity, I have removed all the try/catch and other null checks from the code.

    I tried to paste the code here, but the formatting was horrible. Here's the pastebin

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

    Few extraordinary android apps on github ?

    Posted: 03 Apr 2019 10:04 AM PDT

    Can anyone give me some project you find extra ordinary android projects on github? I'll like to study them.

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

    Graduate looking for advice on - Future of Android

    Posted: 03 Apr 2019 12:24 PM PDT

    so i was here a while ago and got some great advice on which tech i should be learning if i wanted to go full into android after doing a semester of it in my final year, e.g kotlin ,jetpack, etc along with some of my own reading on firebase and dagger

    im in a position where i can go into android if i can find an android dev job or data engineering with java and python which there are a few more oppertunties.(i have a few interviews lined up already for java dev positions and none for android because it seems like there is none in Ireland ,Dublin unless you have 3+ years of experiance)

    I've been seeing youtube developers talking about how companies are heading towards developing mobile apps for both android and IOS with native web apps that use technologies like Ionic , javascript etc and i have seen a few of these kinds of jobs pop up in my area, i live in ireland so the market isnt that big unless you go into web .

    My question is , from your view how likely do you think that this will take over mobile app developement , i understand that google and apple invest in these platforms so its unlikely that they will die just change if anything at all, i wanted to go into mobile and android specifically to move away from web development as much as possible and stick to java , objective c and swift/kotlin

    A worry i have is that i dont want to do app development and then have to turn to web technologies i also hate javascript with a passion, yes i know i can just leave hardly any developer does 1 thing for their whole career

    thanks in advance

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

    Quick Copyright question

    Posted: 03 Apr 2019 12:14 PM PDT

    Greetings, I had a game idea which takes inspiration from the current state of the "internet". Say i wanted to make a pixelated game about "Youtubers" as main protagonists. Even with changed names and figures in 16 or 32 bit i would need to use some of their characteristics, or use some of their key lines in text. I assume if you can easily understand who that character references it falls under some copyright law. Does anyone know any specifics on how far i can go?

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

    How can you disable selinux when building Oreo for the emulator?

    Posted: 03 Apr 2019 10:24 AM PDT

    Background: most recent Oreo version. "lunch aosp_arm-eng".

    I need to boot with selinux turned off, or at least set to permissive. I've edited literally every BoardConfig.mk I could find and added BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive to all of them, but nothing works. cat /proc/cmdline does not show the change.

    Does anybody know how to get this done?

    Related questions:

    • How can I determine which BoardConfig.mk files are being processed in the builds? Hardware is nominally "ranchu", while ro.product.device is "generic". But there's no "ranchu" in the device tree.
    submitted by /u/capilot
    [link] [comments]

    10 Xcode improvements list from an Android Developer

    Posted: 03 Apr 2019 02:14 AM PDT

    how much should i know to start building an app using android studio ?

    Posted: 03 Apr 2019 08:19 AM PDT

    How Google Assistant sends personal WhatsApp message directly from google assistant?

    Posted: 02 Apr 2019 11:58 PM PDT

    How Google Assistant sends personal WhatsApp message directly from google assistant?

    I have read some articles and according to them whatsapp has no api for developers for sending personal messages. Though when I type send a whatsapp message in Google Assistant(Android mobile device) it shows a simple UI to choose a contact and type a message and a send button to send it directly from assistant.

    https://i.redd.it/39wnz6jfyzp21.png

    I also want to do this kinda thing with my messaging app.

    My questions are

    1. How to achieve this?
    2. Has whatsapp done thing from their side to do this or Google Assistant did this?

    Note: Not only whatsapp I have noticed same thing for the preloaded sms messaging app in android devices.

    Edit: And this works only if whatsapp is installed in the device

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

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel