Open android settings page SCROLLED DOWN to a specific entry - android

I'm trying to make a part of my android app go directly to the USB debugging toggle in the settings
I've gotten it to open the Developer options page so far, using
startActivity(new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS));
However, I've seen some apps (can't recall specific ones) that open a settings page and scroll down to a certain entry.
How can I do the same action, so that I can open the Developer options page scrolled down to the USB-debugging toggle?
Thanks a lot!

After a couple days of research + trying to hack it in, I've concluded that this isn't possible. My app would lose all control the second I call an activity. And there's no possible parameters I can send to the native settings app to launch scrolled down.

Related

Instant app won't start directly, shows a screen first

I have successfully published a (very simple) Instant App linked to my personal website.
When I click on my website's link, I was expecting the app to start directly, but instead, I first see a screen with 2 buttons: "Open app" and "Open in browser":
Why?
Other instant apps that I tried do not show this screen and open the app directly (the desired behavior).
We call this screen the "speed bump". It's a security feature. You're right in noticing that it doesn't always trigger. But there's nothing you, as a developer, can do to control whether it shows. The intention is for it to be a black box from your perspective.
This is designed in my opinion to happen at least once to give the user an opportunity to decide what to use: either browser or the instant apps feature.

"developer options not available for this user" Marshmallow

I'm experiencing very interesting problem with my Galaxy S6 Edge phone with marshmallow. When I go to developer options. Instead of a long list of options I get a message of "developer options not available for this user". As far as I know, I don't have any other user (I even don't know how to add a user, to be honest). I saw a couple of people had a similar issue with kitkat but they weren't even able to get the developer options menu item in the settings. I have that developer options item and I actually have it for a while. I haven't done anything special recently and I wonder anyone experienced this before and whether there is a way of fixing this without factory reset.
Finally there are a couple of more symptoms which may/may not be related with this.
Task Switch button at the bottom of screen doesn't work.
The settings button on the notifications panel doesn't work
EDIT : I had to fix the issue by factory reset, I didn't have the chance to try Victor's answer but I am accepting it as the right answer since there are some people who were able to fix their issue
One solution is to run the com.google.android.setupwizard/.SetupWizardTestActivity activity and step through the setup wizard - https://plus.google.com/u/0/+PaulOBrien/posts/8EGNvpY9jQa
A relatively easy way of running that activity is described here: http://forums.androidcentral.com/samsung-galaxy-s7/659407-s7-edge-not-showing-notifications-tray-recent-apps-button-settings-button-dnt-work.html#post5083902
1) Download Nova Launcher & set it as default to replace TouchWiz.
2) Long press on the home screen.
3) Choose Widgets.
4) At the top, under Nova Launcher, scroll to the right & press & hold on Activities and place it somewhere empty on the home screen.
5) Scroll down to Setup Wizard. I saw 2 Setup Wizard options.
6) Under the first Setup Wizard option, I opened it & scrolled down to the 3rd choice which said ".SetupWizardTestActivity". It might be in a different spot for you, but look at the small writing, that's how I saw this one.
7) Select that to create the widget shortcut.
8) Open it. Apparently you're supposed to have a menu to go through and just click through "Next", but there wasn't one for me.
Following the instructions in that forum post fixed the problem on my Note 4.
I was able to fix this by adding and then deleting a new user:
In Settings, go to "Users".
Tap "Add user" and follow the prompts, including "Set up now" to switch to the new user.
Repeat step #1.
Tap your original user to switch back.
Repeat step #1.
Tap the gear icon next to the new user, then tap "Remove user" and follow the prompts.

How to stop opening documents and pdf files by default app in android programmatically?

