Dynamically change layout from internet in android without updating apk - android

If anyone is aware, Google often updates the Google Play Store app without actually pushing any update, like changing the shade of the top green colour. This is obvious because clearing data of the Google Play Store app, reverts the colour and some layouts to older format.
Also similarly for Google Chrome, when rectangular edges were changed to rounded edges, there was no update.
My question is how to get that behaviour? I have not been able to find how do that. Any pointers will be appreciated.

As somebody pointed out, you can use Firebase remote config. It is probably the best solution for your case.
If for some reason you don't want to do that (not using google's services, ...), and you application is connecting to your server, you can serve colors via API and save those colors in shared preferences on application startup, then just set colors from preferences.

what you need is firebase remote config it does exactly what you want
Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your app without requiring users to download an app update.
here is the link

Last year I needed similar solution but with device targeting, resource caching, event listeners, etc. so I started open source project Dynamico which supports these and many other functionalities. Hope you'll find it useful!

Related

Recieving Notifications

So I have this idea of an app that would get all youtube's notifications for the day and puts them all in one page and give you some functionality over them like adding to watch later and maybe not interested and some others all in one click, in addition to that i would be able to make better notification tiles you know the default one isn't that good and i've seen better, I thought about it for a while and I think i am going to go about it this way:
1- stop youtube itself from sending the notifications.
2- making the app get this day's uploads and listing them.
3- making the app send the noti... in a better looking tile.
4- adding the "Other functionalities".
But..., i've looked around for notification support on the youtube api page and found nothing useful.
Is there any api or anything that would help me in this, i am using android studio BTW.

Replacement of text in any EditText view of any app

There are apps like Texpand which are able to replace text in any EditText view - even of views which are part of other apps. Looking at the app-info this is happening without any requested permissions. I'm scratching my head how this is done - my (rookie) understanding is that each app resides in its own separated sandbox, so it should not have direct access to other apps views?
I looked for possible global events which could be provided by any central manager, but found nothing. More likely I would expect the replacement to be done passively (that means without the app being aware of the actual EditText), but checking for possible bindings or user dictionaries I found nothing promising either.
Looking at my Android system it seems the app is neither using permissions nor installing a keyboard. Additionally I don't see any entries in my user dictionary. Does anybody have an idea how the described functionality could actually be achieved?
Texpand's Google Play posting indicates that it uses Accessibility Services. Accessibility services are a set of APIs Android offers to help build tools to allow non-standard interactions with apps (such as audio descriptions/voice commands) to expand access to the platform to people with an impairment that might otherwise prevent them from using a touch-screen/smart-phone.
These include the ability to take action on the behalf of a user, such as filling in text fields.

Dump the tree of Views present at any given moment [Android]

I am trying to archive same thing as done in "hierarchyviewer" tool, which dumps the tree of Views present at any given moment on the device or emulator screen.
But i want it to be an Application running on a Android device. This app will keep running in background like a Serve and will dump the currently displayed Views in a text file.
Is it possible? is there any code examples are available?
Is it possible?
No.
The closest you can come is to implement an AccessibilityService. This would more closely mirror the uiautomatorviewer functionality, giving you a subset of what you see in Hierarchy View. This also requires a double-opt-in by the user: the user must install your app and activate it in Settings in the accessibility area.
As far as I know, you couldn't access other apps if they do not explicity share that info with you by the use of Intents (or if you own these other apps).
So, based on this limitation, my bets are you can't access another app's View Tree by regular means. And if you chould, I think you shouldn't, as this is somehow "secret" to other apps, and you'd be registering information without permission. In fact, what hierarchyview uses is, for sure, some sort of trick that directly uses internal private libraries of Android. Like taking a screenshot, that you can't do with the "default" implementation, but using these kind of testing tools.
That being said, check this answer, where it shows how to get the current app in foreground. From here, getting the View tree should be impossible, but as long as you could call getWindow() on that app's current activity, this could be done.

In which way is it possible to update an app?

In which way is it possible to update an app? Except download the hole app thru the market.
To be more specific. Let say I have a app with a main menu with 3 choices
1 Data
2 Tools
3 Settings
For 1-Data...
...gives you a new view with a menu(submenu) which each row give a view that contains normal data as text, pictures (maybey video).
If all data must be stored on the phone to be reach offline.
1.1 How can I update this kind of data? Like change/add some text, photo etc from a server??
1.2 Is it even possible to add new menu rows with new data from a server? Only know about xml menu but these feels so permanent.
For 2-Tools...
...that have a new submenu like before. But here the menu use hardware futures and api:s. Like, uses gps to get a position and show it on a map or make a call or something...
2.1 For this kind of stuff, is it possible just to update a specific changed class that the app could download from a server or something similar?
For 3-settings...
...If you could change the language here.
3.1 Is it possible to update the app from a server with a new language automtic when the translation is ready? Just download the xml:s?
Would be good instead of that you have to noties the user, so the user manually have to download the hole app again (< v2.2).
Im new to this, dont have the hole picture yet.
The common way of doing this (which is accepted by anyone using an Android Device) is simply publishing the new App-version on the Android Market.
Although, it should also be possible to do it like you said but since Apps are not allowed to download runnable code their self (for security proposals) it doesn't madder. Also if you want to improve new functions, you might need more permissions to your Android Manifest (it would be very bad if this file could be edited at runtime...).
If you have an App which works like a client for an Online-Service, it's sure okay to update those contents, but the things you asked for should really be done using the normal App Market.

Binding AppWidgets to AppWidgetHost - Android

When you normally want to add an AppWidget in Android there is a list where you need to pick one widget and it binds it to the home screen.
I'm trying to build an app which has its own appWidgetHost and specific App Widgets that I built for it.
I have two problems:
I would like to be able to automatically bind a widget to my AppWidgetsHost without the user picking from the list.
I want to make my own 'pick widgets list' and to load only widgets that I have created.
To make it simple; There is my app with my AppWidgets and I want full control in terms of binding a appWidget to the appWidgetHost etc.
3 people asked similar questions in Google forums:
Link 1
Link 2
Link 3
The only answer I found to be a possibility is in link number 2. Paraneet (one of the repliers) said that you can install the app under /system/app instead of /data/app because some security issue. but I'm not sure if it is a reliable solution for production, and I would like to know more about the pros and cons of doing this.
Thanks, Shai.
Unfortunatlly for you (and me), Paraneet is right.
binding appwidget is a sensitive action and thus, to avoid malware it requires the user's consent for the most part however if you install your app into the /system/data folder then you considered part of the OS and you are given a system permission which lets you decide to bind appwidget that you created without any user's involvement.
In Android O, its possible to pin app widget programmatically. Just watch at example here
Also check out Google official documentation

Categories

Resources