file-transfer

Android Write file to accessible folder for windows usb file transfer

房东的猫 提交于 2019-12-11 03:55:38
问题 I am operating with a standard Nexus 5 which is un-rooted with standard vanilla android 4.4.2 I would like to create a new file that is accessible in Windows through the standard USB connector. I don't want to root my phone. Here is a snippet of my code: File outputFile = new File(new File(getFilesDir().getParentFile(), "assets"), "example.xml"); Does anyone know of any directories that are writable in app + readable via USB transfer ? Thank you for any help ! :) 回答1: You can create the file

Add extra params to $cordovaFileTransfer.upload

可紊 提交于 2019-12-11 03:46:58
问题 I am using $cordovaFileTransfer.upload() to upload a picture from a device to my server. In documentation it says that it excepts these params: server, filePath, options . I need to pass in some extra custom params: like user_id , for example. Does anyone know if it's possible to do? Thank you. 回答1: You can send those custom parameters in the options object, doing something like this: var options = {}; options.headers = { Connection: "close" } options.chunkedMode = false; options.userName =

File transfer over Wi-Fi in Android

别来无恙 提交于 2019-12-11 03:32:31
问题 I want to make an Android app which can transfer a file from one phone to another via Wi-Fi. In Android 4.0 it can be done through Wi-Fi direct but how it would be possible for lower versions that do not support Wi-Fi direct? 回答1: You can do this by opening a network connection. This will work over Wifi or any connection the device has. Let's say device A wants to send to device B a file. B opens a listening port A opens the file as an input stream A connects to B's listening port A sends the

Sending a file with Java Sockets, losing data

a 夏天 提交于 2019-12-11 03:16:12
问题 I'm trying to send a file from a client to a server with Sockets in Java. It works fine when I am testing on the same machine, but when I test across different machines, I lose large chunks of data, resulting in a corrupted file. If I try to send a very small file (<20 bytes), it doesn't even reach the println inside the server's while loop. Here is my code: Server.java package edu.mst.cs.sensorreceiver; import java.io.*; import java.net.ServerSocket; import java.net.Socket; public class

android phonegap FileTransfer.download() recieving error code 3

佐手、 提交于 2019-12-11 02:13:36
问题 I am trying to use FileTransfer.download() but seem to get "error code 3" no matter what I try. Any help is greatly appreciated. I am using cordova 2.1 and zend studio 10 which is built on eclipe to build out my manifest and apk files. Below is my code var fileTransfer = new FileTransfer(); fileTransfer.download( "http://www.w3.org/2011/web-apps-ws/papers/Nitobi.pdf", "file:///sdcard/theFile.pdf", function(entry) { alert("download complete: " + entry.fullPath); }, function(error) { alert(

Transferring file using WCF

浪子不回头ぞ 提交于 2019-12-10 23:31:32
问题 I'm trying to write a WCF service that allows PCs and Windows Mobiles to download certain files. For the PCs I used MTOM to stream the data to the clients but it seems that Windows Mobile does not support MTOM. How can I implement a single service to download files? The file sizes vary from 100KBs to 10MBs. 回答1: At this time, DIME is still the way to go as there is no MTOM implementation for .NET CF. See also : Dime Buffered Upload WSE 3.0 cannot be used with the Compact Framework 2.0 on

Is Phonegap's FileTransfer object obsolete with XmlHttpRequest2?

佐手、 提交于 2019-12-10 22:44:23
问题 Is there a reason to still use the FileTransfer object with the availabilty of sending blobs/files or even multiple files in forms via XmlHttpRequest2 ? Using html5 makes it a lot easier to run the same app in a modern browser as well and reduces code. Or are there any advantages to the FileTransfer object? Especially FormData seems to do the same, though it runs only on the latest browsers. 回答1: It seems the FormData & file implementation is not working properly on all systems, yet.

Bluetooth File transfer on Android(even restricted types)

孤者浪人 提交于 2019-12-10 19:52:13
问题 I was making an application in which I wanted to add a feature to send apk files via bluetooth. Its not allowed through the traditional method as apk is restricted file type so i used BluetoothShare.java. Apparently it doesn't work on Jellybean. I get a nasty security Exception. Same as this one. Android bluetooth print stopped working on 4.1 Is there any way I can go about doing this, if possible? 回答1: rename the .apk to .zip and send it, then rename it back to .apk on phone. 回答2: I was able

Sending multiple files via bluetooth

孤者浪人 提交于 2019-12-10 18:55:33
问题 I am using below code to send a file via blue-tooth from one device to another. I want to send multiple file at the same time.Can anyone guide me how to parse multiple URI to file.I tried doing it with string tokenizer and while loop but in that case, by-default blue-tooth request is coming twice.(if there are two files parsing). StringTokenizer tokens = new StringTokenizer(music, ","); String stored = ""; while (tokens.hasMoreTokens()) { stored = tokens.nextToken(); File file = new File

Phonegap : Downloading large files on Windows Phones

痴心易碎 提交于 2019-12-10 15:27:35
问题 I'm developing a mobile app with Phonegap and I need to download zip-files which might be over 50MB. I'm using Cordova's file-transfer plugin to do this job. Now, on iOS and Android this works just fine, but when I do the same thing on Windows Phone the application hangs out files that are larger than 20MB. System.OutOfMemoryException: Insufficient memory to continue the execution of the program. PhonGap documentation has this line which says that downloading is supported only on iOS and