Okay here is what I am trying to do.
I have code that generates a manifest.txt file that contains all the app names and activity names for the apps on that users device.
Here is the java code that is generating that file within my android app
final StringBuilder manifest = new StringBuilder();
final File manifest2 = new File(Environment.getExternalStorageDirectory() + File.separator + "MyFolder" + File.separator + "manifest.txt");
manifest2.createNewFile();
name = info.loadLabel(packageManager).toString();
activity = info.activityInfo.packageName + File.separator + info.activityInfo.name;
manifest.append(String.format(name) + "," + String.format(activity) + "\n");
FileOutputStream fOut = new FileOutputStream(manifest2);
OutputStreamWriter myOutWriter = new OutputStreamWriter(fOut);
myOutWriter.append(manifest);
myOutWriter.close();
fOut.close();
Then i have this code to send that file to my PHP
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
MultipartEntity entity = new MultipartEntity();
try {
File myFile = new File(Environment.getExternalStorageDirectory() + File.separator + "MyFolder" + File.separator + "manifest.txt");
FileBody fileBody = new FileBody(myFile);
entity.addPart("file", fileBody);
httppost.setEntity(entity);
HttpResponse response = httpclient.execute(httppost);
Here is my problem and question.
I dont know how to write the PHP script to get this to my SQL table
Also, Should i be doing this a different way? Should i be sending the name and activity to different array's then POST via PHP to my SQL?
I just need to be able to get all the names and activities from the users device to my SQL table.
Thanks for any advice.