2014-10-18 36 views
0

我已经开始使用PhoneGap。我正在使用PhoneGap构建来编译我的应用程序。我试图用相机,但我被困在config.xml中Android PhoneGap配置XML用户权限

很多到处搜寻后,我无法找到除了爱情之外使用用户权限

谁能告诉我怎么可以在我的config.xml文件中使用这个

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 

一个示例XML会很棒。由于

回答

3

将此行添加到您的config.xml中

<feature name="http://api.phonegap.com/1.0/file" /><!-- WRITE_EXTERNAL_STORAGE; required for camera to write to camera roll --> 
+0

Thank you..Workshops perfect – Maheshvirus 2017-03-10 10:00:15

0

你可以在这里查看我的资料库,

https://github.com/datomnurdin/com.revivalx.cordova.camera/blob/master/platforms/android/AndroidManifest.xml

AndroidManifest

<?xml version='1.0' encoding='utf-8'?> 
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" android:windowSoftInputMode="adjustPan" package="com.revivalx.cordova.camera" xmlns:android="http://schemas.android.com/apk/res/android"> 
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" /> 
    <uses-permission android:name="android.permission.INTERNET" /> 
    <application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name"> 
     <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:name="CameraCordova" android:theme="@android:style/Theme.Black.NoTitleBar"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
    </application> 
    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" /> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
</manifest> 

config.xml中

<?xml version='1.0' encoding='utf-8'?> 
<widget id="com.revivalx.cordova.camera" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> 
    <preference name="loglevel" value="DEBUG" /> 
    <feature name="App"> 
     <param name="android-package" value="org.apache.cordova.App" /> 
    </feature> 
    <name>CameraCordova</name> 
    <description> 
     This source code provides example for taking pictures and for choosing images from the system's image library. 
    </description> 
    <author email="[email protected]" href="http://revivalx.com"> 
     Apache Cordova Team 
    </author> 
    <content src="index.html" /> 
    <access origin="*" /> 
    <feature name="Camera"> 
     <param name="android-package" value="org.apache.cordova.camera.CameraLauncher" /> 
    </feature> 
</widget> 

教程:http://blog.revivalx.com/2014/05/03/tutorial-camera-cordova-plugin-for-ios-and-android/