我编写了我的应用程序,以便它具有一些它更喜欢的功能,但不需要,因为我希望我的应用程序可用于所有设备.在我的清单中,我已经设定:
<uses-feature android:name="android.hardware.screen.PORTRAIT" android:required="false" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-feature android:name="android.hardware.LOCATION" android:required="false" />
<uses-feature android:name="android.hardware.location.GPS" android:required="false" />
<uses-feature android:name="android.hardware.MICROPHONE" android:required="false" />
Run Code Online (Sandbox Code Playgroud)
当我上传我的apk文件时,Google Play仍然坚持要求人像,位置,GPS和麦克风功能.不再需要电话.对于发生了什么的任何想法?
我有一个大文件,有180万行数据,我需要能够读取我正在编写的机器学习程序.数据当前是CSV文件,但显然我可以根据需要将其放在数据库或其他结构中 - 它不需要定期更新.
我目前使用的代码如下.我首先将数据导入数组列表,然后将其传递给表模型.这是非常慢的,目前只花了六分钟执行前10,000行,这是不可接受的,因为我需要能够经常测试不同的数据对数据.
我的程序只需要访问数据的每一行,因此不需要将整个数据集保存在RAM中.我最好是从数据库中读取数据,还是有更好的方法逐行读取CSV文件但是更快?
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
public class CSVpaser {
public static TableModel parse(File f) throws FileNotFoundException {
ArrayList<String> headers = new ArrayList<String>();
ArrayList<String> oneDdata = new ArrayList<String>();
//Get the headers of the table.
Scanner lineScan = new Scanner(f);
Scanner s = new Scanner(lineScan.nextLine());
s.useDelimiter(",");
while (s.hasNext()) {
headers.add(s.next());
}
//Now go through each line of the table and add each cell to the array list
while (lineScan.hasNextLine()) { …
Run Code Online (Sandbox Code Playgroud)