• Breaking News

    Tuesday, December 3, 2019

    Android Dev - Android apps will start to lose ability to access local persistent storage and ext SD card - in a move which will boost Google's cloud storage for app data backup

    Android Dev - Android apps will start to lose ability to access local persistent storage and ext SD card - in a move which will boost Google's cloud storage for app data backup


    Android apps will start to lose ability to access local persistent storage and ext SD card - in a move which will boost Google's cloud storage for app data backup

    Posted: 03 Dec 2019 02:33 AM PST

    Android apps will start to lose ability to access local persistent storage and ext SD card in newer android versions - in a move which will boost Google's cloud storage for app backup.

    Commonsware (prominent stackoverflow contributor and android programming book author) has just posted an analysis of SAF (Storage Access Framework) - the fallback solution for writing to ext SD card, as Google eclipses local persistent storage.

    As being discussed on androiddev sub-reddit now:

    In addition, one looming problem with SAF not covered in his post is the complete elimination of SAF as a viable fallback if Google is going to start using the Permissions Declarations Form approach as they did with Call/SMS fiasco - we know what a disaster that was:

    I have previously covered some of these trends in this sub-reddit:

    Unless users start to take interest, they will lose one of the distinguishing features of Android over iOS.

    Currently only the android developers are taking notice - mainstream reviewers of android are preoccupied with whether screen has a teardrop or not. Which acts as clever misdirection away from foundational issues plaguing the android roadmap.

     

    Why custom ROMs are not a solution

    Google is in the driving seat here.

    Once Google decides to break APIs, devs will not use those features - as Android fragmentation means that most devs cannot be bothered to support all the variants and their permutations of each manufacturer's variant. Devs stop using controversial features that they cannot reliably advertise in app description - to avoid 1-stars from users on devices that dont work with that promised feature.

    This is how Google uses android fragmentation to their advantage sometimes. As in this case if they fail to police implementations of SAF (as Commonsware covers in his blog post) that will effectively kill the usefulness of SAF to devs.

    Devs addressing the mass market (those who have to earn a living from their apps) will not be making custom versions of their apps for side-loading, or that work just for custom ROMs (unless there is a large move to custom ROMs, or Samsung/Huawei/Xiaomi agree on a joint android consortium that continues in a direction that favors user needs).

    If enough mainstream users get used to the new closed Android, things will just move in that direction - users and devs complaining will become a minority. This is what Google is hoping will happen.

    However things could go the other way as well - the armies of Android fanboys who allayed new user fears about Android and convinced their friends to avoid Apple, will be campaigning less for Android. It remains to be seen how significant the loss of power-user enthusiasm will be to Android.

     

    Why side-loading is not a solution

    The changes to Android 10 are at the OS level - which will continue to affect side-loaded apps.

    However by using side-loaded apps, users could avoid the policy constraints of Google Play store (for example that now apps using SAF will require approval on a case by case basis and have to primarily be file manager apps).

    Unfortunately side-loading APKs faces a risk now as well - Google Play Protect will give warnings to users to turn them off your app, and can remove it outright. An app which has been banned will be seen as harmful by Google Play Protect.

    So Google's writ now extends beyond the store now.

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

    I have released my 2000+ instrumental pieces free under creative commons 3.0 by (Free to use in your videos, movies, games or what ever. Just credit me Antti Luode) (If you can not, that is fine too.)

    Posted: 03 Dec 2019 07:41 AM PST

    As used in games such as Headliner Novinews.

    As used by Youtubers such as Kyle Le with 42+ million views and 163k+ subs

    My Instrumental site (Soundclick):

    https://www.soundclick.com/bands3/default.cfm?bandID=1277008&content=songs

    My IMDb (only one credit so far. Others maybe coming):

    https://www.imdb.com/name/nm10882843/

    Link to 1790 CATEGORIZED instrumental pieces in a single zip file:

    https://drive.google.com/open?id=1yCZtjPSKW3ifngIP6zzbc9spXspjatIf

    My blog where I release the songs and FLstudio project files for them:

    http://anttismusic.blogspot.fi

    All instrumental pieces on Google drive:

    https://drive.google.com/drive/folders/0B1t5awWiDLZhMXBmT0M5Mm1nRG8

    Torrent with 1369 instrumentals:

    https://drive.google.com/file/d/0B1t5awWiDLZhc0hKcjJYVEsySE0/view?usp=sharing

    Pass it around!

    You need a bittorrent client to download the instrumentals in the torrent:

    https://www.qbittorrent.org/

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

    Google Play has taken down my app which has more than 1 Million downloads on groundless claims. Gave them proof but still rejected my appeal. Any Help will be appreciated.

    Posted: 02 Dec 2019 09:34 AM PST

    Which one is beneficial on the basis of performance?

    Posted: 03 Dec 2019 01:21 AM PST

    In my app there is a list of items and it's size never exceeds 12. And I think my views may not be completely customizable when using Recyclerview. So I decided to create views programmatically using for each loop. Is there any drawback using this way?

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

    LeakCanary 2.0 is out.

    Posted: 03 Dec 2019 08:10 AM PST

    What's the state of Kotlin native? Has anyone used it to successfully share code between iOS/Android?

    Posted: 02 Dec 2019 06:29 PM PST

    These days I'm learning how to do backend in Kotlin so I can't help but salivate a little at the thought of sharing Kotlin between Server <-> Android <-> iOS <-> JS (even if it's just business logic).

    But outside of a view proof-of-concept repos and demo videos I can't find much on actual use of Kotlin on platforms other than Android.

    Has anyone successfully put it in production on iOS? JS? How was you experience? What should someone about to jump in know? Is it stable?

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

    Adding Google maps activity on existing project

    Posted: 03 Dec 2019 01:48 AM PST

    Hello developers. I'm working on a simple University project, and I want to add a basic gmaps activity (just a button which opens maps and places market in specific coordinates). But I can't see gmaps activity when adding new activities, and every tutorial (including official ones by Google and Android) starts with "start new project".

    My question: is it possible to add gmaps activity on existing project, and if yes, could you link me a guide about it?

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

    App freezes Everytime when I add something in database

    Posted: 03 Dec 2019 07:29 AM PST

    Pretty much the title. When I add something to SQLite database (I made a simple one for testing where object has only Id and name) app simply freezes. After a minute or two I get "app not responding". It doesn't show any errors. Do you have any idea what might cause this?

    Edit: emulator keeps showing "downloading" symbol nonstop.

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

    Using same object in different activities

    Posted: 03 Dec 2019 06:35 AM PST

    Hello and sorry for "low effort" post, but I reaaally need help and I don't have much time to finish my uni project. So the problem is this: I create object in one activity (it's a SQLite databse object), I put something in it. In other activity, I need to take stuff out from this DB. Do I create identical object in other activity, or can I somehow access it? Or maybe I just have no idea how it works (which I truly don't), and it can be solved in some other way?

    Please save a students ass, and I will pray for you to have no hangover during holiday season <3

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

    Turn of battery optimization for app on Huawei

    Posted: 03 Dec 2019 05:09 AM PST

    How do we whitelist our app on Huawei devices so that we are able to receive notifications even after the app has been killed off from the task manager?

    One of the app user is using a Huawei p20 running Android 9 and they do not receive any notification when app has been killed.

    Any ideas as to how to fix this issue would be much appreciated!

    Thanks!

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

    How to avoid install confirmation dialog on Xiaomi Pocophone?

    Posted: 03 Dec 2019 04:51 AM PST

    How to avoid install confirmation dialog on Xiaomi Pocophone?

    Every now and then I get this, even though I chose "remember my choice", especially when the app was removed:

    https://preview.redd.it/li6btu630f241.png?width=427&format=png&auto=webp&s=e6a23f0706b7b3eacbc9cd7f105cda49da2a19cc

    How can I stop this from ever being shown?

    submitted by /u/AD-LB
    [link] [comments]

    Does google admob disabling eventually lead to developer console suspension ?

    Posted: 03 Dec 2019 04:33 AM PST

    So my game is not even released on production, but rather it is currently there in open beta. There really isn't much downloads overall, but relatively speaking, the last 5 days had a noticeable spike in download and game activity because i was marketing my game in many social media channels for feedbacks and analytics. I could see a good growth trend through my free marketing trials. I only used admob interstitial ads (only shows up every 3 levels) and rewarded video ads (users can watch it to get x amount of gems).

    This morning i got an email saying my adsense account was permanently disabled (not even a temporary suspension) without any clear reason other than "invalid activity". I am guessing some of the players might be spamming the rewarded video ads to get the gems to buy that sweet new space ship, but i had assumed that is how they are supposed to work, and one cannot invalid spam a rewarded video.

    Applied for an appeal, clearly wrote them what might have gone wrong, and what i can do in an update to not repeat this from happening, got rejected with a rejection mail after 3 hours. Whole thing felt ridiculous, and i feel like i am walking on egg shells.

    Since google already disabled my adsense, will they eventually disable my developer console account too ? I heard they are two separate independent organisations within google, but can someone clarify if both are linked ?

    Say for example, i started using unity ads from now on, is my developer account eventually be blown to bits by google in the near future because the admob account got disabled out of nowhere one fine morning ?

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

    Question About Generics in Kotlin

    Posted: 03 Dec 2019 04:04 AM PST

    This may violate the rules, it is a very specific dev question. Here goes.

    I am working on a product that uses a lot of lists, sometimes of different types of items in the same list. Using the information given here

    https://eng.uber.com/uber-freight-app/

    and here

    https://android.jlelse.eu/a-recyclerview-with-multiple-item-types-dfba3979050

    I have created these items

    //To hold the data and provide view type for each list item

    interface ListItemModel { fun getViewType(): Int } 

    Example implementation

    class ListItemHeading(var heading: String): ListItemModel{ override fun getViewType(): Int { return 0 } } 

    Inflate the appropriate view and bind the right data to it

    abstract class ViewRenderer<M: ListItemModel, H: RecyclerView.ViewHolder>{ abstract fun bindView(model: M, holder: H) abstract fun createViewHolder(parent: ViewGroup):H } 

    Example implementation

    class ViewRendererHeading :ViewRenderer<ListItemHeading, ViewHolderHeading>(){ override fun bindView(model: ListItemHeading, holder: ViewHolderHeading) { holder.binding.headingText.text = model.heading } override fun createViewHolder(parent: ViewGroup): ViewHolderHeading { return ViewHolderHeading(parent) } } 

    To inflate the specific layout (example implementation)

    class ViewHolderHeading(val parent: ViewGroup, viewBinding: ListItemHeadingBinding = DataBindingUtil.inflate( LayoutInflater.from(parent.context), R.layout.list_item_heading, parent, false ) ): RecyclerView.ViewHolder(viewBinding.root){ val binding = viewBinding } 

    My Adapter keeps these two Maps

    //Will hold data and view type information var listItems: ArrayList<ListItemModel> = ArrayList(), //Holds mapping of layout to view type, and methods to populate them with data private var viewRenders: MutableMap<Int, ViewRenderer<ListItemModel, RecyclerView.ViewHolder>> = mutableMapOf() 

    The rest of the Adapter code is here

    ... override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { return viewRenders[viewType]?.createViewHolder(parent) ?: ViewRendererHeading().createViewHolder(parent) } override fun getItemCount(): Int { return listItems.size } override fun getItemViewType(position: Int): Int { return listItems[position].getViewType() } override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { if (viewRenders.containsKey(getItemViewType(position))){ viewRenders[getItemViewType(position)]!!.bindView( listItems[position], holder ) } // Adding items to the two mappings fun <L: ListItemModel, V: ViewRenderer<ListItemModel, RecyclerView.ViewHolder>> addListItem(item: L, viewRenderer: V){ listItems.add(item) if (!viewRenders.containsKey(item.getViewType())){ viewRenders[item.getViewType()] = viewRenderer } } ... 

    Now I can re use this throughout the entire project. And all I need to do is supply the ListItemModel implementation with the data and the RecyclerView.ViewHolder implementation with the correct layout

    The problem comes when I try to call the addListItem(item: L, viewRenderer: V) function

    private var itemListAdapter = ItemListAdapter() //This gives me an error, see below itemListAdapter.addListItem(heading, ViewRendererHeading()) 

    This is the error I get -

    Type parameter bound for V in fun <L : ListItemModel, V : ViewRenderer<ListItemModel, RecyclerView.ViewHolder>> addListItem(item: L, viewRenderer: V): Unit is not satisfied: inferred type ViewRendererHeading is not a subtype of ViewRenderer<ListItemModel, RecyclerView.ViewHolder>

    I an new to generics. I know it is a small mistake somewhere. Can someone help me out?

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

    Android sensor minimum delay or fastest possible sampling frequency

    Posted: 02 Dec 2019 08:53 AM PST

    The android sensor library provides different delays for registering sensors (like SENSOR_DELAY_FASTEST etc). SENSOR_DELAY_FASTEST equals a delay of 0 and this results in a sampling frequency of roughly 200 Hz with my devices accelerometer. My device has Bosch BMI 160 accelerometer, which a lot of devices have. According to the datasheet it can provide an Output Data Rate of 1600 Hz, if I understand the datasheet correctly. So I wonder why is 200 Hz the maximum the Sensor API can provide me? Does it have something to do with the driver Android uses to control the sensor or the I2C bus? Or is there maybe way to query sensors reading even more frequent than "SENSOR_DELAY_FASTEST"?

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

    How to embed ionic 4 with cordova 9 into native android fragment?

    Posted: 02 Dec 2019 09:05 PM PST

    Suppose I have a native android app, and I want to create a fragment that upon routing to it, pops up the app developed with ionic 4 with cordova 9.

    How would I go about doing it? It seems all the tutorials are outdated.

    As far as I know, I need to transfer all the www and plugins from the android folder of the ionic project into the corresponding folders in the native android. But beyond that, I'm clueless.

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

    Android Dev Podcast #7. Exclusive interview with Gradle Inc. founder and CEO Hans Dockter - Android

    Posted: 02 Dec 2019 09:37 AM PST

    How can I update LiveData observers after manually executing SQL against a Room database?

    Posted: 02 Dec 2019 03:09 PM PST

    My question is pretty much the same as this.

    My app uses Room + Livedata in a typical setup. I'm able to use the standard DAO functionality in most cases.

    However, when the user refreshes the data, I receive the update from the server with ~1000 SQL string queries. These queries are executed manually in Room using:

    AppDatabase.getInstance(activity) .getOpenHelper() .getWritableDatabase() .execSQL(sqlQuery); 

    As this update happens outside the DAO, how can I notify the LiveData observers that the database has changed? (And to therefore invalidate/refresh the UI with the latest data?)

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

    Showing notification during lock screen issue

    Posted: 02 Dec 2019 09:09 AM PST

    Some of my users complain that they didn't receive notification, when their phone is in locked screen mode.

    My notification code is pretty straight forward, and following all official guidelines to implement so - https://gist.github.com/yccheok/0c6b901d7533831f990383afa916d332

    I'm not able to reproduce the problem reported by my user. I'm still able to show notification, even I'm in the locked screen mode.

    Do you have any thoughts, how I can re-produce the problem? Thanks.

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

    Google Glass Drivers

    Posted: 02 Dec 2019 02:15 PM PST

    No comments:

    Post a Comment