I want to show some part of my college site into my app (like news part only). Site is developed using JavaScript. Tell me how could I achieve this. I know Java quite well.
use jsoup and httpclient that's all you need
If you need javascript support, HtmlUnit is a very good solution for a headless browser. There also exists a framework that allows you to parallelize downloads over proxies using that: https://github.com/subes/invesdwin-webproxy
Related
I have to develop a phone application on every platform so I thought of using phonegap. Seems pretty nice.
I have a web application coded in classic Asp and it's this webApplication that I need to strip down to be a phone app.
At first I thought it will be simple, my classic Asp render some html so phonegap is able to put it as an app.
But it's not that simple, because in my asp I have some code that is rendered server side, I've talked to some who tell me that some html could call the asp pages and this html could be used in phonegap. Don't think it's possible ...
Well if someone could help me here, maybe i've said something wrong in my little text don't hesitate to correct me :)
My solution (I think) : code some webServices in asp.net that will use the same database as my asp classic web application. And some html and jquery will call the webservices and those html and jquery will go trough phoneGap
What is the best way to transfer and asp classic web app to a multiplatform phone app ?
EDIT : After looking everywhere, effectively phonegap can't use asp pages. So I'm questionning myself should I do a mobile website or a mobile app with webservices?
EDIT 2: I'm going for an asp.net mobile website, someone have a great way to do this, I've seen the answer proposing mvc... more details?
You are on the correct path in wanting to use PhoneGap to create a multi-platform phone app via HTML5, and some mobile framework like jQuery Mobile.
Yes, you can leverage the power of ASP.NET to serve up your data but I wouldn't create an asmx web service. A SOAP-based service serving up XML may be too fat/overkill for your mobile web app. Instead, you may want to investigate using JSON which is more lightweight (remember, bandwidth is a concern with mobile apps). One can rapidly create an API to serve up your JSON data via the new ASP.NET Web API. With your API exposed, you can make an ajax call from your html page to retrieve the JSON and bind it using jQuery.
The bonus to using the ASP.NET Web API would be when it's time to upgrade that classic ASP web site you have there, you could leverage the API you already created.
I'd really consider rewriting the website using Mvc.Net. You may want to consider using the iUI for the views.
It will be much cheaper long-term to use modern technology than trying to shoe-horn legacy code into new usage areas.
It looks like you've made up your mind to go with a webapp instead of native apps via PhoneGap. I would recommend that you pick up this book by Jonathan Stark. It's very short - shorter than it should be when it gets into using PhoneGap - and although it focuses on iPhone development, much of the content is applicable to most mobile devices. The first few chapters give a great introduction on developing attractive, responsive, highly usable web apps for mobile devices. If you familiarize yourself with jQuery and jQTouch you can get some really great looking apps with relatively little effort, regardless of the server side technology you go with.
So i'm questionning myself should I do a mobile website or a mobile app with webservices ?
The answer to that question is always mobile website... given an outdated website that the client is wanting duplicate functionality in an app.
Do the work to convert the website or at least the portions that you need to use ajax and webservices. Once you have that in place pulling the same data to place in a mobile app will be easy... you've already done it once.
So my approach would be to convert this dataview into two separate elements Data and View.
You can probably even keep the current asp pages without a lot of modification to the code since you can still call these web-service functions the same way as before in your asp code.
Well, if you really want to reuse your existing webpage you can do the following.
Create a index.html and the body.onload event, redirect to your webpage.
Then build this index.html with phonegapbuild, and you will get your "native" application that simply loads your existing webpage.
If you want to serve mobile users, you have 2 main options:
Create a mobile website. You can render html on the server all you want, no javascript programming needed. Maybe look into jQuery mobile, it can be a cheap and easy way to make the website better for mobile users.
Create a html web app (and package it inside PhoneGap if you want). This is basically a html page which loads just the data from the server in json format and updates the page contents dynamically with javascript. You need good js skills to implement this, you're server is just a REST api that server json - technology can be anything, at least asp.net mvc makes it easy. On the client side you'll want to use some good structuring frameworks, backbone.js ( http://documentcloud.github.com/backbone/ ) is a good option. Check out http://m.linkedin.com for an example of what a mobile web app can be.
3rd hidden option: just create a native app for each platform, that'll get you the best user experience.
how can i use this script:
http://www.pengoworks.com/workshop/jquery/autocomplete.htm
with a web service?
Thanks!
Actually, the .cfm cold fusion module is a replacement for the web service... So effectively you can't without rewriting it.
There is an example of jQuery for what you want to do here:
http://www.codeproject.com/KB/aspnet/Jquery_Autocomplete.aspx
look at the "AutoComplete: Data from a Webservice" section. The example is in asp.net, however you can set up a similar web service using any language which allows it (PHP, c++ etc).
Does Webrat require that the web application be written in Ruby/Rails?
I'd like to try it for writing tests against an ASP.NET web application.
You can use webrat for any application, not just Rails. What you do is to use Cucumber + Webrat + Mechanize adapter. This combination makes ordinary HTTP requests against your web application.
In fact, for the moment, i'm working on a simple smoketest that tests a website portal and can verify that everything is up and running in different environments. (localhost, test env, staging, production).
Have a look in Cucumbers' source. There is an example in the folder:
cucumber/examples/webrat/
What you do is to tell Webrat to use the Mechanize adapter. Now you have a headless browser that can access any application regardless of the framework it uses.
Note that if you need full javascript support, you probably want something else (Watir,Firewatir, Selenium, etc).
It would be easier to jump to rails :P I stumbled upon this post because I was thinking that would be very handy.
Have a look at Cuke4Nuke
Also checkout the authors blog, there is a nice screencast but it uses WatiN
There is also some discussion here about eventually being able to build the equivalent of webrat for mvc
https://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/428-wire-protocol
Does anyone know of a good article or tutorial on the Internet demonstrating the use of GWT leveraging a (ASP.NET) web service cross domain?
To my knowledge, interacting with either XML or JSON should be possible from GWT, but becomes a lot more difficult when the web service is on a different domain. I've tried finding an article that demonstrates this setup, but without any luck.
There are a few options available:
use the Cross Site linker - it should make cross domain request easier, simply add <set-linker name="xs"/> in your module file (*.gwt.xml)
window.name hack :) Be sure to read the post with the original dojo proposal
JSONP
many others ;)
But first I recommend reading http://code.google.com/webtoolkit/tutorials/1.6/Xsite.html - it should get you going :)
I was initially going for a JSONP approach (as suggested by Google), in order to do cross site AJAX calls in JavaScript, but ended up with too many hacks that I had to incorporate into the ASP.NET web service in order for it to work.
The solution, in my case, was instead to use GWT RPC to a JAVA servlet, acting as a proxy, which then would call the ASP.NET Web Service using SOAP. The SOAP Java classes was generated using the wslist tool that is part of JAX-WS project (as demonstrated here).
Using the GWT RPC, I was still able to call the JAVA servlet asynchronously, giving the user a seamless experience.
What's the best way to implement friendly URL in ASP.net?
The ASP.NET Routing Framework provided in .NET 3.5 SP1 is a good one.
Although it is very new, it can handles many URL-related tasks and most frequently used URL-friendly schemes very well.
It can be used outside of MVC, too.
The best way to do this is to look into the new MVC toolkit from microsoft (http://www.asp.net/mvc/)
See http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx for an example.
Sure, its only beta right now, but the core of it is the routing system that makes it possible to make intelligent urls based on actual content.
I.e. to edit product with id 5 you'd have an url that looked like
/Product/Edit/5
If I read the specifications correctly, you can use this routing system for anything (i.e. so you don't have to recode the entire site to use it), and it can default to allow direct references to an existing file to have precedence over its own rules (i.e. /myfile.aspx will still use the file, instead of a route). That way you can mix and match the technologies and urls while you make the trancendance to the new routing based system.
I have used UrlRewriter.Net library. It is small but powerful and easy to configure.
If you're looking to do this in earlier versions of the .Net Framework, you can use the RemapURL tool from the IIS 6.0 Resource Kit. We use it, and all it takes is installing the dll, creating a very simple ini file with your friendly urls and their associated endpoints, and enabling the dll in Web Service Extensions Very simple how-to here.