Hi,
I want to access simple txt files that I use to load maps to my game.
I do like this:
input string = "systems\\"+name+".txt"
PHP Code:
public static String[] readFile(String file) {
		ArrayList<String> total = new ArrayList<String>();
		try {
			InputStream fstream = AndroidDashActivity.getThis().getAssets().open(file, AssetManager.ACCESS_STREAMING);
			
			DataInputStream in = new DataInputStream(fstream);
			BufferedReader br = new BufferedReader(new InputStreamReader(in));
			String strLine;
			while ((strLine = br.readLine()) != null) {
				if (!strLine.equals("")) {
					total.add(strLine);
				}

			}
		} catch (FileNotFoundException e) {
			System.out.println("No such file. " + file);
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
		String[] list = new String[total.size()];
		for (int i = 0; i < list.length; i++) {
			list[i] = total.get(i);
		}

		return list;
	}
It prints:
No such file. systems\solar_x2.txt
java.io.FineNotFoundException_ systems\solar_x2.txt
I added the folder systems to the assets folder. Then I added solar_x2.txt.
I'v also checked the apk created and it contains assets\systems\solar_x2.txt
I'v also tried with the string "assets\\systems\\solar_x2.txt", did not work either, so what am I doing wrong?