sd-card

showing image from sdcard with webview not working

孤人 提交于 2019-12-04 10:41:37
I have downloaded map750.png file in the root of sdcard, but when I try to show it within a webview with some text, only the text is shown. Could you help me to find what is wrong in the code? thanks. setContentView(R.layout.webview); mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings().setAllowFileAccess(true); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setBuiltInZoomControls(true); String html = "<html><head></head><body><p>hello</p><img src=\"file://mnt/sdcard/map750.png\" alt=\"alternativo\" /></body></html>"; mWebView.loadData(html, "text

Get sdcard directory by adb

杀马特。学长 韩版系。学妹 提交于 2019-12-04 08:16:42
问题 I am making an application, which pulls files(Saved by android app) from the device sdcard by adb. The problem is that different devices, have various sdcard directories i.e: sdcard sdcard/external_sd Firstly I invented following solution: run adb shell ls Check if dir "sdcard" exists If yes run sdcard/ ls and check if external_sd exists return value. But the problem is that I have two samsung devices GT-I9100 and GT-I9000 and both have a directory sdcard/external_sd . When I am checking

How to open local PDF file in PhoneGap (android)

那年仲夏 提交于 2019-12-04 07:40:58
I'm trying to open a local PDF file stored in the sdcard. I tried everything possible but nothing seems to work. I tried to open the pdf using the anchor tag with external and _blank attribute. I as well tried to " WebIntent, an Android PhoneGap Plugin ". But was not able to succeed. I'm sure i have missed something in the manifest xml file. I'm not more into backend development. Any help will be appreciated. Thanks in advance Here the answer : http://giovesoft.blogspot.com/2011/08/download-and-open-pdf-with-phonegap.html#more 来源: https://stackoverflow.com/questions/6925174/how-to-open-local

Need help correctly emulating the Samsung Galaxy Nexus with AVD

孤街浪徒 提交于 2019-12-04 07:14:09
I'm working to ensure my app is getting tested on ICS properly using the popular Galaxy Nexus as a basis. I'd like to emulate it as faithfully as possible. I've created an AVD with the following parameters (from config.ini). This was mostly created using the GUI (disk.dataPartition.size is a hand-edited param based on other articles I've read). The memory values may be on the low side but that's not causing a problem for me at the moment. Since the device had no external sdcard I've said "no" for hw.sdCard, but I'm clearly not seeing anything in the /mnt/scdcard (same as /sdcard) and cannot

android reading an image from SD Card

自闭症网瘾萝莉.ら 提交于 2019-12-04 05:59:29
I'm trying to read an image from my SD Card and I'm not sure if I'm doing it right or not. Need some help please This is my code for reading it: String imageInSD = "/sdcard/Hanud/" + c.getString(1) + ".PNG"; Bitmap bitmap = BitmapFactory.decodeFile(imageInSD); ImageView myImageView = (ImageView)findViewById(R.id.imageview); myImageView.setImageBitmap(bitmap); And this is my main file: <?xml version="1.0" encoding="utf-8"?> <WebView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/webview" android:orientation="vertical" android:layout_width="fill_parent" android

Reading and Writing XML file

穿精又带淫゛_ 提交于 2019-12-04 05:15:51
I have an Application in which first I want to create a backup of message from inbox and store it into backup.xml file which is stored at SDCARD/MYBACKUP/mybackup.xml Now I want to retrieve data, stored on SDCARD/MYBACKUP/mybackup.xml and display all messages in listview. Tofeeq Ahmad For Writing XML file to sdcard see this answeer Qberticus's Answer android Reading file is just simple you have to use Xml parsing See This for XML parsing To R/W Sdcard You have to give Permission <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 来源: https://stackoverflow.com/questions

PhoneGap/Cordova BlackBerry FileSystem.root always returns SD card?

狂风中的少年 提交于 2019-12-04 03:45:34
I have two applications I'm loading on a BlackBerry, one is a native application, the other is a PhoneGap / Cordova based application. These two applications share a settings file: file:///store/home/user/myfile.txt To access this file via Cordova, I call: fileSystem.root.getFile("home/user/myfile.txt", null, gotFileEntry, fail); However, on some devices fileSystem.root returns the SDCard directory, not the internal memory where the file is stored, so I get a FileNotFound error. I've tried calling fileSystem.root.getParent(gotParent, fail); , hoping to get the root of the filesystem, then get

Android low-level read of SD card greater than 2GB

自闭症网瘾萝莉.ら 提交于 2019-12-04 03:25:23
My Android application attempts to read the physical sectors of the SD card by accessing the actual device (in my case, /dev/block/vold/179:1). (this is on a rooted phone, of course) I'm able to open the device as a FileInputStream , and read data from it. However, I can't seem to read it past the 2GB mark (my memory card is 16GB). Is this because Android doesn't support files greater than 2GB? If that's the case, why do functions like position() and skip() accept long arguments?? Does anyone have advice on how to read from the device past 2GB? try create with a native (jni) lib and call _

Android - How to start an application on the /sdcard after boot

萝らか妹 提交于 2019-12-04 00:06:16
Is there a way how to start and android application after a boot automatically if it is on the /sdcard ? Ok, probably by BroadcastReceiver . But which action is the right one? ACTION_BOOT_COMPLETED - does not work if it is on the /sdcard (documented) ACTION_MEDIA_MOUNTED - does not work if it is on the /sdcard (which is undocumented) ACTION_EXTERNAL_APPLICATIONS_AVAILABLE - does not work, I do not know why ACTION_USER_PRESENT - does not work if the BroadcastReceiver is registered in AndroidManifest (which is undocumented, but documentation bug has been reported) Thanks Jan Rahul Chaudhary

Android: How to load image into Bitmap

允我心安 提交于 2019-12-03 21:36:36
I am able to load a resource image, from drawable folder, into a bitmap and even scale fine, however now I have a need to load an image from any stored on the SD-Card and I can see this will allow me to view and select; startActivityForResult(new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI), 1); However so far I have been unable to find out exactly what data is returned and how to load it into a bitmap. UPDATED: This is now what I got; @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent) { super.onActivityResult