结果:

GetTempFileName:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/tmp/tmp.iQIip24407

GetTempPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/tmp

GetHomePath:/data/data/com.embarcadero.Project1/files

GetDocumentsPath:/data/data/com.embarcadero.Project1/files

GetSharedDocumentsPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files

GetLibraryPath:/data/data/com.embarcadero.Project1/lib

GetCachePath:/data/data/com.embarcadero.Project1/cache

GetPathRoot:/

GetPublicPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files

GetPicturesPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/Pictures

GetSharedPicturesPath:/storage/sdcard0/Pictures

GetCameraPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/DCIM

GetSharedCameraPath:/storage/sdcard0/DCIM

GetMusicPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/Music

GetSharedMusicPath:/storage/sdcard0/Music

GetMoviesPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/Movies

GetAlarmsPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/Alarms

GetSharedAlarmsPath:/storage/sdcard0/Alarms

GetDownloadsPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/Download

GetSharedDownloadsPath:/storage/sdcard0/Download

GetRingtonesPath:/storage/sdcard0/Android/data/com.embarcadero.Project1/files/Ringtones

GetSharedRingtonesPath:/storage/sdcard0/Ringtones

 unit Unit1;

 interface

 uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.ScrollBox,
FMX.Memo, FMX.Controls.Presentation, FMX.StdCtrls; type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; var
Form1: TForm1; implementation
uses
System.IoUtils;
{$R *.fmx}
{$R *.NmXhdpiPh.fmx ANDROID} procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Lines.Clear;
Memo1.Lines.Add('GetTempFileName:' + TPath.GetTempFileName);
Memo1.Lines.Add('GetTempPath:' + TPath.GetTempPath);
Memo1.Lines.Add('GetHomePath:' + TPath.GetHomePath);
Memo1.Lines.Add('GetDocumentsPath:' + TPath.GetDocumentsPath);
Memo1.Lines.Add('GetSharedDocumentsPath:' + TPath.GetSharedDocumentsPath);
Memo1.Lines.Add('GetLibraryPath:' + TPath.GetLibraryPath);
Memo1.Lines.Add('GetCachePath:' + TPath.GetCachePath);
Memo1.Lines.Add('GetPathRoot:' + TPath.GetPathRoot(TPath.GetCachePath));
Memo1.Lines.Add('GetPublicPath:' + TPath.GetPublicPath);
Memo1.Lines.Add('GetPicturesPath:' + TPath.GetPicturesPath);
Memo1.Lines.Add('GetSharedPicturesPath:' + TPath.GetSharedPicturesPath);
Memo1.Lines.Add('GetCameraPath:' + TPath.GetCameraPath);
Memo1.Lines.Add('GetSharedCameraPath:' + TPath.GetSharedCameraPath);
Memo1.Lines.Add('GetMusicPath:' + TPath.GetMusicPath);
Memo1.Lines.Add('GetSharedMusicPath:' + TPath.GetSharedMusicPath);
Memo1.Lines.Add('GetMoviesPath:' + TPath.GetMoviesPath);
Memo1.Lines.Add('GetAlarmsPath:' + TPath.GetAlarmsPath);
Memo1.Lines.Add('GetSharedAlarmsPath:' + TPath.GetSharedAlarmsPath);
Memo1.Lines.Add('GetDownloadsPath:' + TPath.GetDownloadsPath);
Memo1.Lines.Add('GetSharedDownloadsPath:' + TPath.GetSharedDownloadsPath);
Memo1.Lines.Add('GetRingtonesPath:' + TPath.GetRingtonesPath);
Memo1.Lines.Add('GetSharedRingtonesPath:' + TPath.GetSharedRingtonesPath);
end; procedure TForm1.Button2Click(Sender: TObject);
begin
if TFile.Exists(TPath.GetTempFileName) then
begin
Memo1.Lines.Clear;
Memo1.Lines.Add('存在');
end;
end; procedure TForm1.Button3Click(Sender: TObject);
begin
if not TDirectory.Exists(TPath.GetTempPath + 'NewDirectory') then
TDirectory.CreateDirectory(TPath.GetTempPath + 'NewDirectory');
end; procedure TForm1.Button4Click(Sender: TObject);
var
sFile1: string;
sFile2: string;
begin
sFile1 := TPath.GetTempPath + '123.jpg';
sFile2 := TPath.GetTempPath + '456.jpg';
if not TFile.Exists(sFile1) then
begin
TFile.Copy(sFile1, sFile2);
end;
end; procedure TForm1.Button5Click(Sender: TObject);
var
Files: TStringDynArray;
I: Integer;
begin
if TDirectory.Exists(TPath.GetTempPath + '/temp/') then
begin
Files := TDirectory.GetFiles(TPath.GetTempPath + '/temp/');
for I := to high(Files) do
begin
TFile.Delete(Files[I]);
end;
end;
end; end.

