Software Research
Software Research
Resources
1
Relay Sessions
2
Agenda
3
Connecting to
Internet Resources
3
What is the need for creating internet
application?
• There are several benefit of creating thin client
application
• Bandwidth
• Caching
• Native Features
• Modern mobile offers the following techniques for
internet connectivity
• GPRS
• EDGE
• 3G
5
Connecting And Downloading Internet
Android offers several ways to access Internet resources.
6
Connecting to Internet
• Android let your apps to connect to internet or any other
local network and allows you to perform network operation
• The following classes used checking network connection
• ConnectifyManager , getSystemService()
• URL, HttpURLConnection
7
Connecting to an Internet Resource
<uses-permission android:name=”android.permission.INTERNET”/>
8
Basic pattern for opening an Internet data
stream.
String myFeed = getString(R.string.my_feed);
try
{
URL url = new URL(myFeed);
// Create a new HTTP URL connection
URLConnection connection = url.openConnection();
HttpURLConnection httpConnection =
(HttpURLConnection)connection;
int responseCode = httpConnection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
InputStream in = httpConnection.getInputStream();
processStream(in);
}
}
catch (MalformedURLException e) {
Log.d(TAG, “Malformed URL Exception.”);
}
catch (IOException e) {
Log.d(TAG, “IO Exception.”);
}
9
Using Cloud
3
Cloud Web Services
• The following list shows some of the more matured and
interesting Internet services currently available.
11
Google API’s
In addition to the native Google applications, Google offers web APIs for
accessing to their
Calendar
Docs
Blogger
Picasa Web Albums platforms.
These APIs collectively make use of a form of XML for data communication.
Example
• With the Google Maps Android API, you can add maps to your app that
are based on Google Maps data.
• The Google Maps Android APIs are not included in the Android platform,
but are available on any device with the Google Play Store running
Android 2.2 or higher, through Google Play Services 12
Google API Engine
• Using the Google App Engine, you can create cloud-hosted
web services that shift complex processing away from your
mobile client.
• Doing so reduces the load on your system resources but
comes at the price of Internet-connection dependency.
13
Yahoo Pipes
• Yahoo! Pipes offers a graphical web-based approach to XML
feed manipulation.
14
Amazon Web Services
• Amazon offers a range of cloud-based services, including a
rich API for accessing its media database of books, CDs, and
DVDs.
• Amazon also offers a distributed storage solution (S3- Best
Ex:Dropbox) and Elastic Compute Cloud (EC2-Virtual Servers).
• Amazon distinguishes its vendors because of the following
Flexible
Cost effective
Scalable and elastic
Secure 15
Usage of Cloud in Apps
16
Usage of Cloud in Apps
17
Usage of Cloud in Apps
19
Download Manager
3
Using The Download Manager
• The Download Manager was introduced in Android 2.3 (API level
9) as a Service to optimize the handling of long-running
downloads.
• The Download Manager handles the HTTP connection and
monitors connectivity changes and system reboots to ensure
each download completes successfully.
• To Access the Download Manager:
• Request the DOWNLOAD_SERVICE using the getSystemService
method, as follows:
String serviceString = Context.DOWNLOAD_SERVICE;
DownloadManager downloadManager;
downloadManager =
(DownloadManager)getSystemService(serviceString); 21
Cancelling and Querying Downloads
• The Download Manager has the following methods
• Remove: method lets you cancel a pending download,
• Abort: a download in progress, or
• Delete : a completed download.
23
Files and Parsers
3
Files in Android
25
Files
26
Local File System
27
Saving and Loading of Files
28
File Operations
• File Operation (Read)
Read file
• Use Context.openFileInput(String name) to open private
input file related to program
Throw FileNotFoundException when file does not exists
• You Can find the location of the file stored in your
Sandbox by calling getFilesDir
• File Operation (Write)
Write File
• Use Context.openFileOutput(String name, int mode) to
open private file
• File will be created if it does not exists
• Output stream can be opened in append mode which
means new data will be appended to end of file 29
File Operations (Contd.,)
30
Including Static File as a Resource
31
File Management Tools
34
Parser
35
Parsing XML Using Pull Parser
3
Top 10 Android ready Development
Frameworks (Contd.,)
• The following are Top 10 of the most popular Android
development tools. Unless otherwise noted, they are
open source, cross-platform frameworks:
http://www.basic4ppc.com/android/why.html
38
Top 10 Android ready Development
Frameworks (Contd.,)
2. Corona SDK: Widely used among game developers, Corona is
also a popular, general-purpose framework. Corona Labs
(formerly Ansca Mobile) claims an installed base of 120,000
developers. This high-end, commercial SDK offers over 500
APIs, as well as advertising and native UI support, and a built-in
physics engine.
2. http://www.coronalabs.com/
39
Top 10 Android ready Development
Frameworks (Contd.,)
4. Dojo Mobile: The Dojo community's BSD-licensed
HTML5/JavaScript framework has added MVC and app-controller
packages, as well as mobile-specific components such as switches
and sliders. A degree of PhoneGap compatibility is also available.
4. http://dojotoolkit.org/features/mobile
40
Top 10 Android ready Development
Frameworks (Contd.,)
6. jQuery Mobile: This popular, lightweight HTML5-based
framework is built on jQuery, and focuses on semantic markup,
progressive enhancement, and themable design. It's the leading
cross-platform framework among Eclipse open source developers.
http://jquerymobile.com/
41
Top 10 Android ready Development
Frameworks (Contd.,)
8. Mono for Android: Xamarin's C#- and enterprise-oriented
package is compatible with a similar iOS-based MonoTouch
version, and can also share code with the C#-based Windows
Phone. Mono supplies an environment conducive to Visual
Basic developers, and is touted for its debugger and native
binary compiler.
http://xamarin.com/
43
Thank-You
58