在 iOS 上,我使用这些代码行来存储一个大字符串(JSon)......我如何在 Android 上做同样的事情?放置该字符串的文件位置是什么?谢谢
NSArray *paths = NSSearchPathForDirectoriesInDomains
(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
//make a file name to write the data to using the
//documents directory:
NSString *fullFileName = [NSString stringWithFormat:@"%@/subscriptions", documentsDirectory];
[dataReply writeToFile:fullFileName atomically:NO];
并直接保存数组?像这样?
fullFileName = [NSString stringWithFormat:@"%@/specialElements", documentsDirectory];
[NSKeyedArchiver archiveRootObject:specialElements toFile:fullFileName];
specialElements 是一个 NSMutableArray