Issue
hi i have to work in WebView
with Camera
. I am implemented some HTML
code that file load from the Assets
in WebView
and my HTML
file contains a Button
for uploading image into server. Images are selected from Gallery itself and taking photo from camera. but when i try with camera it's not opening. I dont know why? also, i added required camera permission in my manifest.xml
.
please some one point me where i am going wrong?
Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.maptest"
android:versionCode="1"
android:versionName="1.0" >
<permission
android:name="com.example.maptest.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.maptest.permission.MAPS_RECEIVE" />
<!-- Copied from Google Maps Library/AndroidManifest.xml. -->
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- My Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- External storage for caching. -->
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:debuggable="true"
android:icon="@drawable/sms_lg"
android:label="SMS Reader" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="mapkey" />
<activity
android:name=".WebView2"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="BasicMapActivity2" >
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
</application>
</manifest>
Solution
I got your issue i think you need to add <uses-feature>
for camera like:
<uses-feature
android:name="android.hardware.camera"
android:required="true" />
It's becoz requesting the permission
grants your application access to the appropriate hardware and software, while declaring the features
used by your application ensures proper device compatibility.
Try this and give me feedback on this. For more information go to http://developer.android.com/guide/topics/manifest/uses-feature-element.html
Answered By - M D
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.