Com mais de 200 milhões de dispositivos e com 700 mil novos dispositivos ativados diariamente, o Android é a plataforma móvel que promete uma democratização do mercado móvel no mundo.
Esta nota tem como objetivo apresentar a plataforma Android a quem tem curiosidade de começar a desenvolver para estes dispositivos.
www.notassoltas.com
4. Apps
Dicionário
VATChecker
Sunday, February 5, 12
5. Apps
Dicionário
VATChecker
Jogos de
Apostas
Sunday, February 5, 12
6. Apps
Dicionário
VATChecker
Jogos de
Movies Apostas
Sunday, February 5, 12
7. Apps
Dicionário
VATChecker
Jogos de
Movies Trânsito Apostas
Sunday, February 5, 12
8. Apps
Dicionário
VATChecker
Cultura
Jogos de
Movies Trânsito Apostas
Sunday, February 5, 12
9. Apps
Dicionário
VATChecker
Cultura CCilhavo
Jogos de
Movies Trânsito Apostas
Sunday, February 5, 12
10. Apps
Dicionário
VATChecker
Cultura CCilhavo
Jogos de
Movies Trânsito Apostas
Horóscopo
Sunday, February 5, 12
11. Apps
Dicionário
Sinónimos
VATChecker
Cultura CCilhavo
Jogos de
Movies Trânsito Apostas
Horóscopo
Sunday, February 5, 12
12. Apps
Portagens Dicionário
Sinónimos
VATChecker
Cultura CCilhavo
Jogos de
Movies Trânsito Apostas
Horóscopo
Sunday, February 5, 12
13. Apps
From: xxxxx xxxx@priberam.pt
CC: DirecçãoJurídica <DireccaoJuridica@priberam.pt>
Bom dia,
Verificámos que têm no Android Market uma aplicação que utiliza o conteúdo do Dicionário
Priberam da Língua Portuguesa sem autorização da Priberam nem qualquer referência à
proveniência do conteúdo.
Por essa razão e porque a Priberam disponibilizou uma aplicação sua para o Android de acesso
ao Dicionário, vimos por este meio pedir-vos que retirem a aplicação do Android Market
imediatamente.
Muito obrigado,
xxx xxxxx
Priberam
Sunday, February 5, 12
16. Smart-lamp
git rep: https://github.com/casainho/smart-lamp
Sunday, February 5, 12
17. Smart-lamp
git rep: https://github.com/casainho/smart-lamp
Sunday, February 5, 12
18. Design tips
• Always try to predict the user text.
• Use the default interface
• New input paradigm. Fingers ≠ mouse
• Size of text. Distance to computer screen ≠
distance to mobile device.
• Visual Information
Sunday, February 5, 12
19. Target Your App
Serious
content
Entertainment Tool
Fun
usage
Sunday, February 5, 12
20. Target Your App
Serious
content
Entertainment Tool
Fun
usage
Sunday, February 5, 12
21. Target Your App
Serious
content
Entertainment Tool
Fun
usage
Sunday, February 5, 12
22. Target Your App
Serious
content
Entertainment Tool
Fun
Serious Tool
•Productivity Type usage
•Minimal UI
•Create, modify, archieve
Sunday, February 5, 12
23. Target Your App
Serious
content
Entertainment Tool
Fun
usage
Sunday, February 5, 12
24. Target Your App
Serious
content
Entertainment Tool
Fun
usage
Sunday, February 5, 12
25. Target Your App
Serious
content
Entertainment Tool
Fun
Fun Tool
• Fun to use and useful usage
• Some graphically rich elements
• Small information hierarchy
Sunday, February 5, 12
26. Target Your App
Serious
content
Entertainment Tool
Fun
usage
Sunday, February 5, 12
27. Target Your App
Serious
content
Entertainment Tool
Fun
usage
Sunday, February 5, 12
28. Target Your App
Serious
content
Entertainment Tool
Serious Entertainment Fun
• No Productivity
• Educacional entertainment usage
• Data driven
• Potentially hierarchical
Sunday, February 5, 12
29. Target Your App
Serious
content
Entertainment Tool
Fun
usage
Sunday, February 5, 12
30. Target Your App
Serious
content
Entertainment Tool
Fun
usage
Sunday, February 5, 12
31. Target Your App
Serious
content
Entertainment Tool
Fun
Utilities
• Rich Graphics usage
• Single Screen
• Ag in app 30 to 60s
Sunday, February 5, 12
32. Dalvik.equals(Java) == false
• The VM runs on top of a Linux 2.6 kernel.
• A tool called dx is used to convert some (but not all) Java .class
files into the .dex format. Multiple classes are included in a
single .dex file. Duplicate strings and other constants used in
multiple class files are included only once in the .dex output to
conserve space. Java bytecode is also converted into an
alternative instruction set used by the Dalvik VM.
• JavaVM’s one can find on almost any desktop computer
nowadays are Stack-based Virtual Machines (VM).The DalvikVM
on the other hand is register based, because on mobile-
processors are optimized for register- based execution. Also of
register-based VMs allow faster execution times at the expense
of programs which are larger after compilation.
Sunday, February 5, 12
34. Anatomy of an Android
Application
• Activity
• Intent Receiver
• Service
• Content Provider
Sunday, February 5, 12
35. Activity
• An activity is usually a single screen in your
application
• One activity is designated as the entry point
point for your application
Sunday, February 5, 12
37. Activity
public class NotasSoltasActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
}
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
}
@Override
protected void onRestart() {
// TODO Auto-generated method stub
super.onRestart();
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
}
@Override
protected void onStart() {
// TODO Auto-generated method stub
super.onStart();
}
Sunday, February 5, 12
38. Service
A Service is code that is long-lived and runs
without a UI. A good example of this is a media
player playing songs from a play list.
Sunday, February 5, 12
39. Intents
Intents are asynchronous messages which allow
Android components to request functionality
from other components of the Android
system. For example an Activity can send an
Intents to the Android system which starts
another Activity.
Sunday, February 5, 12
40. Content Provider
Applications can store their data in files, a
SQLite database, preferences or any other
mechanism that makes sense. A content
provider, however, is useful if you want your
application's data to be shared with other
applications. A content provider is a class that
implements a standard set of methods to let
other applications store and retrieve the type
of data that is handled by that content
provider.
Sunday, February 5, 12
42. MVC
Controler
Model View
Sunday, February 5, 12
43. Development Tools
• Eclipse plugin
• Android SDK
Sunday, February 5, 12
44. Development Tools
Emulator Simulator
The difference between emulators and simulators is that emulators mimic the software and
hardware environments found on actual devices. Simulators, on the other hand, only mimic the
software environment.
Sunday, February 5, 12
47. Common Problems
• ANR (App Not Responding)
block main thread for more than 5 seconds
• Manifest missing configurations
Sunday, February 5, 12
48. Common Problems
Don’t block the main thread
Sunday, February 5, 12
49. Common Problems
Don’t block the main thread
public void onClick(View v) {
new Thread(new Runnable() {
public void run() {
Bitmap b = loadImageFromNetwork();
mImageView.setImageBitmap(b);
}
}).start();
}
Sunday, February 5, 12
50. Common Problems
Don’t block the main thread
public void onClick(View v) {
new Thread(new Runnable() {
public void run() {
Bitmap b = loadImageFromNetwork();
mImageView.setImageBitmap(b);
}
}).start();
} public void onClick(View v) {
new Thread(new Runnable() {
public void run() {
final Bitmap b = loadImageFromNetwork();
mImageView.post(new Runnable() {
public void run() {
mImageView.setImageBitmap(b);
}
});
}
}).start();
}
Sunday, February 5, 12
51. Common Problems
public void onClick(View v) {
new DownloadImageTask().execute("http://example.com/image.png");
}
private class DownloadImageTask extends AsyncTask<String, Void,
Bitmap> {
protected Bitmap doInBackground(String... urls) {
return loadImageFromNetwork(urls[0]);
}
protected void onPostExecute(Bitmap result) {
mImageView.setImageBitmap(result);
}
}
Sunday, February 5, 12
52. Performance
• Avoid Creating Unnecessary Objects
• Avoid Internal Getters/Setters
In native languages like C++ it's common practice to use getters (e.g. i =
getCount()) instead of accessing the field directly (i = mCount). This is an
excellent habit for C++, because the compiler can usually inline the access,
and if you need to restrict or debug field access you can add the code at any
time.
On Android, this is a bad idea.Virtual method calls are expensive, much
more so than instance field lookups. It's reasonable to follow common
object-oriented programming practices and have getters and setters in the
public interface, but within a class you should always access fields directly.
• Prefer Static Over Virtual
If you don't need to access an object's fields, make your method static.
Invocations will be about 15%-20% faster.
Sunday, February 5, 12
53. Performance
• Use Enhanced For Loop Syntax
static class Foo {
int mSplat;
}
Foo[] mArray = ... public void one() {
int sum = 0;
public void zero() { Foo[] localArray = mArray;
int sum = 0; int len = localArray.length;
for (int i = 0; i < mArray.length; ++i) {
sum += mArray[i].mSplat; for (int i = 0; i < len; ++i) {
} sum += localArray[i].mSplat;
} }
}
public void two() {
int sum = 0;
for (Foo a : mArray) {
sum += a.mSplat;
}
}
Sunday, February 5, 12
55. Web app VS Native
• If you are building a native app, make sure,
that it will be amazing.
• PhoneGap - http://phonegap.com/
PhoneGap is an HTML5 app platform that allows you to author native
applications with web technologies and get access to APIs and app
stores. PhoneGap leverages web technologies developers already know
best... HTML and JavaScript.
Sunday, February 5, 12
56. Demo
This slide has been deliberately left blank
Sunday, February 5, 12
57. Android Market
• 25$ registation fee for developers
• 30 / 70
Sunday, February 5, 12
59. Inspiration
• What app should i make?
• Identify a necessity
• Forget Apps, build a service!
• Use the out-of-the-box phone features: GPS,
Contact List, Google Account, Internet,
Accelerometer, Maps
Sunday, February 5, 12
61. Market
• Right now, Portuguese market is too
small for mobile ads revenue.
• Take advantage of Portuguese
language
• Think Global.
Sunday, February 5, 12
62. Market
• Right now, Portuguese market is too
small for mobile ads revenue.
• Take advantage of Portuguese
language
• Think Global.
Sunday, February 5, 12
63. Market
“The latest Distimo report found that just two paid
Android apps have ever eclipsed the half-million
milestone, while six iPhone apps did that in two months
in April and May.”
“Overall, 79.3 percent of all paid Android apps have
been downloaded less than 100 times, and only 4.6
percent of paid apps were downloaded more than
1,000 times.”
http://gigaom.com/2011/05/27/android-still-trails-ios-as-a-money-maker-for-devs/
Sunday, February 5, 12