社区
Android
帖子详情
PackageManager的Features设置问题
ballflying
2010-11-18 05:23:44
PackageManager类里的有个方法getSystemAvailableFeatures()可以得到一些已有的feature,
比如FEATURE_BLUETOOTH, FEATURE_CAMERA 和FEATURE_MICROPHONE等,
请问这些Feature是在哪里设置的呢?
我想把一个FEATURE_TOUCHSCREEN_MULTITOUCH设备进去,该怎么办?
谢谢。。。
...全文
490
12
打赏
收藏
PackageManager的Features设置问题
PackageManager类里的有个方法getSystemAvailableFeatures()可以得到一些已有的feature, 比如FEATURE_BLUETOOTH, FEATURE_CAMERA 和FEATURE_MICROPHONE等, 请问这些Feature是在哪里设置的呢? 我想把一个FEATURE_TOUCHSCREEN_MULTITOUCH设备进去,该怎么办? 谢谢。。。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
12 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
DrSmart
2010-11-20
打赏
举报
回复
怎么结贴时,没有全部给我分
DrSmart
2010-11-19
打赏
举报
回复
给你篇详细的吧,
androidmanifest.xml高级属性解析
,看完了就知道了
ballflying
2010-11-19
打赏
举报
回复
[Quote=引用 3 楼 zhq56030207 的回复:]
引用 1 楼 drsmart 的回复:
在 androidmanifest.xml中加入
manifest里面是加一些权限permission之类的,这个不能在哪里加
[/Quote]
TO zhq: 你知道怎么设置这些features吗?,,呵呵。
纠结的木棉花
2010-11-19
打赏
举报
回复
[Quote=引用 1 楼 drsmart 的回复:]
在 androidmanifest.xml中加入
[/Quote]manifest里面是加一些权限permission之类的,这个不能在哪里加
ballflying
2010-11-19
打赏
举报
回复
[Quote=引用 1 楼 drsmart 的回复:]
在 androidmanifest.xml中加入
[/Quote]
TO DrSmart: 怎么个加法?能说得详细点吗? 谢谢。
DrSmart
2010-11-19
打赏
举报
回复
在 androidmanifest.xml中加入
ballflying
2010-11-19
打赏
举报
回复
OK,知道了,是把frameworks/base/data/etc/android.hardware.touchscreen.multitouch.xml拷贝到手机的/etc/permissions目录下。
ballflying
2010-11-19
打赏
举报
回复
这两个文件是干嘛的吗? 请DRSMART大侠说明一下,谢谢。
ballflying
2010-11-19
打赏
举报
回复
[Quote=引用 8 楼 drsmart 的回复:]
frameworks/base/data/etc/android.hardware.touchscreen.multitouch.xml
system/etc/permissions/android.hardware.touchscreen.multitouch.xml
[/Quote]
貌似system/etc/permissions/android.hardware.touchscreen.multitouch.xml 没有。。。
DrSmart
2010-11-19
打赏
举报
回复
frameworks/base/data/etc/android.hardware.touchscreen.multitouch.xml
system/etc/permissions/android.hardware.touchscreen.multitouch.xml
ballflying
2010-11-19
打赏
举报
回复
waiting for high hands...
ballflying
2010-11-19
打赏
举报
回复
[Quote=引用 5 楼 drsmart 的回复:]
给你篇详细的吧,androidmanifest.xml高级属性解析,看完了就知道了
[/Quote]
TO DrSmart:
看过了你给的资料,在 androidmanifest.xml中设置的那些feature的作用只是说当PHONE上有这些
feature时,程序才能正常使用。
而通过PackageManager的getSystemAvailableFeatures()判断系统是否具有的feature并不是在androidmanifest.xml设置的。
System
Feature
sTest.rar_The Test
Test for checking that the {@link
Package
Manager
} is reporting the correct
feature
s.
CommonsWare.The.Busy.Coders.Guide.to.Android.Development.Version.8.2.2017
Android, the next-generation open mobile platform from Google and the Open Handset Alliance, is poised to become a significant player in the mobile device market. The Android platform gives developers a fair bit of control while still supporting a familiar programming language. However, the frameworks, GUI widgets, and development model is different than any other mobile platform out there. That’s where this book comes in Spanning 466 pages, The Busy Coder’s Guide to Android Development covers a wide range of Android capabilities and APIs, from creating simple user interfaces, to supporting long-running background processes, through the advanced location tracking and mapping
feature
s. Along the way, it covers how to embed the WebKit Web browser in your application, how to have your application use data from other installed applications (and vice versa!) or off the Internet, and how to integrate with the built-in on-device search engine. It will help you more quickly climb the Android learning curve, so you can create the “killer app” you’ve dreamed of…or perhaps just a quick-and-dirty application for you and your friends. Table of Contents Preface Key Android Concepts Choosing Your Development Toolchain Tutorial #1 - Installing the Tools Android and Projects Tutorial #2 - Creating a Stub Project Getting Around Android Studio Contents of Android Projects Introducing Gradle and the Manifest Tutorial #3 - Changing Our Manifest (and Gradle File) Some Words About Resources Tutorial #4 - Adjusting Our Resources The Theory of Widgets The Android User Interface Basic Widgets Debugging Your App LinearLayout and the Box Model Other Common Widgets and Containers Tutorial #5 - Making Progress GUI Building, Continued AdapterViews and Adapters The WebView Widget Defining and Using Styles JARs and Library Projects Tutorial #6 - Adding a Library The Action Bar Tutorial #7 - Setting Up the Action Bar Android’s Process Model Activities and Their Lifecycles Tutorial #8 - Setting Up An Activity The Tactics of Fragments Tutorial #9 - Starting Our Fragments Swiping with ViewPager Tutorial #10 - Rigging Up a ViewPager Resource Sets and Configurations Material Design Basics Dealing with Threads Requesting Permissions Tutorial: Runtime Permission Support Assets, Files, and Data Parsing Tutorial #11 - Adding Simple Content Tutorial #12 - Displaying the Book Using Preferences Tutorial #13 - Using Some Preferences SQLite Databases Tutorial #14 - Saving Notes Internet Access Intents, Intent Filters Broadcasts and Broadcast Receivers Tutorial #15 - Sharing Your Notes Services and the Command Pattern Tutorial #16 - Updating the Book Large-Screen Strategies and Tactics Tutorial #17 - Supporting Large Screens Backwards Compatibility Strategies and Tactics System Services Google Play Services Getting Help Working with Library Projects Gradle and Legacy Projects Gradle and Tasks Gradle and the New Project Structure Gradle and Dependencies Manifest Merger Rules Signing Your App Distribution Advanced Gradle for Android Tips Testing with JUnit4 Testing with UI Automator Measuring Test Coverage Unit Testing MonkeyRunner and the Test Monkey Notifications Advanced Notifications Introducing GridLayout The Percent Support Library Dialogs and DialogFragments Advanced ListViews Action Bar Navigation Action Modes Other Advanced Action Bar Techniques Toolbar AppCompat: The Official Action Bar Backport RecyclerView Implementing a Navigation Drawer The Android Design Support Library Advanced Uses of WebView The Input Method Framework Fonts Rich Text Animators Legacy Animations Custom Drawables Mapping with Maps V2 Crafting Your Own Views Advanced Preferences Custom Dialogs and Preferences Progress Indicators More Fun with Pagers Focus Management and Accessibility Miscellaneous UI Tricks Event Bus Alternatives Tasks The Assist API (“Now On Tap”) The Data Binding Framework Desktop Android Apps Drag and Drop Keyboard and Mouse Input Home Screen App Widgets Adapter-Based App Widgets Content Provider Theory Content Provider Implementation Patterns The Loader Framework The ContactsContract and CallLog Providers The CalendarContract Provider The MediaStore Provider Consuming Documents Providing Documents Encrypted Storage Packaging and Distributing Data Advanced Database Techniques Data Backup SSL NetCipher Embedding a Web Server Miscellaneous Network Capabilities Audio Playback Audio Recording Video Playback Using the Camera via 3rd-Party Apps Working Directly with the Camera Media Routes Supporting External Displays Google Cast and Chromecast The “Ten-Foot UI” Putting the TVs All Together: Decktastic Creating a MediaRouteProvider Screenshots and Screen Recordings Advanced Permissions Restricted Profiles and User
Manager
Miscellaneous Security Techniques Alarm
Manager
and the Scheduled Service Pattern Power
Manager
and WakeLocks JobScheduler Accessing Location-Based Services The Fused Location Provider Working with the Clipboard Telephony Working With SMS NFC Device Administration Basic Use of Sensors Printing and Document Generation Dealing with Different Hardware Writing and Using Parcelables Responding to URLs Plugin Patterns
Package
Manager
Tricks Remote Services and the Binding Pattern Advanced Manifest Tips Miscellaneous Integration Tips Reusable Components Android Studio Editors and Dialogs Advanced Emulator Capabilities Lint and the Support Annotations Using Hierarchy View Screenshots and Screencasts ADB Tips and Tricks Issues with Speed Finding CPU Bottlenecks Focus On: NDK Improving CPU Performance in Java Finding and Eliminating Jank Issues with Bandwidth Focus On: TrafficStats Measuring Bandwidth Consumption Being Smarter About Bandwidth Issues with Application Heap Finding Memory Leaks Issues with System RAM Issues with Battery Life Power Measurement Options Sources of Power Drain Addressing Application Size Issues The Role of Scripting Languages The Scripting Layer for Android JVM Scripting Languages Crash Reporting Using ACRA In-App Diagnostics Anti-Patterns Widget Catalog: AdapterViewFlipper Widget Catalog: CalendarView Widget Catalog: DatePicker Widget Catalog: ExpandableListView Widget Catalog: SeekBar Widget Catalog: SlidingDrawer Widget Catalog: StackView Widget Catalog: TabHost and TabWidget Widget Catalog: TimePicker Widget Catalog: ViewFlipper Chrome and Chrome OS Device Catalog: Kindle Fire Device Catalog: BlackBerry Device Catalog: Android TV Device Catalog: Amazon Fire TV and Fire TV Stick Appendix A: CWAC Libraries Appendix B: N Developer Preview Appendix C: Community Theater and the Appinars Title: The Busy Coder’s Guide to Android Development Author: Mark L. Murphy Length: 3893 pages Edition: Revised & enlarged Language: English Publisher: CommonsWare Publication Date: 2016-06-06 ISBN-10: 0981678009 ISBN-13: 9780981678009
Android
Package
Manager
基本使用
Package
Manager
管理类,它的主要职责是管理应用程序包,通过
Package
Manager
获取的应用程序信息来自AndroidManifest.xml。
Package
Manager
hasSystem
Feature
今天遇到了一个获取NFC配置的判断条件方法,调用的是
Package
Manager
里面的hasSystem
Feature
方法,兜兜转转最终才找到是在device.mk添加的配置,具体流程如下: 最初遭遇的方法:get
Package
Manager
().hasSystem
Feature
(
Package
Manager
.
FEATURE
_NFC) 然后在/android/frameworks/
checksignature java_Java
Package
Manager
.checkSignatures方法代码示例
import android.content.pm.
Package
Manager
; //导入方法依赖的
package
包/类public void SetDonationKeyStatus() {if (BuildConfig.DEBUG) {Status = true;return;//if debug mode, avoid the advertisements and use pro feat...
Android
80,351
社区成员
91,288
社区内容
发帖
与我相关
我的任务
Android
移动平台 Android
复制链接
扫一扫
分享
社区描述
移动平台 Android
android
android-studio
androidx
技术论坛(原bbs)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章