Where are location settings stored on KitKat? - android-source

I'm building KitKat using AOSP and would like Location setting to be set to "High accuracy" by default and without any user intervention.
I've read various bits and pieces on how it's typically done and can trigger a dialog to present to the user, but I'd like to avoid any user interactivity.
I'm thinking that if this setting is stored in one of the .xml files in the system, perhaps I could have an app that modifies it upon startup. Or perhaps tweak the AOSP code directly to make it default to High accuracy.
Thanks in advance for your thoughts.

I found a way to do this by modifying the AOSP code directly.

Related

OwnCloud enhance core features with App (eg. user registration)

I started looking into OwnCloud app development to add some capabilities I would like to my server. To me it seems like Apps can't modify anything like the Login page or User Management page. Is this the case?
I want to build a user registration app and would love to integrate it into the user management page (if not and it has to exist as its own app page not a big deal). The one big problem I see so far is not being able to add a "Register" link to the login page. I could just go in and add it to the source manually, but I would like to keep the App self contained so others can use it too.
If this is not possible to do in an App I may just need to modify the core application and then see if they will accept my feature addition in a pull request.
Thanks to anyone who can shed some light on this for me. I don't want to waste my time trying to figure out how to do it with an App on the platform if it wont be doable.
After a lot of digging around I did figure out a way to do this.
In the App's app.php file, you can force a script to be loaded if the plugin is enabled:
$api->addScript('script_name'); // without .js
In that script jQuery can be used to add the elements to the page where you need them.
This was a good solution for me since I only needed to add a single button to the login page. I can see this being a bad idea if you want to make vast modifications. At that point you might as well just create a separate page that you have full control over.

Using custom styles with Basic4Android

As a follow on to the hide activity questions here, I started looking through the Andoid documentation for more information on styles and themes and found it is possible to apply different themes for different API levels.
With this I can get my transparent activity on API levels that support it properly.
What I'd like to know is, is it safe to play with the styles within the Basic4Android environment, or will it comeback to bite me later on?
The xml has to be stored in res/values or res/values-v(API level) which are deleted on compile unless made read-only. I just wanted to check if this was to stop these being changed for a reason, other than keeping the app tidy?.
Edit:
I assume some things that it is possible to put in these files would overwrite or be overwritten by settings in the Designer.
Steve
I don't see any problem with using styles. Make sure to set your xml files to be read-only.
The designer doesn't change anything except of creating the bal files.

Settings bundle, want to show dynamic data from web-service

Hi I am stuck please help me...
Is it possible to load dynamic data in the settings bundle, exactly what i need is when user sets a value for a preference, i need to display a list for the next preference, this list should be drawn from an online database. I have seen some thing similar in iPhone's default settings. Can anybody please give a solution for this as i am really screwed now. If it is not possible then i will include the settings in the app itself.
Thanks in advance
It is not possible to have dynamic values in Apple's settings application; they need to be specified in Settings.bundle before compilation. I recommend you implement a custom settings screen.

Changing text on buttons etc on mobile app which is already in production

Let's say we have a mobile app (iPhone, Android) already deployed and being used by people.
Is it possible to change text on buttons, title bars, or even shape or colour of these things without a major update? What I mean is, do we have to deploy an update to the whole app (for example, new version) in order to change one single text on the button? Or maybe these things (settings) can be stored in some kind of database or XML?
Help me out on this one please. Thanks a million.
Is it possible to change text on buttons, title bars, or even shape or colour of these things without a major update?
No. You have to deploy a new version, even if you want to change a single thing like that.
It's possible to do changes to an existing app without deploying a new version, but in your case it's not possible. This is how it works:
You create a mechanism to check for new updates.
New updates can be new data, new settings, etc.
You make your app download and use that new data.
The problem here is that you have to have already deployed an app that do the steps above. Since your app currently does not have that implemented, there's no way to do any changes to it but updating it.
You have to update your app. I implemented the consumption of a JSON string recently to display a Message of the Day periodically. It also keeps a "low watermark" that I compare against the user's running version. If their version is too old I present them with 2 options: upgrade or quit.
You could as easily make your text work in the same way. Just be sure to keep a local cache in case they don't have network access. Will require some healthy refactoring.
you are able to store the text of buttons in values/Strings.xml and set them to the controls by text="#String/text_for_buttonxy" . This is grat for multiple languages, because you are able to put the Strings.xml in a country-code ending value folder like values-de values-en or values-fr in order to get the right String based on the phonesettungs.
Vor colors you are able to to the same thing with the colors.xml.
But you won't be able to change this xml file by synchronisation with a server, this will be a litte bit more complicated, please explain how to you want to change the settings.

iPhone settings bundle

I want to allow the user to enter a valid date using the iPhone’s settings application.
I have experimented with many of the PreferenceSpecifiers data node types including date.
I have two issues:
When I specify date as the type, my app within the settings app crashes. Working examples would be greatly appreciated.
Since this approach hasn’t worked for me yet, will I programmatically be able to validate the date that the user enters?
The answer to number 2 is no. The only time you can validate the data entered is the next time your app is launched. None of your app's code is run via the Settings app.
You might consider pulling this setting into your app.
Have you read this guide and this section of the App guide? They describe in detail how the settings like this work.
You won't be able to validate anything a user sets through the Settings application. Also, I don't see Date as a valid setting type anywhere, so I don't even think this is possible through the Settings application.
I would simply create a settings view within the application. That way you can control your custom logic as you see fit.