2014-10-18 80 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/