[Q] Copy file from sdcard to Samba network directory - Android Q&A, Help & Troubleshooting

Hi, We have installed ES File Explorer on our Android tablet and we have cataloged a remote server (10.10.19.45). I am able to see the files on this server from the tablet.
On a different desktop project, I have used a java.nio class file to copy files from a local folder on the desktop to the same remote server and it has been working fine. I tried to use the same java class to copy a file from the Android /sdcard/Download directory to the remote server and it will not create the file on the remote server. I tried specifying
File DestinationFile = new File("//10.10.19.45/sandbox/result.txt"); AND
File DestinationFile = new File("smb://10.10.19.45/sandbox/result.txt");
but neither one works. I keep getting the error "IOException: No such File or Directory". The first option worked for my regular desktop Java application. Is there anyway I can copy files from my sdcard/download directory to the samba directory I have catalogued on my Android? Thanks.

Related

Build CAB Installers under Linux

I have a Linux server running at my home that I use mostly for file storage among other things (like an Asterisk PBX). I keep ALL of my code on my server so that I can get to it from anywhere. That being said, I use MinGW32CE (part of the CeGCC Cross Compiler) to compile my native apps. So since I can build my apps on my Linux server, I wanted to figure out how to build the CAB installer on the server ... And here it is:
Install WINE
Download the Microsoft Cabinet Software Development Kit
Download CABWIZ (Its included in QuickCAB). Copy CABWIZ.EXE and CABWIZ.DDF to a new folder.
Extract MAKECAB.EXE from cabsdk.exe, rename it to all lower case and put it in the same folder
Create your cabwiz INF file (See MSDN CABWIZ Information File). For SourceDisksNames path, use .
Run CABWIZ using the following syntax: wine cabwiz.exe appname.inf /compress
thanks, to much helpful

Android FileOutStream: can not find my saved txt file

hello, everyone,
I'm an newbie developer for android device.
Recently I want to save my data into an txt file using FileOutputStream.
Here is my code:
Code:
FileOutputStream outStream=this.openFileOutput("2222.txt",Context.MODE_APPEND + Context.MODE_WORLD_READABLE);
String data1 = Float.toString(cpuUsage);
Log.i("savedata",data1);
outStream.write(data1.getBytes());
outStream.close();
The code worked perfectly.
But the problem is I can not find where to see this file on my computer.
I was told that the fileoutstream will ususally save file in data/(packages name)/files.
But data directory is empty in file explorer on Eclipse.
Anybody please help..
Best

[Q] Problem with SDK Manager - nothing works...

(Windows 7 64-bit Home Premium)
So I've been playing around with LibGDX, and it's been really nice...so I go to export my app to android for the first time just to make sure everything's running smoothly so far...and I get an error at compile time:
Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder!
So I Googled, and every solution to the problem I can find involves using the Android SDK Manager, or copying some files from one directory to another that I don't have in the first place. So I decide to go the SDK Manager route, except my SDK manager shows a command-line box for a second (no console output), then crashes.
So I Googled this, and I get nothing but people telling me to both mess with Android.bat and make sure I have the right environment variables set. So here I am, about an hour later, and I've got all my environment variables set that I could possibly need: JAVA_HOME points to my java sdk folder
Path points to both my JRE and my JDK binary folder, as well as C:\Windows\System32
ANDROID_SDK_HOME points to my Android SDK folder
ANDROID_SWT points to my android folder's tools\lib\x86-64 folder, which clearly has the swt.jar, but whenever I try running android.bat I still get:
'xcopy' is not recognized as an internal or external command, operable program or batch file (which should have been fixed when I added system32 to the path variable)
ERROR: SWT folder <my swt path> does not exist (even though it does)
Please set ANDROID_SWT to point to the folder containing swt.jar for your platform (it does!)
edit: just completely uninstalled then redownloaded the sdk, same errors... :crying:

[Q] Shell command to list files in .apk

Hello,
I'm trying to unzip an apk using the device shell. I need to see the package name of the app contained in the apk. I tried using unzip -l but I just get output that says "zip flags 1 and 8 not supported". How can I unzip an apk? For that matter, am I using the right tool for this job? I just want to view the manifest of the apk, really. I have busybox.
[To moderators] Please delete this post. There's a typo in my user name. I've signed in using the correct account below.
Hello,
I'm trying to unzip an apk using the device shell. I need to see the package name of the app contained in the apk. I tried using unzip -l but I just get output that says "zip flags 1 and 8 not supported". How can I unzip an apk? For that matter, am I using the right tool for this job? I just want to view the manifest of the apk, really. I have busybox.
MutantPatypus said:
Hello,
[To moderators] Please delete this post. There's a typo in my user name. I've signed in using the correct account below.
Click to expand...
Click to collapse
You could contact admin for changing your username instead of creating another account because of typo.
However, contact the admin and deactivate your previous account
its so easy with any app like root browser, es file explorer, etc. i use both root browser by jrummy and es file explorer.
there's no use of zipping the apk just to see the manifest file...
the manifest file is obfuscated upon the building the apk... so if you try to extract it, you can only see a different, non-human readable format of it...
however you can use aapt to peek what's inside the manifest file in a readable format... try downloading the aapt binary...

Editing the host file - new entry has no effect

Hi folks,
I'm developing a new version of a live website in WordPress with domain mapping so that the URL is like-for-like with the live site. On a PC, I just change my host file to point to the WordPress IP address.
I now need to test the WordPress site on a phone.
I have an old HTC Desire with Android 2.3.4 (rooted) that I'm trying to use, so need to add the WordPress IP to the host file.
Using ADB, I've managed to retrieve the hosts file from the phone, edit it and place it back on the phone using:
Code:
adb remount
adb pull /system/etc/hosts /hosts
[edited host file]
adb push /hosts /system/etc/hosts
To double-check that the hosts file really has updated, I've deleted hosts from my computer, then pulled it again from my phone. Opening it up in Notepad++ I can see that it does contain the new entry.
The strange thing is, if I open a web browser to the url I'm trying to map to the WordPress IP address, it still goes to the live website, not the WordPress server. I've verified this using PingTools - the returned IP address is that of the live server.
I'm guessing I need to flush the DNS but it seems the only way to do this is a reboot. But upon reboot, the new entry in the hosts file is gone and we're back to only "127.0.0.1 localhost", so I'm now at a loss.
Any thoughts on where to go from here?
EDIT
After doing the above, installing and loading 'Hosts tool' from Google Play, sometimes the new host entry is there, but most of the time the host file disappears from the phone completely! Looking through ASTRO file manager, it confirms the host file has vanished. Rebooting the phone gets it back, but then we're then back to only "127.0.0.1 localhost" in the host file
I've fixed the problem. For some reason, there needs to be a line feed after the last entry in the host file.
To do this, open the host file in Notepad++ and go the view menu > Show symbol > Show characters. Copy the LF character at the end of "127.0.0.1 localhost" and paste it to the end of each line if it doesn't already have the LF character at the end.
Android refreshes its DNS every 10 minutes, so it's then just a matter of waiting.

Categories

Resources