Hardcode Server-Settings

simplywing8 years ago

Hi Anton

Is there a way of "hardcoding" the Server-Address, Port and Frequency into the Android-App? The goal is to be able to hide or delete those menu-items so that the user cant see them.

Thanks in Advance!

Simplywing

Anton Tananaev8 years ago

Sure, you can just remove or hide those items from the preferences.

simplywing8 years ago

The problem is that if i just remove those items them the app will crash immediately..

Anton Tananaev8 years ago

You can call "removePreference" from Java code instead of removing the preferences in XML. That way, they will be initialized, but user won't be able to modify them.

simplywing8 years ago

In MainActivity there is no PreferenceGroup Object. According to the Documentation of Google, the removePreference is a Method of the PreferenceGroup Object. On wich Object should i call the "removePreference" then?

Anton Tananaev8 years ago

There is always a PreferenceGroup. If not explicit one, there is a PreferenceScreen which is also a PreferenceGroup.