change browser home page in android [duplicate] - android

Within my app, is it possible to programatically change the Android browser's homepage url? If so, how can I accomplish this?
For example, if you run this popular app with Android 2.3 (all that I've tested), it will change your homepage to http://www.searchmobileonline.com
-- https://market.android.com/details?id=goldenshorestechnologies.brightestflashlight.free
Thanks!

I did not try this myself, but BrowserSettings has a public interface setHomePage:
public void setHomePage(Context context, String url) {
Editor ed = PreferenceManager.
getDefaultSharedPreferences(context).edit();
ed.putString(PREF_HOMEPAGE, url);
ed.commit();
homeUrl = url;
}
It is used in BrowserBookmarksPage like this:
BrowserSettings.getInstance().setHomePage(this, [URL]);
But that BrowserSettings class is only accessible from that package. So maybe accessing the shared preferences is easier... ?
MORE...
Not really here to be giving a lesson. It may be possible to do, maybe with some native code accessing the XML file with the preferences for the Browser or other ways like this, but...
No matter what you do, this would be going "around" the security in
place. Your app should not be able to change the homepage of the
Browser (or it would be in the documentation)
Even if it is possible to find a way to do it (through NDK or finding undocumented interfaces), it would most likely stop working at some point with some new release of Android, which is probably not what you would want.
I understand some app already do it, and IMHO, that's bad. Does not mean that your app should be doing the same and frustrate more potential users.

There is NO WAY to change the homepage url of the browser.
com.android.browser opens/creates a preference with MODE_PRIVATE. So the files's attributes are became as -rw-rw----
And also browser app's menifest has no sharedUserId attribute.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.browser">
The app doesn't provide the chance to share app's preference file.

This cannot be accomplished programmatically from within your app.
Edit: I downloaded the application you provided, and it does appear to accomplish what you're looking for. How exactly it was done, I have no clue. I can't find anything online on how to do this. I'm interested to see if anyone has any ideas on how they accomplished this.

I hava a opinion:
Maybe you can read the source code of Browser and find the code like this:
SharedPreferences prefs = mContext.getSharedPreferences(RECOVERY_PREFERENCES, Context.MODE_PRIVATE);
and get the SharedPreferences of Browser,then find the place to set homepage, change it.
Is that possible?

Im guessing the app developer didnt write it in his code to do that. I think one of the 11 ad sdks he has in his app is causing it.
He has
adserver.adview
adwhirl
amobee.onlinehapi
apperhand
google
inmobi.androidsdk
jumptap.adtag
mdotm.android.ads
millenialmedia.android
mobclix.android.sdk
zestadz.android
as a side note this is ridiculous.

I authored the app called My Home Page (https://play.google.com/store/apps/details?id=com.aac.myhomepage) where I needed to accomplish this exact task. I looked everywhere possible and couldn't find a method of doing this so I ended up using two workarounds which really aren't great options in my opinion.
1) I offer a root option for those who have rooted devices where I simply access the SharedPreferences XML file of the browser and, using regular expressions, swap out the value of the home page with the one needed.
2) Copy the URL to the clipboard and tell the user how to accomplish changing the default home page.
Note that I did not use root access without the user's permission nor did I change the home page without the user's permission. This is the purpose of the app and the home page isn't changed without the user explicitly doing so.
I recently noticed that the ad SDKs were doing this but something tells me that they aren't doing it in a proper manner and I don't have any interest i

Related

Is it possible to open native android clock app from web application?

I am looking for a way to open the native android alarm clock app when a user clicks on the link or button on a web browser of the android. So basically need to open the native android app from web application. I tried using intent://#Intent;package=com.android.deskclock;end' and it is not working. I am wondering if I am using the wrong package name or it is not even possible in android.
Thank you much for help!
According to this documentation, this is not possible. In particular, this footnote is the limiting factor:
Only activities that have the category filter, android.intent.category.BROWSABLE are able to be invoked using this method as it indicates that the application is safe to open from the Browser.
If you look at the AndroidManifest.xml for the DeskClock app, none of the activities contain the android.intent.category.BROWSABLE category filter, meaning none of them can be opened from the browser.
I have a suspicion that the problem is that you are not providing a URI path in your URL. It might need to be a path declared in the app's manifest. See: https://developer.chrome.com/multidevice/android/intents
This could change it to ie intent://path/#Intent;package=com.android.deskclock;end'
It might be helpful if you were to look at the javascript console when you try to click on that link in Chrome, there might be details of what went wrong.
Keep in mind that the alarm clock app is not necessarily consistent. Manufacturers can remove the default alarm clock app to replace it with a different one, or just modify the source code so that it has the same package name but different source code. You could try opening multiple package names from javascript depending on what happens when the intent can't be opened.
Welcome to code party
You can get a android device IFrame from appetize site.
This is the easiest way for show android apps in web applications.
Update me in comments ;)

how to include application tutorials on first use xamarin.android

I want to deploy the app on play store then after a user downloads the app and opens it, the app will prompt some guide or tutorial per module or function to guide the user. Is there any easy way to do it ?
Note: It's okay if the tutorial prompts again if the user deletes the app and reinstall.
The most consistent way I've found is to use something like these ShowcaseView or MaterialShowcaseView to display the tutorial, then save that your user has already seen it using something like Shared Preferences. Upon next opening, all you have to do is check the Shared Preferences again to see if the user has already seen that tutorial.
The earlier way was to use a view pager with images of the tutorials and show it once using the concept of preferences. Now we can use various third party library like ShowcaseView to show the tutorials and using preference you can avoid it showing every time the user opens the application.
You could install James Montemagnos Settings Plugin. It can write persisting data to the AppData on your mobile device. You will then create a bool in the Settings.cs-File. As soon as the Tutorial is over, you set this bool to true and you only show this tutorial when the bool is false.

