简体   繁体   English

在Android的哪里放置设置?

[英]Where to put the Settings in Android?

On the iPhone/iPod touch, settings could be kept in the Settings.app. 在iPhone / iPod touch上,设置可以保存在Settings.app中。 Can you do this in Android? 您可以在Android中执行此操作吗? Or must your settings be in the actual application? 还是您的设置必须在实际的应用程序中?

Can you do this in Android? 您可以在Android中执行此操作吗?

Only if you are making your own firmware. 仅当您制作自己的固件时。 Ordinary SDK applications do not have the ability to add to the roster of device-wide settings. 普通的SDK应用程序无法添加到设备范围的设置清单中。

Or must you settings have to be in the actual appilcation? 还是必须在实际应用中进行设置?

Yes. 是。 You can have the same look and feel as the main Settings application, by use of PreferenceActivity and preference XML files. 通过使用PreferenceActivity和首选项XML文件,您可以与主设置应用程序具有相同的外观。

Android UI guidelines state that it is preferable and recommended to use a PreferenceActivity to handle all of your apps settings. Android UI准则指出,最好使用PreferenceActivity处理所有应用程序设置。

The beauty of using a PreferenceActivity is that it will automatically save the values to your apps SharedPreferences. 使用PreferenceActivity的好处在于,它将自动将值保存到您的应用程序SharedPreferences中。

Another point to consider is if all the other apps are using PAs then they come to yours and have to handle the settings differently then it makes their experience more difficult and could cause them to look elsewhere for another app. 要考虑的另一点是,如果所有其他应用程序都在使用功率放大器,那么它们就会出现在您的设备上,并且必须以不同的方式处理设置,这会使他们的使用体验变得更加困难,并可能导致他们在其他地方寻找其他应用程序。

Hope that helps, good luck with it 希望有帮助,祝你好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM