• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

parse KML list files on android

Good evening I'm facing a problem in my code. I would like to parse a set of kml file to extract the contents and put it in bae of data. it returns each time the list of files, but not the contents of each file. Please help me

Here my MainActivity.java file content :


public class MainActivity extends AppCompatActivity {

private TextView txt;

private TextView texte;
ListView listView;
private List<String> fileNameList;
private FlAdapter mAdapter;
private File file;

@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
== PackageManager.PERMISSION_GRANTED){
//FetchImages();
listView = (ListView) findViewById(R.id.listView);
file = Environment.getExternalStorageDirectory();
fileNameList = getFileListfromSDCard();
mAdapter = new FlAdapter(this, R.layout.mylist, fileNameList);
listView.setAdapter(mAdapter);

}
else{

ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
}
}
else{
//startActivity(new Intent(getActivity(), SQLite2ExcelActivity.class));
}
}

private List<String> getFileListfromSDCard() {
String state = Environment.getExternalStorageState();
ArrayList<String> filenames = new ArrayList<String>();
String path = Environment.getExternalStorageDirectory()
+ File.separator + "Fodecc_csv";

File directory = new File(path);
File[] files = directory.listFiles();


for (int i = 0; i < files.length; i++)
{
if(files.isFile() && files.getPath().endsWith(".kml")){
String file_name = files.getName();

// you can store name to arraylist and use it later
filenames.add(file_name);

XmlPullParserFactory parserFactory;

try {

parserFactory = XmlPullParserFactory.newInstance();

XmlPullParser parser = parserFactory.newPullParser();

//File file = new File("/storage/emulated/0/Kml.kml");
InputStream is = new FileInputStream(file_name);
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);

parser.setInput(is, null);



processParsing(parser);

//InputStream is = getAssets().open("kml.xml");



} catch (XmlPullParserException e) {



} catch (IOException e) {

}

}

}
return filenames;
}

private void processParsing(XmlPullParser parser) throws IOException, XmlPullParserException{
ArrayList<coordonnees> coordo = new ArrayList<>();

int eventType = parser.getEventType();

coordonnees currentcoordo= null;



while (eventType != XmlPullParser.END_DOCUMENT) {

String eltName = null;



switch (eventType) {

case XmlPullParser.START_TAG:

eltName = parser.getName();



if ("Placemark".equals(eltName)) {

currentcoordo = new coordonnees();

coordo.add(currentcoordo);

} else if (currentcoordo != null) {

if ("name".equals(eltName)) {

currentcoordo.name = parser.nextText();

}

}

break;

}



eventType = parser.next();

}



printcoordo(coordo);
}

private void printcoordo(ArrayList<coordonnees> coordo) {
StringBuilder builder = new StringBuilder();



for (coordonnees Placemark : coordo) {

builder.append(Placemark.name).append("\n");

}

txt = (TextView) findViewById(R.id.te);


txt.setText(builder.toString());
}

}

  • Poll Poll
BEST MOST STABLE PIE (ANDROID 9) ROM's FOR ZTE ZMAX PRO

Which is your favorite of the 2

  • Pixel Experience

    Votes: 0 0.0%
  • Lineage

    Votes: 1 100.0%

https://androidfilehost.com/?fid=6006931924117909218

PixelExperience_urd-9.0-20190704-2042-UNOFFICIAL.zip
for the ZTE Zmax Pro(Z981), by Loonycgb2

Nice system UI but slow
FAST NETWORK
flashlight works
No camera but it's worth it, I have a twrp back up of 14.1 by armandopartida0 if I need my camera.


https://androidfilehost.com/?fid=6006931924117895988

lineage-16.0-20190615-UNOFFICIAL-urd.zip
for the ZTE Zmax Pro(Z981), by Loonycgb2

For me this is my favorite ❤️ Nice interface with all the perks of LINEAGE.

I also really like LINEAGE 16, our friend Loonycgb2 also made a LINEAGE 16 ROM for our diehard zmax fans who just REFUSE TO UPGRADE TO A NEWER PHONE!

But this is seriously nice and not posted anyware but on androidfilehost.com so give Loonycgb2 some love!!

Interesting issue

I found a brand new game began playing it, a few days ago they updated the app and now it kills a full battery within minutes of using and that's not all... It now puts sucha strain on my Wi-Fi that it actually shuts it off for the entire household... I am an i.t. professional (pc).. Here's my odd question... Is it possible for a dev to create an app that appears as a game but in fact has a more sinister purpose such as accessing your personal information or worse to simply wreck havok with your equipment and if you suspect a dev of doing this is there any way to view the apps code without doing it illegally?

Moisture Detected - Strange daily behavior

