Is it possible to share an xml file on the network? - android

In my Android application, I want my app to make an xml file available for download for anyone else in the network with HTTP GET. For example if my Android device's ip address is 192.168.6.54, other devices can download "http://192.168.6.54/file.xml". Is this possible?
I'm developing in Xamarin.Forms, but I don't think that's important. An answer concerning only Android would be great.

Related

test server for upload files - android

I am using retrofit library in my android app. I read multiple tutorial about upload and download files and working with json data. most of these tutorial have worked with image for simplicity and there is some API for working with that like imagur, but I want to work with audio files in my app and I don not know any server or API for testing upload and download mp3 files. can anybody introduce me some of that?
update :
How can I make my own computer for testing? is this possible?
There are so many Linux servers and which are free. Try https://www.hostinger.in/
for free domains and 1gb disk size.
Furthermore, if you want to test on your own computer try wamp,xampp or IIS (for .NET) and publish your code over there.

how can i manage phonegap android online app

i'm beginner developer of phonegap android application developer. i'm in confusion. i want to make a photo gallery that work online(with internet). 1st: how can i embed my photo gallery with the application. 2nd: if user connection lost during checking photos there is not show the my app url (could not find URL http://www.domain.com/app/index.php) after connection lost it will go to on default error page of no internet connection.
my online application is in php how can i iframe that app in my native application.
phonegap android application developer help me. i'm very thankful to you for this.
Phonegap is not really a way to embed a full application inside an app. The app itself is its own website (sort of).
Your best direction is to create a PHP page on your sever that outputs an XML or JSON file of the images you are going to show THEN create a custom application using HTML / Javascript that pulls in the XML/JSON and parses it into your app. For best practise you should cache or store said files locally for when the device isn't connected to the network.

HTML5 Android Phonegap Web app not working offline with cache manifest

I have a simple web app built with Phonegap and Android that call external ressources (js, css, html) from server instead of storing it in Phonegap assets folder. I prefer using external ressources because my server can deliver html pages taking in charge internationalization.
This web app work fine on my android device when WIFI is on but it fail when stopping WIFI. My index.html file delivered by my server contain a valid manifest file with correct mimetype ('text/cache-manifest') that list every files the app need to work.
My Android Activity class is supposed to have caching enable:
this.appView.getSettings().setDomStorageEnabled(true);
this.appView.getSettings().setAppCacheMaxSize(1024 * 1024 * 15);
String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
this.appView.getSettings().setAppCachePath(appCachePath);
this.appView.getSettings().setAllowFileAccess(true);
this.appView.getSettings().setAppCacheEnabled(true);
It may worth mentionning that my app use ajax call with urls like /aaa/bbb/ to call web pages from server and I don't know if that may be the problem (l'm not calling physical pages directly like index.html)... However, this web app work well in desktop browser (Google Chrome) when offline...
Any idea what more can I do to enable this HTML5 cache feature on my Phonegap app?
Thanks a lot
After playing around for a while I get it to work. Here is some points you should verify when stucked with this type of caching problem:
Take care about url parameters passed with GET method... I was passing parameters when navigating between pages of my app and those parameters was making my urls different from the ones in manifest file making cache to fail.
When testing offline mode on my phone, I was only shutting down the WIFI thinking this was enough to trigger cached version of my app but it was not... As I was testing my app published under a local network IP (like 192.168.2.11), it appear that my app was trying to reach that IP trough the 3G network that was still ON... So use airplane mode when testing offline.
Not sure if this one was necessary as I read it on some others threads but I renamed my manifest file to cache.manifest.
Regards
Apparently you need "to fix the Android Shell Native App to enable HTML5 caching".
If you haven't already, please check out: http://tmkmobile.wordpress.com/2012/03/04/html5-offline-solution/
I am developing a similar system. What I did was I created the Phonegap webpages and stored them in the www folder of my WAMP server. Then what I do is I basically super.LoadURL("insert_ip_address_here/insert_name_of_folder_where_webpage_is_located") in the onCreate method and this loads the phonegap application perfectly (yes all you need is just only line of code in the Android app itself). However you still have to make sure that the config.xml, manifest and all configurations needed for phonegap are properly done (for instructions on this see https://www.adobe.com/devnet/archive/html5/articles/getting-started-with-phonegap-in-eclipse-for-android.html).
Let me know if this the path you choose to pursue. I can provide extra support with things like making the ip-address (in the line super.loadurl(...)) dynamic for the local system using multi-casting, etc.

Accessing android phone sdcard through pc browser

I am a newbie to android. I need to develop an application in which I can access my android phone sd card from my pc's browser by just using the ip address generated from my phone.
I got Ip address but couldnt find any example for this. Please if any one has any example or any knowledge please reply. I am in urgent need of it.
Thank you in advance.
KNOWLEDGE GROWS BY SHARING....
Its no simple thing. You need to implement something like an FTP server on your phone. Or a samba server.
Failing that you can download one of the apps that already provide you with a samba server.
Edit: You'd probably do well looking at something like swiftp.
Application of your really interesting. You can download application wifiFileExplorer then translate reverse to get source reference.
Link: http://www.mediafire.com/?7tyvrvh26ekwwxe
You can download application wifiFileExplorer then translate reverse to get source reference
it's not possible

How to access activity information

I am Android beginner so please forgive if the question might sound silly. I had an app idea where a youtube video or a web page open on a smartphone could be transferred to the laptop screen by detecting a particular forward phone motion-gesture. But to program something like that, I realized that I need to have access to the browsers web page or the video URL which the youtube app is playing. With some initial research it seems to me that the Android system doesn't keep that piece of information. Am I correct?
The end solution seems to me to code up my own browser or maybe enhance an existing open source one. I looked into the possibility of accessing the temporary files on the phone through my program but the location /data/data seems accessible only to root I guess. Also I intended my app to run as a background service so that I could later expand the idea to other places like transferring and opening PDF file on a laptop etc in a similar fashion. Is there a way around where I can access similar information from a running application?
for showing a youtube video , check this one out:
http://code.google.com/p/android-youtube-player/
also , isn't it easier to transfer the url alone to the other device instead of sending the entire video?
you could do this in multiple ways : bluetooth , wifi , qr code ,usb , morse , ... the possibilities are countless .
about accessing other apps data , the app must provide it to you in some way , since all apps are protected from each other (using sandboxing) . for youtube , you can "listen" to youtube urls (via intent filter) for allowing the user to choose your app instead of youtube app (or any other app that listens to it) .
about /data/data , this is correct , only rooted devices can reach it , or your own app if all you do is access your own folder (which is /data/data/YOUR_APP_PACKAGE_NAME) .you can also reach this folder on an emulator .
it's also quite easy to root your device . even novice users can do it via a third party app . here's something that worked for me on both galaxy S and galaxy S2 :
http://www.unlockroot.com/

Categories

Resources