add another app inside my app?

my goal is to get a video from a usb connected device (an easycap video grabber) displayed. There is already an android app that does exactly that. However i need to add some buttons and some extra functions to it. So i came to the idea of displaying the app that already exists inside my app. Is that possible in any way?
I already tried to decompile the existing app to edit the code a bit but i didn't get anything to work with.
Do you have any other idea? If you know how to program that please let me know what i need to achieve that.
Thank you!
This cannot be done due to security reasons in the Android OS itself.
Android provides a security layer called the Sandbox in which the OS assigns a User ID for each app, so that an app will not have permission to access resources from another app.

How to change the default Android browser's homepage within an app?

Within my app, is it possible to programatically change the Android browser's homepage url? If so, how can I accomplish this?
For example, if you run this popular app with Android 2.3 (all that I've tested), it will change your homepage to http://www.searchmobileonline.com
-- https://market.android.com/details?id=goldenshorestechnologies.brightestflashlight.free
Thanks!
I did not try this myself, but BrowserSettings has a public interface setHomePage:
public void setHomePage(Context context, String url) {
Editor ed = PreferenceManager.
getDefaultSharedPreferences(context).edit();
ed.putString(PREF_HOMEPAGE, url);
ed.commit();
homeUrl = url;
}
It is used in BrowserBookmarksPage like this:
BrowserSettings.getInstance().setHomePage(this, [URL]);
But that BrowserSettings class is only accessible from that package. So maybe accessing the shared preferences is easier... ?
MORE...
Not really here to be giving a lesson. It may be possible to do, maybe with some native code accessing the XML file with the preferences for the Browser or other ways like this, but...
No matter what you do, this would be going "around" the security in
place. Your app should not be able to change the homepage of the
Browser (or it would be in the documentation)
Even if it is possible to find a way to do it (through NDK or finding undocumented interfaces), it would most likely stop working at some point with some new release of Android, which is probably not what you would want.
I understand some app already do it, and IMHO, that's bad. Does not mean that your app should be doing the same and frustrate more potential users.
There is NO WAY to change the homepage url of the browser.
com.android.browser opens/creates a preference with MODE_PRIVATE. So the files's attributes are became as -rw-rw----
And also browser app's menifest has no sharedUserId attribute.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.browser">
The app doesn't provide the chance to share app's preference file.
This cannot be accomplished programmatically from within your app.
Edit: I downloaded the application you provided, and it does appear to accomplish what you're looking for. How exactly it was done, I have no clue. I can't find anything online on how to do this. I'm interested to see if anyone has any ideas on how they accomplished this.
I hava a opinion:
Maybe you can read the source code of Browser and find the code like this:
SharedPreferences prefs = mContext.getSharedPreferences(RECOVERY_PREFERENCES, Context.MODE_PRIVATE);
and get the SharedPreferences of Browser,then find the place to set homepage, change it.
Is that possible?
Im guessing the app developer didnt write it in his code to do that. I think one of the 11 ad sdks he has in his app is causing it.
He has
adserver.adview
adwhirl
amobee.onlinehapi
apperhand
google
inmobi.androidsdk
jumptap.adtag
mdotm.android.ads
millenialmedia.android
mobclix.android.sdk
zestadz.android
as a side note this is ridiculous.
I authored the app called My Home Page (https://play.google.com/store/apps/details?id=com.aac.myhomepage) where I needed to accomplish this exact task. I looked everywhere possible and couldn't find a method of doing this so I ended up using two workarounds which really aren't great options in my opinion.
1) I offer a root option for those who have rooted devices where I simply access the SharedPreferences XML file of the browser and, using regular expressions, swap out the value of the home page with the one needed.
2) Copy the URL to the clipboard and tell the user how to accomplish changing the default home page.
Note that I did not use root access without the user's permission nor did I change the home page without the user's permission. This is the purpose of the app and the home page isn't changed without the user explicitly doing so.
I recently noticed that the ad SDKs were doing this but something tells me that they aren't doing it in a proper manner and I don't have any interest i

Adding App Specific Entry into the Android Settings Menu

As I know, we can add our app specific menu entries in iPhone's Settings menu. I want to know how same can be done in Android? I am developing for Android 1.6 using Eclipse Galileo. Please guide me.
Probably the closest thing to what you seek is the Account Authenticator feature. For more information see this question and look for the android:accountPreferences attribute. This allows your preference Activity to show up in the Accounts area of Settings.
Apart from that, while it's difficult to prove a negative, I've analyzed the Settings source code for Jelly Bean and I'm pretty certain this is impossible. To see for yourself, examine the onBuildHeaders() method in the Settings.java file. The headers array is maintained internally to the Settings Activity and the only flexibility seems to be the Account mechanism mentioned above.
Read the details information from here .
Nice one example here.
Use android:settingsActivity in your Manifest. It works for Livewallpaper or Input Method. You can't use it for everything or for your particular App.
You will find this good for you.Check this
this will let you know many options to customize your App
Have a Look # this linkPreferenceActivity .

Categories

Resources