Android实例-路径信息及文件和文件夹的操作(XE8+小米2)的更多相关文章

  1. Android实例-使用电话拨号器在移动设备上(官方)(XE8+小米2)

    源文地址: http://docwiki.embarcadero.com/RADStudio/XE5/en/Mobile_Tutorial:_Using_the_Phone_Dialer_on_Mob ...

  2. Android的路径信息[转]

    Delphi早就把IO相关的都提取到System.IoUtils单元中了. 路径操作就使用TPath的方法都很方便.usesSystem.IoUtilsTPath.GetTempPath//临时目录T ...

  3. Delphi处理Android的路径信息

    路径操作就使用TPath的方法都很方便.usesSystem.IoUtilsTPath.GetTempPath//临时目录TPath.GetCameraPath//照相机目录(照片/录像)TPath. ...

  4. matlab 重命名文件和文件夹

    1.查看文件存在  dir() 若存在,返回文件信息      dir(‘test.txt’) %查看当前目录是否存在test.txt文件 dir(‘C:\test.txt’) %查看指定目录是否存在 ...

  5. Android根据文件路径使用File类获取文件相关信息

    Android通过文件路径如何得到文件相关信息,如 文件名称,文件大小,创建时间,文件的相对路径,文件的绝对路径等: 如图: 代码: public class MainActivity extends ...

  6. C# 对包含文件或目录路径信息的 System.String 实例执行操作

    在字符串操作中有一类比较特殊的操作,就是对包含文件或目录路径信息的 System.String 实例执行操作.比如根据一个表示路径的字符串获取其代表的文件名称.文件夹路径.文件扩展名等.在很多时候,我 ...

  7. android--------根据文件路径使用File类获取文件相关信息

    Android通过文件路径如何得到文件相关信息,如 文件名称,文件大小,创建时间,文件的相对路径,文件的绝对路径等. 如图: public class MainActivity extends Act ...

  8. 使用任意的输入流(InputStream)实例,包括字符串形式的文件路径或者 file:// 的 URL 形式的文件路径来配置

    mybatis – MyBatis 3 | 入门 http://www.mybatis.org/mybatis-3/zh/getting-started.html 从 XML 中构建 SqlSessi ...

  9. Android学习路径(两)项目文件本身使用场景和文件演示

    ios讨论群1群:135718460  1.src文件:java源码存放文件夹 2.gen 文件:自己主动生成全部由android开发工具自己主动生成的文件,文件夹中最重要的就是R.java文件,这个 ...

随机推荐

  1. linux网络环境配置

    第一种方法: (red hat) (1)用root身份登录,运行setup命令进入到text mode setup utility 对网络进行配置,这里可以进行ip,子网掩码,默认网关,dns的设置. ...

  2. nginx配置负载均衡与反向代理

    #给文件夹授权   1 chown -R www:www /usr/local/nginx #修改配置文件vim nginx.conf   1 2 3 4 5 6 7 8 9 10 11 12 13 ...

  3. Android TextView结合SpannableString使用

    super.onCreate(savedInstanceState); TextView txtInfo = new TextView(this); SpannableString ss = new ...

  4. Java对象相关元素的初始化过程

    1.类的成员变量.构造函数.成员方法的初始化过程 当一个类使用new关键字来创建新的对象的时候,比如Person per = new Person();JVM根据Person()寻找匹配的类,然后找到 ...

  5. mysql concat和group_concat

    mysql concat(str1,str2...)连接两个字符串,(数字也是可以的,会转成字符串) MySQL的concat函数在连接字符串的时候,只要其中一个是NULL,那么将返回NULL mys ...

  6. php 23种设计模式的趣味解释

    http://wenku.baidu.com/link?url=GwvuvSOdJneZQc-DSKoGmPcxTtzn3cdtIp3fRaCNbkg1zJDZZZTx2NwEK5IsqU996fG3 ...

  7. NPAPI插件开发

    1.插件是什么 插件是一种遵循一定规范的应用程序接口编写出来的程序.插件必须依附于一个宿主程序,为宿主程序提供增强功能.插件的种类有很多,这里主要讨论浏览器插件. IE下利用OLE和COM技术开发的浏 ...

  8. IMX51启动模式

    相关链接: http://blog.csdn.net/kickxxx/article/details/7236040 http://blog.csdn.net/evilcode/article/det ...

  9. 【HDOJ】4605 Magic Ball Game

    思路1:树状数组+离线处理,对所有的w离散化处理,边dfs边使用树状数组更新左右w的情况.思路2:主席树,边bfs边建树.结点信息存储cnt,然后在线查询.树状数组. /* 4605 */ #incl ...

  10. poj2823

    这是一道题意简单,数据较大的题(喜闻乐见): 一开始可能会想到RMQ问题,ST,线段树都是O(nlogn),应该勉强能过(没试过): 由于这道题区间是滚动连续的,所以,可以使用单调队列! 以最小值为例 ...