Something odd is happening with my Note 10+. Every morning for the past few days I'll pick up my phone and use it for a few minutes and the Moisture Detected message shows up in the notifications bar. I'm positive there is no moisture. I'll reboot and after a couple minutes it goes away, but immediately when it disappears I get a notification that T-Mobile Visual Voicemail could not connect to my voicemail box. It's always at the exact same moment one message is replaced by the other. I can't imagine how they would be related.

Instagram Not Loading

Hi, hope someone can help.

Instagram has stopped working on my son's phone (Samsung Galaxy S3 on kitkat 4.4.4). When you try to open it, the screen goes blank for a second, and then it goes back to the homepage.

I have done the following;

- Restarted phone.
- Cleared cache and data.
- Uninstalled / reinstalled the app.
- Googled the problem (only solutions I can find are the ones above).

Is there anything else I can be trying? I wondered if IG had updated and the current version doesn't work on older Android, in which case, is there a way to roll back to an earlier version?

Thanks in advance!

Help Cannot see zip file in Bluestacks Media Manager

Hi folks, new here.

A problem i am experiencing is, i use Viber, and i archive my messages, and it creates a zip file in Viber. However, i don't see it in Media Manager. The previous time it worked.

I have no idea what's going on. Exporting to windows is the easy part. Having it appear in Media Manager, that's a different story.

Please assist
Thanks in advance

Bad connection

Been with Verizon for years. Connectivity has never been an issue. I show good connection...until I leave settings and choose either an app or site I've Googled.
Verizon prepaid, new phone number and phone. I'm afraid it's this phone. Orbic Wonder&#128580;. Only other time this has happened to me was a Boost account and the APN settings were outdated. Unfortunately Verizon doesn't allow a poor dumb customer to alter or add an APN. Any advice?

favorite cooking gadgets

so since this is a tech site, i'm curious as to what are your favorite cooking gadgets or tech?

right now have been using the Foodi Ninja. it is a all in one cooking apparatus. it can pressure cook, broil, air crisps, bake, and is a slow cooker as well.

this is something, i'm thinking about getting:

Ooni Karu - A Powerful Portable Wood-Fired Pizza Oven


i just need to either find a place to get a great pizza dough or learn how to make one.

Argh...My N10+ factory-reset while in my pocket

So today, Sat. in the p.m. EDT, my vzw N10+ gave itself a factory reset while at peace in my pocket. The same place where I've worn my phone (left or right pants pocket by itself) since my Note 5 days. No recent drops, and in a "rugged" (Samsung) case. I have the accidental touch protection feature enabled. This has never happened before to any cell phone I've ever owned.

I find it would be very unlikely under these conditions that the phone would have gone through whatever number if fingerprint and/or PIN attempts on its own. It was running stock launcher and not rooted.

Should I:
  • Ask vzw for a new one since this baby is only 3 weeks and one day old. Also because this seems very unlikely to happen on its own and I want to minimize the chances of the issue recurring, plus all the work setting it up just right, or,
  • Just say "oh well" and put her back together again and live like it never happened.
Thanks in advance for any sage advice.

Redeye

Transfering Apps from Internal Storage to External doesn't seem to truly be doing such.

I have the option on some apps to transfer them from Internal to External. Thing is, it doesn't seem to actually do this. In fact, when I look on the Internal apps, the app (Let's call the example app FOODGRAZE) is there and when I look on External, it is there too.

When I uninstall it from Internal, it also uninstalled from External leading me to believe FOODGRAZE isn't actually moved to External as the phone claims it is.

When I turn on Developer Option to force Internal to External, this makes no difference either. Same situation.

The whole point to my conundrum is because I only have 64GB Internal storage, I have 150GB External storage.

According to my Storage in settings I have 10GB left.

How can I solve this issue? Would rooting my phone force it to actually be on my External? I don't want to root.. but 64GB isn't anything in this day and age.

I only got a Samsung because my old Samsung tablet actually transferred stuff to the SD card.

But my S9 is not doing this.

Files on phone are invisible in Windows

Hi, just joined to ask this.

I'm having various problems, so I'm looking at my phone in File Explorer. I've learnt (about five minutes ago) that the Emulated/0 folder is only virtual (clue's in the name, eh). Horrible feeling that perhaps I've deleted a lot of photos without meaning to, but haven't given up hope yet... not quite...

1. Is there ANY way of viewing files if the filename begins with "." ?
2. How to find out where a file really is, if it shows as being in emulated/0?
3. Is it possible for a file to be in emulated/0 when it really doesn't exist at all (any longer)?

For example, I can (on the phone) see a picture named foxy.jpg. When I look at its properties, it is in fact .foxy.jpg.

The files in question aren't hidden, but I have hidden files visible both on my file manager app and in Windows. I've tried searching with a wonderful Windows app called Search Everything, but it can't see anything at all on the phone - and it shows the drive as a long string that means nothing to me. (I right-clicked on Internal Storage to open Everything, and it shows the drive as "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#ta93008bxj#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\" - I expected something like "D:\"! And if I browse to select the drive, it doesn't list the phone at all.

