欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

關(guān)于androidtxt的信息

什么軟件在安卓手機(jī)能打開txt文件

電子書軟件,wps手機(jī)版都可以打開TXT文件,操作方法如下:

成都網(wǎng)站建設(shè)、做網(wǎng)站介紹好的網(wǎng)站是理念、設(shè)計(jì)和技術(shù)的結(jié)合。創(chuàng)新互聯(lián)建站擁有的網(wǎng)站設(shè)計(jì)理念、多方位的設(shè)計(jì)風(fēng)格、經(jīng)驗(yàn)豐富的設(shè)計(jì)團(tuán)隊(duì)。提供PC端+手機(jī)端網(wǎng)站建設(shè),用營銷思維進(jìn)行網(wǎng)站設(shè)計(jì)、采用先進(jìn)技術(shù)開源代碼、注重用戶體驗(yàn)與SEO基礎(chǔ),將技術(shù)與創(chuàng)意整合到網(wǎng)站之中,以契合客戶的方式做到創(chuàng)意性的視覺化效果。

1、首先在手機(jī)上找到并打開WPS。

2、進(jìn)入頁面后,點(diǎn)擊使用選項(xiàng)按鈕。

3、然后在打開的頁面中,選擇所有文件。

4、然后在打開的所有文件頁面中,點(diǎn)選txt,它會自動搜索到文件。

5、此時(shí)文件被打開了的,如下圖所示,就完成了。

android手機(jī)里一堆txt文件可以刪嗎

可以。這里使用的手機(jī)型號為華為H60-L02,其中的具體步驟如下:

1、首先點(diǎn)擊搜索本地文件,如圖所示。

2、然后輸入TXT來搜索,會看到對應(yīng)的結(jié)果,如圖所示。

3、然后根據(jù)實(shí)際情況進(jìn)行選擇,如圖所示。

4、最后即可刪android手機(jī)里一堆txt文件了,如圖所示。

安卓手機(jī)如何打開.txt文件

在安卓手機(jī)上,可以使用電子書軟件、WPS軟件、office軟件打開txt文件的。

Android寫入txt文件

分以下幾個(gè)步驟:

首先對manifest注冊SD卡讀寫權(quán)限

AndroidManifest.xml?

?xml?version="1.0"?encoding="utf-8"??

manifest?xmlns:android="

package="com.tes.textsd"?

android:versionCode="1"?

android:versionName="1.0"??

uses-sdk?

android:minSdkVersion="8"?

android:targetSdkVersion="16"?/?

uses-permission?android:name="android.permission.WRITE_EXTERNAL_STORAGE"/?

application?

android:allowBackup="true"?

android:icon="@drawable/ic_launcher"?

android:label="@string/app_name"?

android:theme="@style/AppTheme"??

activity?

android:name="com.tes.textsd.FileOperateActivity"?

android:label="@string/app_name"??

intent-filter?

action?android:name="android.intent.action.MAIN"?/?

category?android:name="android.intent.category.LAUNCHER"?/?

/intent-filter?

/activity?

/application?

/manifest

創(chuàng)建一個(gè)對SD卡中文件讀寫的類

FileHelper.java?

/**?

*?@Title:?FileHelper.java?

*?@Package?com.tes.textsd?

*?@Description:?TODO(用一句話描述該文件做什么)?

*?@author?Alex.Z?

*?@date?2013-2-26?下午5:45:40?

*?@version?V1.0?

*/?

package?com.tes.textsd;?

import?java.io.DataOutputStream;?

import?java.io.File;?

import?java.io.FileOutputStream;?

import?java.io.FileWriter;?

import?java.io.FileInputStream;?

import?java.io.FileNotFoundException;?

import?java.io.IOException;?

import?android.content.Context;?

import?android.os.Environment;?

public?class?FileHelper?{?

private?Context?context;?

/**?SD卡是否存在**/?

private?boolean?hasSD?=?false;?

/**?SD卡的路徑**/?

private?String?SDPATH;?

/**?當(dāng)前程序包的路徑**/?

private?String?FILESPATH;?

public?FileHelper(Context?context)?{?

this.context?=?context;?

hasSD?=?Environment.getExternalStorageState().equals(?

android.os.Environment.MEDIA_MOUNTED);?

SDPATH?=?Environment.getExternalStorageDirectory().getPath();?

FILESPATH?=?this.context.getFilesDir().getPath();?

}?

/**?

*?在SD卡上創(chuàng)建文件?

*?

*?@throws?IOException?

*/?

public?File?createSDFile(String?fileName)?throws?IOException?{?

File?file?=?new?File(SDPATH?+?"http://"?+?fileName);?

if?(!file.exists())?{?

file.createNewFile();?

}?

return?file;?

}?

/**?

*?刪除SD卡上的文件?

*?

*?@param?fileName?

*/?

public?boolean?deleteSDFile(String?fileName)?{?

File?file?=?new?File(SDPATH?+?"http://"?+?fileName);?

if?(file?==?null?||?!file.exists()?||?file.isDirectory())?

return?false;?

return?file.delete();?

}?

/**?

*?寫入內(nèi)容到SD卡中的txt文本中?

*?str為內(nèi)容?

*/?

public?void?writeSDFile(String?str,String?fileName)?

{?

try?{?

FileWriter?fw?=?new?FileWriter(SDPATH?+?"http://"?+?fileName);?

File?f?=?new?File(SDPATH?+?"http://"?+?fileName);?

fw.write(str);?

FileOutputStream?os?=?new?FileOutputStream(f);?

DataOutputStream?out?=?new?DataOutputStream(os);?

out.writeShort(2);?

out.writeUTF("");?

System.out.println(out);?

fw.flush();?

fw.close();?

System.out.println(fw);?

}?catch?(Exception?e)?{?

}?

}?

/**?

*?讀取SD卡中文本文件?

*?

*?@param?fileName?

*?@return?

*/?

public?String?readSDFile(String?fileName)?{?

StringBuffer?sb?=?new?StringBuffer();?

File?file?=?new?File(SDPATH?+?"http://"?+?fileName);?

try?{?

FileInputStream?fis?=?new?FileInputStream(file);?

int?c;?

while?((c?=?fis.read())?!=?-1)?{?

sb.append((char)?c);?

}?

fis.close();?

}?catch?(FileNotFoundException?e)?{?

e.printStackTrace();?

}?catch?(IOException?e)?{?

e.printStackTrace();?

}?

return?sb.toString();?

}?

public?String?getFILESPATH()?{?

return?FILESPATH;?

}?

public?String?getSDPATH()?{?

return?SDPATH;?

}?

public?boolean?hasSD()?{?

return?hasSD;?

}?

}

