android-sdcard

HTC wildfire, application crashes if phone is connected to logcat and app tries to access the sd card

我怕爱的太早我们不能终老 提交于 2019-12-25 08:36:02
问题 I have an HTC Wildfire and I'm using it for testing my applications. I want to have to phone always connected with the usb to the pc so I can see the logs in LogCat or use a debugger. The problem starts when i try to access the SD card from the app. Although the phone is in "HTC Sync" mode and I can see the logs... when the app tries to access the SD card then the app crashes. So I have to remove the usb every time I want to test and replug it (and waiiiiiit ) to redeploy the app. Any

How to store call records in SD Card?

做~自己de王妃 提交于 2019-12-25 08:24:49
问题 I am trying to store incoming and outgoing calls record in my SD Card. but the issue is that i am not able to find that in my SD Card. Following is my Code Can any one help DeviceAdminDemo.java public class DeviceAdminDemo extends DeviceAdminReceiver { @Override public void onReceive(Context context, Intent intent) { super.onReceive(context, intent); context.stopService(new Intent(context, TService.class)); Intent myIntent = new Intent(context, TService.class); context.startService(myIntent);

how to save contents of a listview to a text file in android?

孤街醉人 提交于 2019-12-25 08:20:23
问题 I have a listview that has a bunch of content and I want to know how I can save the contents inside the list view as a text file? I am pulling all the content from a database. 回答1: Try array serialization (you can serialize and get back Objects) ObjectOutputStream out; Object[] objs = new Object[yourListView.getCount()]; for (int i = 0 ; i < youeListView.getCount();i++) { Object obj = (Object)yourListView.getItemAtPosition(i); objs[i] = obj; } try { out = new ObjectOutputStream( new

Android getting pictures from photo's gallery - error on some devices

这一生的挚爱 提交于 2019-12-25 07:05:06
问题 I have a function on my app which I open the photo's gallery and select an image to show in a ImageView. The weird thing is, on my Samsung Galaxy S5, the code work perfectly, but when I try on an ASUS Zenphone, or Motorola Moto X the code just doesn't work and the application crashes. All the devices has the same Android version (5.0) Here is my code samples: Intent to open photo's gallery: Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("image/*");

save multiple image views as a single file

江枫思渺然 提交于 2019-12-25 04:45:12
问题 In my application , one Relative Layout has totally three ImageView() 's . I want to save all the three imageviews as a single .png file to the device storage on a single button click. My code: Layout XML : <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/make" > <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="300dp"

Android KitKat sdcard write permission

社会主义新天地 提交于 2019-12-25 02:55:17
问题 In android KitKat there are some limitations for writing to SDcard. So my question: Is it always permitted to write to Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) even in KitKat? 回答1: Is it always permitted to write to Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) even in KitKat? If your app has requested the WRITE_EXTERNAL_STORAGE permission, then yes, as getExternalStoragePublicDirectory() points to external storage, which is

How to Take a Photo with the Camera App And also save as thumbnail and as Full-size Photo (resize & crop customly) in SD Card Two Folders?

前提是你 提交于 2019-12-25 02:47:15
问题 I am new in android development. I want take an image from android camera tool then save as thumbnail and also save as Full-size (Resize & crop user defined). I actually want thumbnail image show in GridView from one folder of SD Card then click one image then show full-size(1536 X 2048) image in one window from another folder of SD Card. I search in google but not get absolute example or tutorial which is match two conditions. For example developer.android.com/training/camera/photobasics

How to Take a Photo with the Camera App And also save as thumbnail and as Full-size Photo (resize & crop customly) in SD Card Two Folders?

蓝咒 提交于 2019-12-25 02:47:02
问题 I am new in android development. I want take an image from android camera tool then save as thumbnail and also save as Full-size (Resize & crop user defined). I actually want thumbnail image show in GridView from one folder of SD Card then click one image then show full-size(1536 X 2048) image in one window from another folder of SD Card. I search in google but not get absolute example or tutorial which is match two conditions. For example developer.android.com/training/camera/photobasics

Android 4.4 sdcard access new rules: about saving a file that started an activity

末鹿安然 提交于 2019-12-24 19:04:25
问题 I read that with Android 4.4 there are new rules for saving files on sdcard by apps. I have a specific case to ask about: an app (activity) A starts another app (activity) B feeding it with a file:// url, say it's a txt file (B is a text editor); the app B opens the file and edits it. Is the called app B able to save the edited content on the same file? Or will the new rules prevent it? 来源: https://stackoverflow.com/questions/24683209/android-4-4-sdcard-access-new-rules-about-saving-a-file

Storing a file on Internal And External SdCard

余生颓废 提交于 2019-12-24 14:33:16
问题 I am trying to save a file on both internal and external sd card .. basically I want to give user an option to save file on internal or external cards This is how I am creating file in Internal SD card File file = new File(Environment.getExternalStorageDirectory() + "/Tnt_input/register.html"); but how to create this file in External SD card ...? I can see two storage in DDMS 1) sdCard0 2) extSdCard by using above code its creating this file in sdCard0 回答1: You can use context.getFilesDir()