i have created an app for viewing documents and pdf files, when you select a file (for example:sample.pdf or sample.doc) in your mobile, a dialog box will appear showing my app and other apps available for viewing with options on below(just once or always) or (set default). The problem is, Once i have clicked my app with these (always or set default) options in that dialog box, next time when i select a file to read, it automatically opens my app without showing other apps with dialog box options. I tried looking for a solution, but i can't get any ideas, can you guys help me on fixing this problem.
I tried looking for a solution
There is no "solution", because there is no problem.
The user decided to make your app be the default for this operation. That is the user's choice, not yours. If the user wants to change that, the user can go into Settings and do so (e.g., "Clear Defaults" on your app's screen in the list of installed apps).
Now, in cases where your app is the one starting some other activity, and you want to force a chooser, you can use Intent.createChooser() for that. But you cannot force other developers to use Intent.createChooser() when they ask Android to view "documents and pdf files" via ACTION_VIEW, and you cannot prevent the user from making your app be the default for those operations.

Can an Android app interact with another app?

I want to be able to tap the statusbar and the contents in the displayed app to be scrolled up to the top.
Is it technically possible that an app intercept my tap and send the appropriate command to the active app? I have noticed for example that AntTek quick settings shows a drop-down window when swiping down from statusbar. While using the app I did also notice that even by just tapping the statusbar (before beginning to move the finger down), the app seems to already interact with the touch as it dims the screen brightness in preparation to display it's "window" (sorry I use the MS Windows term), so clearly a statusbar tap CAN be sensed by an app.
Starting from this, I wonder if such an app could then send a message to the active program telling it to scroll up.
Is that possible? And if yes, the message must be customized to a particular app (let's say the browser as the most important) or is it standardized so the apps speak the same language between themselves?
I am not a programmer so answers with codesamples might be less helpful than a plain english explanation. Finding out that is possible would lead rather to pursuing a programmer to implement the idea rather than starting to develop it myself.
Thanks :-)
There is an XPosed-module which seems to do exactly what you want.
To use XPosed-modules, you'll need to root your phone and install the XPosed-framework.
The XPosed-module is called "Statusbar Scroll to Top" and its repository can be found here:
http://repo.xposed.info/module/com.mohammadag.statusbarscrolltotop
This will work for almost all app-lists, but for example won't work for browser-content.
If you want to scroll to the top of the page in a browser, then you'll probably do best to get a browser which can do that on its own. (For example Habit Browser has it built-in and respective plugins are available for Firefox.)
Yes it is possible. HiroMacro and Frep can do this, but it requires root. https://play.google.com/store/apps/details?id=com.prohiro.macro&hl=en
(how do they simulate mouse and keyboard interactions on other applications? i have no clue :/ anyone?)
Is it technically possible that an app intercept my tap and send the appropriate command to the active app?
No. One app cannot send fake input to another app, for security reasons.
An android app comprises of several activities. Each activity display a GUI that allows the user to perform a specific task. To take the user from one activity to another, app must use an Intent to define our app’s intent to do something.
An intent can be explicit in order to start a specific component (a specific Activity instance) or implicit in order to start any component that can handle the intended action.
Interacting one app to other app in android
google docs link

How to have a Button on click open an app on an android?

I have made an app that will simulate the iOS.
When the settings button is clicked i need it to open the settings on the android phone.
Same thing for all of the other icons such as the phone button will open the dialer on the android phone.
How can i do this??
EXAMPLE
iOS APP1 FOR ANDROID
Settings (image button) clicked = Android Settings opens
Phone (Image Button) clicked = Android Dialer Opens
-
Sincerely,
IntelSoftApps
-
p.s. If any one want to be part of this app/project let me know. Just send me an email at admin#intelsoftapps.com
Here's an example of a home screen replacement app, which is what I assume you're trying to do
http://developer.android.com/resources/samples/Home/index.html
If not, you have to clarify what you're doing, because "simulating the iOS" could mean a lot of things.
see here on how to do things on a click.
see here on how to start an activity (the UI parts of an app). unluckily I don't know the intent to open settings, but I guess googling for "android settings intent" should give some results.

Categories

Resources