android-sdcard

Accessing Application Asset Files in HTML File

陌路散爱 提交于 2019-12-11 04:15:42
问题 i have an index.html page which calls a android activity method via JS and then that method downloads a html page from server and plces it in input folder on SD Card, after downloading that page app loads it to webView, now the problem is that jQueryMobile.js and jQueryMobile.css file are in applications's assets folder and register.html is in SDcard/input folder, how can i give reference of js and css files in register.html which is downloaded from server. assets SDCard - - -index.html - --

camera inside app force close data null when i try in different device

柔情痞子 提交于 2019-12-11 01:49:23
问题 i have an apk app which can take photo and take video with a button. This is my activity package com.example.testcamera; import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; import android.app.Activity; import android.content.ContentValues; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.provider.MediaStore; import android.util.Log; import android.view.View;

onActivityResult not called after taking a photo in Android

柔情痞子 提交于 2019-12-10 23:54:03
问题 I am using this code but my onActivityResult never gets called. I used to make the request without passing the extra intent to save the image to an SD card and that worked fine - onActivityResult() would get called as I expect it to. But since I added the SD card code - no luck! Have I added (or missed) something ? I was following https://stackoverflow.com/a/12277455/2884981 as an example. Here is my code, static final int CAPTURE_IMAGE_CALLBACK = 1; private void dispatchTakePictureIntent() {

How to copy image to an existing directory on sd card?

隐身守侯 提交于 2019-12-10 22:18:11
问题 I'm trying to copy an image file with this code: InputStream fileInputStream = null; OutputStream fileOutputStream = null; String inPath = "/storage/emulated/0/Pictures/MyImage.jpg"; String outPath = "/storage/extSdCard/MyFolder/MyImage.jpg"; try { verifyStoragePermissions(this); fileInputStream = new FileInputStream(new File(inPath)); File outputFile = new File(outPath); if (!outputFile.exists()) { try { outPutFile.createNewFile(); } catch (IOException e) { e.printStackTrace(); } }

SD-Card access API Android for Lollipop?

 ̄綄美尐妖づ 提交于 2019-12-10 21:57:23
问题 In this other question How to use the new SD card access API presented for Android 5.0 (Lollipop)? It is explained how to use the new API to access the "external SDCard". But, how can I know the actual directory returned in the result activity? I mean in function public void onActivityResult(int requestCode, int resultCode, Intent resultData) { if (resultCode == RESULT_OK) { Uri treeUri = resultData.getData(); DocumentFile pickedDir = DocumentFile.fromTreeUri(this, treeUri); ...... How can I

Sending SD commands from Android app

故事扮演 提交于 2019-12-10 19:19:34
问题 Is it possible to send SD (Secure Digital) commands from Android app to SD card ? Commands are read SD card, write to SD card etc (CMD18, CMD24). The constraint is the phone should NOT be a rooted phone. With rooted phone we are able to send SD commands but not with unrooted phone. On attempting we get the error "permission denied". Any help is greatly appreciated. Thanks 回答1: It is not possible. The SD card hardware is abstracted away and mounted as a directory in the filesystem. Why would

Prevent duplicated image saved to SD card

岁酱吖の 提交于 2019-12-10 15:50:02
问题 I have a listactivity app forming multiple rows. Each row opens an activity containing views, one of them is a button, when clicked open infinite gallery class ( images stored in RES => drawable folder inside the app), each image has button under it, when pressed it saves the image to SD card directory in a folder named ( saved_images ) . I'm using SharedPreferences in gallery class to store all the images in sequential order, that works fine - but I'm trying to : Prevent a repeat of images

error opening trace file: No such file or directory (2)

♀尐吖头ヾ 提交于 2019-12-10 14:12:23
问题 I am getting the above error: error opening trace file: No such file or directory (2) when I run my android application on the emulator. Can someone tell me what could be the possible reason for this? I am using android-sdk-20 and below lines are added to AndroidManifest.xml <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="15" /> I have also added the line: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> since I thought that there may be some issue

Move/Rename file in SD Card

有些话、适合烂在心里 提交于 2019-12-10 12:15:17
问题 I'm trying to move a file from one directory to another (in SD Card) I have a file's URI and the way I'm trying to move it: Uri selectedImage = imageReturnedIntent.getData(); // this the uri, something like content://media/external/images/media/635 File sdcard = Environment.getExternalStorageDirectory(); File from = new File(sdcard, selectedImage); File to = new File(sdcard, "myNewDir/mynewfile.jpg"); from.renameTo(to); But it doesnt work, neither does it give me any error in Logcat... Edit:

Access SD card data from android for work app

血红的双手。 提交于 2019-12-10 11:25:12
问题 My EMM is VMWare Airwatch, and I have successfully setup the android for work environment and installed the work profile on my Nexus 5x device. But my work apps are not able to access the SD data, or files stored on external storage. I have tried creating and installing Android for work profile. In the Airwatch console under profiles I have also enabled the 'Sync and Storage' options under the Restrictions section of work profile. Is this the expected behaviour of work apps. As the primary