android.os.SystemProperties 在哪里? [英] Where is android.os.SystemProperties?

查看:103
本文介绍了android.os.SystemProperties 在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看 Android 相机代码,当我尝试导入 android.os.SystemProperties 时,找不到它.

I'm looking at the Android Camera code, and when I try importing android.os.SystemProperties, it cannot be found.

这是我正在查看的文件:
https://android.googlesource.com/platform/packages/apps/Camera/+/eclair-release/src/com/android/camera/VideoCamera.java

Here is the file I'm looking at:
https://android.googlesource.com/platform/packages/apps/Camera/+/eclair-release/src/com/android/camera/VideoCamera.java

我创建了一个新的 2.1 项目并尝试再次导入此命名空间,但仍然找不到.我检查了 https://developer.android.com 并且 SystemProperties 未列出.

I created a new 2.1 project and tried importing this namespace again, but It still cannot be found. I checked https://developer.android.com and SystemProperties was not listed.

我错过了什么吗?

推荐答案

Android源代码中的类:

This is the class in the Android source code:

https://android.googlesource.com/platform/frameworks/base/+/eclair-release/core/java/android/os/SystemProperties.java

在 JavaDoc 类中看到 {@hide} 了吗?这意味着此类不会作为公共 SDK 的一部分导出.

See {@hide} in the class JavaDoc? That means this class won't be exported as part of the public SDK.

相机应用使用它,因为它是内部的,他们不会使用公共 SDK 来构建它.

The camera app uses it as it's internal and they won't use the public SDK to build it.

你也许还能上这门课

  1. 通过反射或

  1. by reflection or

通过获取源代码,删除 @hide 并制作自己的自定义 SDK.

by getting the source, removing @hide and making your own customized SDK.

然而,根据定义,您现在正在off SDK",因此您的应用很可能会被破坏或在操作系统版本上出现不同的行为,因为 Android 人员几乎不会努力不改变这一点版本之间的类.

However pretty much by definition you are now going 'off SDK' and therefore your app may well be broken or get different behavior on OS versions as the Android folks will make little effort not to change this class between versions.

这篇关于android.os.SystemProperties 在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