Does Windows see the whole phone as virtual? :o

... Back story: I need to free up space on the phone, and have got rid of all apps I can spare, all duplicates, thumbnails, cache, cleared junk, etc etc, everything possible I believe. But it's still over-full as if I hardly deleted anything. So I decided to copy photos and videos to the laptop and then delete them from the phone - did this with all that I could find in File Explorer, but there they still were on the phone at which point I began to feel something supernatural was going on. o_O And the phone's so stuffed full that no apps can update. I know I'm space-greedy, but it has never been this bad before.

Suggestion for Call Blocking App (no one offers this!)

There are -lots- of Call Blocking Apps out there, but for whitelist and blacklist, most require full number (a sprinkling offer partial number for blacklist, but don't work so well). What's needed is something that does this:

1) Is call in contacts? If YES, ALLOW!

2) Is call on Whitelist? (and whitelisted number can be "begins with" so, like 508-863-****) - WHY? Because you might want to allow all calls from your office (and they have direct extension dialing). If yes ALLOW

3) Is call on Blacklist? (and blacklisted number can be "begins with" so, like 508-863-****) - WHY? Because you may know that some calls from certain exchanges are bogus (I don't know anyone who has my exchange, so I want to block it). if YES - REJECT!

4) Is call UNKNOWN (rarely happens today, but), then pass or REJECT as an option.

5) Otherwise - pass or REJECT as an option.

[REJECT = send to VM or hangup as a option.]

This would be a VERY useful app. Could someone PLEASE write this, or mod their app this way? Thanks! I would pay for it :-)
/j

(I have searched in vain for this, but if it exists, please let me know!)

Lock screen display

We just returned from a trip and I noticed something that really puzzled me. We had traveled from Arizona to the Texas Gulf Coast (2 time zone changes) and when I picked up my S10+ in the morning I noticed a different time display. I have the lock display set up to display an analog type of clock with a second hand, and that is what I normally see, but while on the Gulf Coast I saw two digital clock displays next to each other, one with the local time and one with the time at home.

The display was very helpful and I am not complaining, but it was gone when we traveled a bit toward home and were only a single time zone from our local time. Then it was back to a single analog type clock even though we were not in our home time zone.

Can anyone tell me what was going on with the phone?

[Free][Game][4.1+] Falling Mystery

preview-xl.jpg


Hello!
I have released my first casual game and i want know opinions on it.

Features of Falling Mystery:
• Simple gameplay!
• 9 beautiful pixel art 3D maps
• 15 different skins!
• More than 30 levels!
• Normal and level mode.

Gameplay:

In your hands lies the fate of your little pixelated avatar. As it moves daintily across the map, you, its protector, must make sure it doesn’t wander off aimlessly to protect it from falling objects.
Falling Mystery: Hop Hop survival game is a beautiful voxel turf game which takes you to a universe of grassy plains, clear skies, blue waters, and the mysteries beyond the Earth’s atmosphere. Plug in your earphones, listen to the sounds of nature and submerge yourself into the voxel turf universe.
In this survival game, you will get a unique map in the middle of which is a square. This square is the space in which your character, the jumper boy, moves. You must be careful and play safely because you have to avoid the falling blocks! As this is a puzzle game, the move you make matters in how long you will survive. One wrong move and the jumper boy gets crushed from falling objects!
Before the mystery objects start falling from the sky, some of the blocks you stand on will get highlighted. The blocks which get highlighted are those on which the falling objects will fall. You must quickly get the jumper boy to reach a safe block, wait for the objects to fall from the sky, and thus evade danger!
Of mystery games 2019, this game definitely delivers on its genre with different aspects which you will keep on discovering as you play! Move across levels to unlock unique experiences. Collect coins to buy a map from 9 different maps and choose avatars. Discover angels, UFOs, zombies, exploding chickens, and so much more in this endless voxel turf universe!
Turn off the lights in your room, clear your bed, and make sure you are in a stress-free state of mind as you lie down with your phone or tablet and prepare to get lost in the pixel art 3D world of Falling Mystery, a state of the art voxel turf game.
Strategize on how to move puzzle with your jumper boy and hop across maps and levels. Switch things up a bit by changing your character from chickens, old men, and puppies to aliens, zombies, and robots. This strategic move puzzle is surely one of the most promising mystery games 2019. Its breathtaking puzzle art 3D accounts for it being so relaxing and the moves you can play in this survival game make it exciting.
Falling Mystery: Hop Hop survival game will take you on a journey you will not be able to resist. This epic survival game will make you hone your move puzzle skills.
So what are you waiting for? Download one of the best mystery games 2019 now!

Download and view here, https://play.google.com/store/apps/details?id=com.promexgaming.mystery

Filter

Back
Top Bottom