General :: When Open TXT File - Text Encoded And Cannot Be Read?
Dec 1, 2011When I open a txt file the text is encoded and cannot be read.The file can be opened with Adobe; but ThinkFree automatically opens the file.

When I open a txt file the text is encoded and cannot be read.The file can be opened with Adobe; but ThinkFree automatically opens the file.
I would like my app to pop up in the list of options for opening certain file types in the various file manager, email, and web browser apps. I'm having trouble figuring out how to begin. I haven't found any examples of this sort of thing yet. Don't I need to know what kind of action the other app is trying to invoke on a selected file? How can I possibly know that? Or should I simply assume that all file manager, email, and browser apps will always use ACTION_VIEW or perhaps ACTION_EDIT when trying to send a file to another app? Must I simply assume this and hope I'm right? There are so many possible apps to try to get this to work with, how do I make it receive a "open-file" command from any arbitrary app? Is the code below correct so far? I have the following in the manifest:
<receiver android:enabled="true" android:exported="true" android:label="Some Label, where does this show up?" android:name=".MyBroadcastReceiver" >
<intent-filter> <action android:name="android.intent.action.ACTION_EDIT" />
</intent-filter> <intent-filter> <action android:name="android.intent.action.ACTION_VIEW" /> </intent-filter> </receiver>
I don't see how to specify a file-type or file extension filter in the receiver. How do I do this? Likewise I have the following in the receiver:
public class MyBroadcastReceiver extends BroadcastReceiver {
@Override public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals("android.intent.action.ACTION_EDIT")
|| intent.getAction().equals("android.intent.action.ACTION_VIEW")) {
Uri uri = intent.getData(); String uriStr = intent.getDataString();
} } }
I have a very basic question regarding encoded text in an XML Text node.
I am using the DOM parser javax.xml.parsers.DocumentBuilder to parse some xml. The xml has some international characters which are encoded in decimal unicode - eg. 'ó' is 'ó'.
The parser takes the encoded character out of the word for example jóbb and the Text node is left with jbb as the node value. If I use getData() on the Text node it returns jbb also. The character is not lost though - a sibling Node, an Entity Reference Node, has the decimal value and an index. The index value corresponds to where this character should be inserted. In this case for example if would have an index of 1 and value of '#234'.
This indicates that there must be a simple way of accessing the value of the Text node of its parent in such a way as to get 'jóbb'. It seems unlikely that I need to reconstruct this by doing a lookup to convert the encoded character to utf8 and then insert it into the string for the Text node. Does anyone know how this works?
What do I do to be able to read all lines from a file? With this code I have below I can only get the first line of the text file when I use mReadString later on. Am I doing something wrong? Or is there another way? code...
View 8 Replies View RelatedI am creating an application for the android, and would like it to be able to read a text file via anonymous FTP. I've tried URLConnection, but it doesn't seam to be working. After some Google searching it appears that URLConnection doesn't always work with some FTP servers. All of the java FTP connection libraries I've found require you to download the file to a local location before reading it. However I would like to have the same functionality as URLConnection in that I can just use the following similar code...
View 1 Replies View RelatedI am New To Android, My requirement is to display Total SDcard files in Listview , in that i want to read only TextFiles.
View 1 Replies View RelatedI am trying to read a file "words.txt" from a resource. It is a very simple, but large (2 MB), text file that I want to read line by line. I have put the file into /res/raw/words.txt, and try to open it with the following code:
CODE:...................
However, I get a java.io.IOException. This is not a "resource not found" exception, so the resource is opened correctly, but the readLine() produces the error.
I tried using the InputStream itself, with the result that read() produces -1, which stands for EOF, as if the file was empty.
I have a text file added as a raw resource. The text file contains text like:
a) IF APPLICABLE LAW REQUIRES ANY WARRANTIES WITH RESPECT TO THE SOFTWARE, ALL SUCH WARRANTIES ARE LIMITED IN DURATION TO NINETY (90) DAYS FROM THE DATE OF DELIVERY.
b) NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY VIRTUAL ORIENTEERING, ITS DEALERS, DISTRIBUTORS, AGENTS OR EMPLOYEES SHALL CREATE A WARRANTY OR IN ANY WAY INCREASE THE SCOPE OF ANY WARRANTY PROVIDED HEREIN.
c) (USA only) SOME STATES DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY
NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER LEGAL RIGHTS THAT VARY FROM STATE TO STATE.
On my screen I have a layout like this:
CODE:........
The code to read the raw resource is:
CODE:....
The text get's showed but after each line I get a strange character [] How can I remove that character ? I think it's New Line.
WORKING SOLUTION
CODE:....................
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.help);
[Code]....
There is my code. The problem is with the inputStreamToString(iFile).It says that it is undefined. Im working my way through an android book and that is exactlly out of the book. I have looked around and tried a few different ways but cant seem to make it open the quizhelp file and display it in the TextView_QuizHelp.
Is there a way to do it within an app without downloading the file first? Somehow stream the text content?
View 1 Replies View RelatedI am very new to android and i have wrote an application that reads the Cell ID information , now i want to create a text file and store the information inside , i have googled this issue but i couldn't find a solution that really worked.
View 2 Replies View RelatedI am new to android.I need to read text file from SDcard and display that text file.Is there any possibility to view a text file directly in android. or else how to read and display the text file ?
View 1 Replies View RelatedI am new to Java and Android. I have a flat file (pipe-delimited) stored in R.raw called word list.text. I want to open this file and quickly search for a word I pass into my procedure. I've been searching for a simple way to do this but not having much luck. Can anyone share some code on how to do this?
View 2 Replies View RelatedSometimes in LogCat I'll see Wrote stack trace to '/data/anr/traces.txt'
But when using the DDMS perspective, "File Explorer" View, I can't see anything in the "data" directory, I'm assuming because permission denied. Is there a way (short of rooting my ion device) to read what's in that text file?
Is there perhaps an android app for developers that will show the contents of the file? It would seem there would have to be some way of reading the file without rooting the device, otherwise why does the o.s. write it out? How can I read this file?
I my android application,i would like to read a text file which is placed on the sdcard. Read the file to search for a string: "some string" and would like to get the value for that string.
Is there any way that i can do that in android.
I have a text file which contains many Chinese characters, and the text file is in the directory res/raw/test.text. I want to read the file but somehow i can't make the Chinese characters display correctly. Here is my code...
What can i do to fix this problem?
I has project in the security of android and haw its safe The doctor ask me to read history of Facebook chat and find the location of my friend from that I fast been rooted my device and copy database file of Facebook chat history and read it in the computer by SQLitviwer program.
Also try to open by any program direct in the phone but I can't finder any program for that except SDK packet and use command line.
My question about command that use to root android using SDK and open history file of Facebook chat in my Galaxy S.
Witch command I can use for that? Its same command use in DOS ?
I am trying to revive white Pandigital using ADB commands to push files on the system's folder of the device then flashing them.
The computer sees the device, adb has root access, yet when trying to push files is gives me an error indication that the system/data/midc is a read only. tried adb remount over and over with no lick. Is there any other way to get to write on the system folder?
i tried to create the odin ready pack of stock rom of galaxy y duos lite but splitfus is not supported for my cell phone. create the odin ready pack for S5302.. i am getting an error that unable to read the input file..
View 3 Replies View RelatedI get as far as being able to push su and busy box but get "failed, read file system only" or "directory doesn't exist".
model PMID700
Android version 2.3.1
kernel version 2.6.32.27
build number 20110918.170336
Firmware version 2.2
I just loaded the Android Update on my tablet. Why when I opened my email file all of my emails were removed from the emial file. where did they go?
View 1 Replies View Relatedi've rooted my vodafone 858 but it didn't install super user although i can type "su" command in adb shell. now i'm trying to delete files located in /mnt/asec (downloaded packages) due to low phone memory. so i tried to do it but when i do the command "rm" for files located in there it tells me permission denied so i entered super user mode and i tried "rm" it tells me "unable to chmod <path> read-only file system" so how can i get past the read only?
View 2 Replies View RelatedIs there a way to open and edit word file in android and if this application exist does it has an open API?
View 1 Replies View RelatedI keep getting read only system file error when rooting xperia j. How to rewrite the file system ??
adb cannot push SU into my xperia ..
I had extract surces files from an .apk application and I'd like to open XML files in the folder "res".I import it in eclipse but i obtain this message: "No XML content. Please add a root view or layout to your document."
View 5 Replies View RelatedI developed a cramfs rom for the np7 after user dochoppy found root for the nextbook premium 7 tablet, but he then converted to ext3 which because its packed with features will be more popular. So I am trying to edit his ext3 rom in Ubuntu 11.10 and here is what I do:
1. Copy and paste system.img to desktop
2. Create a folder called system on desktop
3. In command prompt:
cd ~/Desktop
Sudo mount -t ext3 -o loop system.img system
(Asks for pw)
4. Doc said something about only being able to edit as root, so after some Googling I find out how to create a program that grants root.
5. (Open "run as" program) then I type "nautilus /home"
(Asks for pw)
6. Navigate to mounted system and I have read/write privileges (but only in this window)
7. View the system mount properties, and it says I have 14.2 mb free space on device
8. Delete files throughout the system folder to make room (but when I refresh properties, free space increase doesn't show)
9. Try to add my own files after deleting some others, ans rather than using the increased space, it just fills the fourteen megs before telling me "device is out of memory "
why is the system not physically making the proper system increase and decreases.
I have a android tablet and I have tried rooting it and I get things like "read only file system" and I looked into it and my /system is read only.. Rooting is putting .su in the xbin or bin inside of the /system. But my /system is read only so i can't root my tablet?
View 2 Replies View RelatedWhenever I try to install the plugins (clicking on for example libGLEMU_QUALCOMM.zip), I get the following:
Plugin
ERROR
Could not open ZIP file
Can this be fixed?
I'm running Gingerbread 2.3.6 and a MTK6575.
I want to edit some files in a recovery.img file but i cant open the .img file. How to open .img files?
GT-I9001
I am getting this error when installing rom "bad zip file" then the installation stops. I will use something like Odin to install my Rom.
HTC Explorer A310e