寫一個(gè)用于檢測讀寫功能的的布局

main.xml?

?xml?version="1.0"?encoding="utf-8"??

LinearLayout?xmlns:android="

android:layout_width="fill_parent"?

android:layout_height="fill_parent"?

android:orientation="vertical"??

TextView?

android:id="@+id/hasSDTextView"?

android:layout_width="fill_parent"?

android:layout_height="wrap_content"?

android:text="hello"?/?

TextView?

android:id="@+id/SDPathTextView"?

android:layout_width="fill_parent"?

android:layout_height="wrap_content"?

android:text="hello"?/?

TextView?

android:id="@+id/FILESpathTextView"?

android:layout_width="fill_parent"?

android:layout_height="wrap_content"?

android:text="hello"?/?

TextView?

android:id="@+id/createFileTextView"?

android:layout_width="fill_parent"?

android:layout_height="wrap_content"?

android:text="false"?/?

TextView?

android:id="@+id/readFileTextView"?

android:layout_width="fill_parent"?

android:layout_height="wrap_content"?

android:text="false"?/?

TextView?

android:id="@+id/deleteFileTextView"?

android:layout_width="fill_parent"?

android:layout_height="wrap_content"?

android:text="false"?/?

/LinearLayout

就是UI的類了

FileOperateActivity.class?

/**?

*?@Title:?FileOperateActivity.java?

*?@Package?com.tes.textsd?

*?@Description:?TODO(用一句話描述該文件做什么)?

*?@author?Alex.Z?

*?@date?2013-2-26?下午5:47:28?

*?@version?V1.0?

*/?

package?com.tes.textsd;?

import?java.io.IOException;?

import?android.app.Activity;?

import?android.os.Bundle;?

import?android.widget.TextView;?

public?class?FileOperateActivity?extends?Activity?{?

private?TextView?hasSDTextView;?

private?TextView?SDPathTextView;?

private?TextView?FILESpathTextView;?

private?TextView?createFileTextView;?

private?TextView?readFileTextView;?

private?TextView?deleteFileTextView;?

private?FileHelper?helper;?

@Override?

public?void?onCreate(Bundle?savedInstanceState)?{?

super.onCreate(savedInstanceState);?

setContentView(R.layout.main);?

hasSDTextView?=?(TextView)?findViewById(R.id.hasSDTextView);?

SDPathTextView?=?(TextView)?findViewById(R.id.SDPathTextView);?

FILESpathTextView?=?(TextView)?findViewById(R.id.FILESpathTextView);?

createFileTextView?=?(TextView)?findViewById(R.id.createFileTextView);?

readFileTextView?=?(TextView)?findViewById(R.id.readFileTextView);?

deleteFileTextView?=?(TextView)?findViewById(R.id.deleteFileTextView);?

helper?=?new?FileHelper(getApplicationContext());?

hasSDTextView.setText("SD卡是否存在:"?+?helper.hasSD());?

SDPathTextView.setText("SD卡路徑:"?+?helper.getSDPATH());?

FILESpathTextView.setText("包路徑:"?+?helper.getFILESPATH());?

try?{?

createFileTextView.setText("創(chuàng)建文件:"?

+?helper.createSDFile("test.txt").getAbsolutePath());?

}?catch?(IOException?e)?{?

e.printStackTrace();?

}?

deleteFileTextView.setText("刪除文件是否成功:"?

+?helper.deleteSDFile("xx.txt"));?

helper.writeSDFile("1213212",?"test.txt");?

readFileTextView.setText("讀取文件:"?+?helper.readSDFile("test.txt"));?

}?

}

網(wǎng)站名稱:關(guān)于androidtxt的信息
網(wǎng)站URL:http://chinadenli.net/article44/dsdegee.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站建設(shè)、網(wǎng)站制作網(wǎng)站收錄、網(wǎng)站改版全網(wǎng)營銷推廣、小程序開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運(yùn)營