Pulling information from a website for an app? - Android Software Development

I am trying to develop a certain program that needs to access a website and pull information that will then be displayed within my app(with credits of course, its from a open source text domain).
Is there a simple way to do this?
Its all text based data.

Neet to do a HttpClient request to web site and "getContent". HINT...Google it

^what he said. You can also use the org.apache classes.
But the most dead simple way to get a website in your app is to use a WebView. But that will just display the content as is, not sure if you want that, or to get the data to manipulate....

If you want to parse data from the httpresponse, then I think you can check out Jsoup...its very easy to parse a html page for extracting the data via Jsoup!
I guess webview doesn't support javascript...so make sure before using that in your app!
Sent from my GT-I5800 using XDA App

Related

API to URLy the URL shortener

Hello
I just released v0.9.2 of URLy and it now comes with a simple API that can be used by other app developers to shorten a long URL via URLy.
So, if you are a developer and want to shorten a URL in your own app, but don’t want to go through all the hassle of writing the necessary code yourself, you can just pass the URL to URLy via an intent. URLy will shorten it with the service that you passed along and your app will receive a boolean to indicate whether the shortening process was successful or not, the short URL and, if any errors occurred, a detailed error message about what went wrong.
Why would anyone integrate URLy in his own app? Well, there are several situations in which this makes sense. For example, imagine you write a Twitter app and want to allow your users to shorten URLs. You could write the code to shorten the URL by yourself, or you could just pass the long URL to URLy. You can pass along the service you want to use (you can use about 20 services via URLy, like bit.ly, goo.gl or TinyURL), so you could even give your users the choice to use any service they prefer or provide a custom URL and / or user credentials so that they can keep track of their shortened URLs. And: The integration into your app is pretty much seamless. After calling the intent, a nice and small progress window is shown which disappears automatically after shortening. So, no annoying new window that the users will have to close – they never leave your app.
Take the following screenshot as example. The app in the background is supposed to be your app, the progress window is what URLy shows while shortening:
(sorry, I'm not allowed to post any images, yet, will update as soon as I can)
More information and a detailed code example of how to start the intent and receive the shortened URL are available on my blog in the API section. It's really simple and integrated in a few minutes.
General information about URLy is available in this forum or on my blog. Unfortunately, I still can't post any outside links, so please write me a personal message and I send you the links.
If you have any questions, don't hesitate to ask.

Android Web App

Hello everyone. I'm new to Android app development but I'm not new to web development. I was searching around and I found that I could do an "offline" web application. Since I'm new and can't post links, there is an example that can be found on Linux Mag. The article is called "Under the Hood of Native Web Apps for Android" and it's specific to offline app development. I'm looking for help with an ONLINE application using PHP/MySQL/AJAX using my web server to host the app - minus having to use the phone's browser.
I know you can do "web apps" for the iPhone (such as Google Voice) and I was wondering if I could do it with Android (unlike in the example from Linux Mag where the app is "offline", mine needs to be online). Any information would be appreciated as I keep turning up dry search results. Thanks very much!
This is not any of a problem with android (or java in general)
I'm just gonna give you a few catchwords & links:
Apache (Default)HttpClient - Pretty straight-forward-to-use HttpClient - http://developer.android.com/reference/org/apache/http/impl/client/DefaultHttpClient.html
AsyncTask - A pretty simple way to fetch data asynchronously (meaning you wont actually block your app while loading data) - http://developer.android.com/reference/android/os/AsyncTask.html.
If your source-data is being delivered as xml you can use sax-parsers for json u can use org.json which is also built into standard android - http://developer.android.com/reference/org/json/package-summary.html
And finally a hint from my side if you're new to android application development... care about rotation-handling from the very begining of application development. You will regret later on if u didn't .

App Developer Bidding

Is there a website where you post what you want and developers bid to do the work? I've used similar services before for html / php / java and was wondering if it was available for android apps???
sites like guru.com and rentacoder.com you may be able to find people.
Do you mind explaining the project"s" your looking at having done. Might find some people here who will be able to help and assist
I thought i saw something similar on www.anddev.org
Sluzpuppet said:
sites like guru.com and rentacoder.com you may be able to find people.
Do you mind explaining the project"s" your looking at having done. Might find some people here who will be able to help and assist
Click to expand...
Click to collapse
Here is my thought (remember, I'm not a developer):
A super basic app: a single icon (like wifi tether) that opens a predefined url that has users info appended to the end as arguments, see example below:
Code:
mydomain,com/page.php?name=mike&id=1234&color=blue
Users info are just text fields with no validation and are setup from the menu button.
This would be a customizable app. A person could modify the app by adding (changing) three files
icon image
url.xml - contains the base url and perhaps the app name
user.xml - contains the users data fields
above example users.xml would add 3 setup fields for name, id, color
by changing the url xml file, you could setup app to piont to any domain
by changing the users.xml, you could setup any number of arguments
by changing icon, app image would match users preference
Ideally it would be best if it could have multiple occurances of the app (maybe just app name being different would work) because I may want it for mydomain.com any you may want to use it for yourdomain.com
Hope this makes sense.

[Q] Newbie question for best Android coding practices

Hi,
A year ago I developed an app as part of a group project at uni. Due to the limitations set by the project rules the app isn't properly designed for Android. The app is a tour guide, in 2 parts. The guide itself is an XML file which has all the content on it. The other part is the player, which is an Android app. The player parses the XML and forms Java Classes to store the data and then play it. The content is saved in the form of Slides in a Slideshow (part of the requirements of the project, not our choice). So for instance 1 slide will be the main menu, then clicking a button will take you to another slide which will be a sub menu and so on.
Now a year later I've come to update this app, originally I was just intending to change the AbsoluteLayouts we used to Relative/Linear/List/whatever works best for that particular slide and also to put the layouts into XML rather keep them in the Java. However I was wondering what would be the best Android practice for an app such as this?
The advantage of using XML for the guide is that say if we had a guide to a different city we could just upload that new XML to a server (the player can download remotely) and then download it to get a new tour guide. However would it be best for me to strip away all of this and start afresh, with Android in mind? I.E. by removing the need to parse an XML file at the start and just have a new app for each city.
I've been thinking about a complete overhaul as changing AbsoluteLayout will be a pain. At the moment each component is given X and Y coordinates in the main XML file, so changing that to relative commands, changing the parser to read that will be hard. Also it's best practice to store the layouts in R.layout but it would be hard to convert the layout from the main Tour Guide XML to a layout XML... if that makes sense :/
If I were to remove the main XML, how would I handle each menu or content page? Would they be given their own activity?
Sorry for the long post, I just want to be clear on what the best way to update this app would be and am just learning how to properly design Android apps. I really appreciate any advice and for taking the time to read this post!
If I've put this in the wrong forum then let me know and I'll move it
Sent from my GT-I9100 using XDA App
check out
http://www.appcelerator.com/
i created my first app using it
and its on the market with around 2k downloads
it has its issues and bugs but it was my first real coding experience.
its worth checking out
and its free

[IDEA] Creating a simple app that grabs info from website/server.

I am in no means a proficient programmer. I have done some programming though. I know the most extreme basics.
I had a eureka moment today at work. We have typhoons here and we readily check the current weather conditions. Well, the local weather website is slow and the main means of communication is a Facebook fan page.
I was wondering how hard would it be to have an app grab info from a server and just display it. That's about it. Maybe some polish and fancy animations.
I don't think it would be much more than a few lines.
Thanks in advance.
Edit: Or open a .com and make a simple, secure form that let's you selection from options that forwards that info to the app.
inifekt said:
I am in no means a proficient programmer. I have done some programming though. I know the most extreme basics.
I had a eureka moment today at work. We have typhoons here and we readily check the current weather conditions. Well, the local weather website is slow and the main means of communication is a Facebook fan page.
I was wondering how hard would it be to have an app grab info from a server and just display it. That's about it. Maybe some polish and fancy animations.
I don't think it would be much more than a few lines.
Thanks in advance.
Edit: Or open a .com and make a simple, secure form that let's you selection from options that forwards that info to the app.
Click to expand...
Click to collapse
this has been done. its called an rss reader
Well... if you want to get technical. Most apps do this that connect to the internet.
I'm not looking for a RSS. I'm just looking to display a very specific string of text that would be very useful to the residents of the island I live on.
inifekt said:
Well... if you want to get technical. Most apps do this that connect to the internet.
I'm not looking for a RSS. I'm just looking to display a very specific string of text that would be very useful to the residents of the island I live on.
Click to expand...
Click to collapse
Seriously I would consider RSS, even if it is a widget which gets set to a single rss feed. It is what RSS was designed for, chances are the info you are after is available as RSS, otherwise it is very easy to create & host one.
The alternative is nasty if you end up parsing a site, since a single change to the site and the app is dead. Plus it would be a lot of work for something which can be very simple.
Hmm. Fair enough. Can you do widgets on the iphone? I was going to port it there too.
I just need to post a tccor and sea condition.
Sent from my PC36100 using XDA App
inifekt said:
Hmm. Fair enough. Can you do widgets on the iphone? I was going to port it there too.
I just need to post a tccor and sea condition.
Sent from my PC36100 using XDA App
Click to expand...
Click to collapse
I've not done any android widgets or iphone. But if you are lucky you might find some suitable code somewhere for a basic RSS widget, RSS is quite a common way to do things (since you download a single file and parse the xml).
You may even find there are already apps out there which allow you to set a single rss feed for displaying in a widget. But I guess you are after something you can put in the market yourself.
The RSS feed itself is easy:
There are site which will do it for you:
i.e. feedweaver.net
There are some which will monitor pages for changes too, depending on what you need.
Otherwise you can diy, Howto Create an RSS 2.0 Feed - http://www.petefreitag.com/item/465.cfm and host the file yourself (i.e. dropbox public links or FileDen, anywhere which hosts a file with direct links).
I would recommend using Google Feedburner to set your rss feed address and then link it to your file (this means you can move your file around without requiring the feed link to change).
Of course if you can find the info already available as an RSS feed, then you can re-feed it through Feedburner so you have control of it (if it changes you can change your links without changing your app).
You might also want to check out the word-of-the-day widget in the Android SDK. It grabs very specific information from a dictionary web site and displays it using an app widget.
http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html

Categories

Resources