How do I get an XML file onto an iPhone or Android?

I am planning on writing an app for the iPhone and Android and need to make it read data from XML. I want to make is simple to transfer the XML files from phone to phone. And from computer to phone.

How do I do this?

Thanks.
newbiewebSr. Software EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

simonetCommented:
there are so many options, it is hard to begin!

One way is to use bluetooth to copy the file to/from devices and PCs.

ADB is surely another way, but I doubt most users know how to use it.

Another way, which is fancier, is to use cloud services to share the file. Load the file to Dropbox.com or box.net and load the XML file from there.

If you have a server on the web, you can load the XML file from a URL, which is even more straightforward.
grayeCommented:
Are you asking how to perform the transfer of the XML file from within your application?....  or are you asking how a user might perform that transfer "by hand"?
newbiewebSr. Software EngineerAuthor Commented:
I am trying to come up with a list of various ways to get an XML file from one's PC to his/her iPhone or Android. Cable or Bluetooth work for that.

What is ADB?

I like the sound of Cloud Services. I will check that out.

I also would like to investigate making the transfer from my iPhone/Android application so the XML is sent to another iPhone/Android running the application. How might that work?

Lastly, how about if the XML is created on my website, and needs to be transferred to their iPhone?

Thanks.


Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

simonetCommented:
>>Lastly, how about if the XML is created on my website, and needs to be transferred to their iPhone?

That is the best method, if you have a server on the web.

Whenever you need to reference the XML file, instead of using "file://" as the URI, use "http://". That way your program (be it Android or iPhone), will download the file from the internet instead of fetching it locally.

Optionally you can save the file locally for offline usage. Save somewhere the info of how old the file is. If it is older than xx days, you notify the user and let him download a fresh copy from the web. If your application requires the user to always have a fresh copy of the XML file, let the user know that a data connection will be initiated (if not on already) and download the file.

ADB is Android Debug Bridge, which is part of the Android SDK. If you're planning on doing some Android Development, sooner or later you'll have to deal with the ADB. If has commands that allow you to sent/get files to/from your Android device easily. However, it is a tool (a collection of tools, actually) ment for developers, not for end users.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
newbiewebSr. Software EngineerAuthor Commented:
> Whenever you need to reference the XML file, instead of using "file://" as the URI, use "http://". That way your program (be it Android or iPhone), will download the file from the internet instead of fetching it locally.

How would my program on the iPhone know the files exists? Plus, I want the file to reside locally on the iPhone.

How would the iPhone app know to download the file, if it were created on the server?

Is the following a solution?

1) Allow the iPhone user to register online (via the web), and update my iPhone app with the login information.
2) Have a dedicated folder on the server for each registered user, containing each of the XML files creatwed by that user.
3) When a registered user starts the iPhone app, it synchronizes the folder on the server with the local XML folder (for my app) on the phone.
simonetCommented:
Hi. Sorry for my delay.

I know nothing about iOS development, so I can't help you with questions regarding iPhone.

OTOH, on the Android, there is a File.Exists() function.
newbiewebSr. Software EngineerAuthor Commented:
Thanks.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
XML

From novice to tech pro — start learning today.