-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAndroidBasics.tex
More file actions
376 lines (313 loc) · 9.74 KB
/
AndroidBasics.tex
File metadata and controls
376 lines (313 loc) · 9.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
\documentclass[11pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{hyperref}
\author{Sanyam, Vinay, Rahul, Akshay @EduTechLabs}
\title{Android Basics}
%\setbeamercovered{transparent}
%\setbeamertemplate{navigation symbols}{}
%\logo{}
%\institute{}
%\date{}
%\subject{}
% selecting theme
\usetheme{Berkeley}
%%configure listings package for java
% Default fixed font does not support bold face
\DeclareFixedFont{\ttb}{T1}{txtt}{bx}{n}{8pt} % for bold
\DeclareFixedFont{\ttm}{T1}{txtt}{m}{n}{8pt} % for normal
%custom colours
\definecolor{pblue}{rgb}{0.13,0.13,1}
\definecolor{pgreen}{rgb}{0,0.5,0}
\definecolor{pred}{rgb}{0.9,0,0}
\definecolor{pgrey}{rgb}{0.46,0.45,0.48}
%setting up hyperref
\hypersetup{
colorlinks = true,
linkcolor = blue,
urlcolor = blue
}
%configuring listings package to highlight java syntax
\newcommand\javastyle{\lstset{
language=Java,
%basicstyle=\ttm,
otherkeywords={this}, % Add keywords here
%keywordstyle=\ttb\color{deepblue},
emph={MyClass,__init__}, % Custom highlighting
emphstyle=\ttb\color{pred}, % Custom highlighting style
%stringstyle=\color{deepgreen},
commentstyle=\color{pgreen},
keywordstyle=\ttb\color{pblue},
stringstyle=\color{pred},
basicstyle=\ttfamily,
moredelim=[il][\textcolor{pgrey}]{$$}, %%$$ %the double dollar to prevent texmaker from going crazy
moredelim=[is][\textcolor{pgrey}]{\%\%}{\%\%}
%frame=tb, % Any extra options here
showstringspaces=false %
}}
% java environment
\lstnewenvironment{java}[1][]
{
\javastyle
\lstset{#1}
}
{}
% java for external files
\newcommand\javaexternal[2][]{{
\javastyle
\lstinputlisting[#1]{#2}}}
% java for inline
\newcommand\javainline[1]{{\javastyle\lstinline!#1!}}
%%%%%%%%%%%% begin writing the actual document %%%%%%%%%%%%%%%%%
\begin{document}
\begin{frame}
\titlepage
\end{frame}
%\begin{frame}
%\tableofcontents
%\end{frame}
\section{What can be achieved with Android}
\begin{frame}[containsverbatim]{What can you make with Android ?}
\begin{flushleft}
\begin{itemize}
% \item Almost anything,
\item people have made satellites from Android phones !! not kidding (here's the \href{http://www.theverge.com/2013/5/3/4297718/nasa-phonesat-android-nexus-returns-images}{link})
\item coming back to more earthly things:
\item ftp server, http serve, barcode scanner, qr code reader, navigator
\item of-course there is Whatsapp
\end{itemize}
\end{flushleft}
\huge Your imagination is the limit ! \\
\normalsize Almost
\end{frame}
\section{Installing the ADT bundle}
\begin{frame}[containsverbatim]{What to download ?}
\begin{flushleft}
\begin{itemize}
\item What is stable ?
\item How do you know what will work ?
\item Why are we not using studio ?
\end{itemize}
\end{flushleft}
\end{frame}
\section{Getting to know the Eclipse, IDE}
\begin{frame}[containsverbatim]{What is an IDE}
\begin{flushleft}
\begin{itemize}
\item IDE ?
\item Why use and IDE ?
\item will I have to learn studio all over again ?
\end{itemize}
\end{flushleft}
\end{frame}
\begin{frame}[containsverbatim]{Importing, Exporting Projects}
\end{frame}
\begin{frame}[containsverbatim]{Starting a new project}
\begin{flushleft}
\begin{itemize}
\item next, next, next, Finish install :)
\item What are all these options ? are they important ?
\item Boom you have an app !
\item Hey ! wait a minute, was this magic ?
\item No, it was templates :P
\item Batteries included, philosophy
\end{itemize}
\end{flushleft}
\end{frame}
\begin{frame}[containsverbatim]{Now how do I run this project ?}
\begin{flushleft}
\begin{itemize}
\item setting up virtual devices, emulator, geny motion is dead :(
\item testing on hardware devices, 7 taps ! yup this is magic
\item connecting to a device on wifi
\end{itemize}
\end{flushleft}
\end{frame}
\begin{frame}[containsverbatim]{Useful IDE tools}
\begin{flushleft}
\begin{itemize}
\item Eclipse views, perspectives, gutter, line-numbers
\item Eclipse shortcuts, F11, Ctrl+F11, Ctrl+shift+o, Ctrl+space etc
\item re-factoring, We know you will mess-up names
\item LogCat
\item Code Completion
\item auto import dependencies
\end{itemize}
\end{flushleft}
\end{frame}
\begin{frame}[containsverbatim]{Useful IDE tools}
\begin{flushleft}
\begin{itemize}
\item device manager gui (adb)
\item toolbar customization
\item eclipse syntax checking and suggestion
\item getting syntax hints (javadocs for the functions / methods)
\item getting code completion suggestions
\item mostly, eclipse is always right
\item mostly, we are doing something that does not fit in the usual android framework
\end{itemize}
\end{flushleft}
\end{frame}
\begin{frame}[containsverbatim]{Why is it so complex ? - General note}
\begin{flushleft}
\begin{itemize}
\item I am having a panic attack now !!
\item This is so fishing complex !
\item Is there a reason for this madness ?!
\item Yes, there is :(
\item Running android is like running an orchestra !
(everything has its role, and is an essential component)
\item just to give you an idea.. let us build a phone from your ARM7 processor !
\end{itemize}
\end{flushleft}
\end{frame}
\section{Error Handling}
\begin{frame}[containsverbatim]{Error before output ?!}
\begin{flushleft}
\begin{itemize}
\item its true, its true, Errors speak the truth
log errors ko yu hi badnam karte hain, dhokha to output deta hai :)
\item errors are our friends
\item Log.d $->$ the "print" (prince) of android
\item Tags - how to use them, what should a tag tell you ?
\item LogCat advanced features - filtering output, output levels,
\end{itemize}
\end{flushleft}
\end{frame}
\section{Basic UI}
\begin{frame}[containsverbatim]{XML the custom computer language !}
\begin{flushleft}
\begin{itemize}
\item What do you define in an XML ?
\item where do you tell android to use this xml ?
\item What are the basic building blocks
\item View Class
\item EditText
\item TextView
\item Button
\item Image
\item spinner that does not spin
\item a progress bar that is round
\end{itemize}
\end{flushleft}
\end{frame}
%Make an app which greets you if you fill you name
% It says don't recognize you if you if name is blank !
\begin{frame}[containsverbatim]{Java !}
\begin{flushleft}
\begin{itemize}
\item now begins the ugly part
\item roll up your sleeves ! this is going to get dirty
\item Activity Class
\item onClicklistener
\item toast
\end{itemize}
\end{flushleft}
\end{frame}
\begin{frame}[containsverbatim]{The manifest xml}
\begin{flushleft}
\begin{itemize}
\item Android has a linux base !
\item very strict about permissions
\item who can do what ? has to explicitly ask for permissions
\item this file is like meta data for your project
\end{itemize}
\end{flushleft}
\end{frame}
\begin{frame}[containsverbatim]{Now ! We can talk structure }
\begin{flushleft}
\begin{itemize}
\item what is the structure of an android app ?
\item Audience have you been paying attention
\item look and feel of the app ?
\item permissions for the app ?
\item behaviour of the app ?
\item what are so many folders doing here ?
src, res and sub-folders
\item auto generated files
\item gen, bin,
\item Where did this R. come from ?
\end{itemize}
\end{flushleft}
\end{frame}
\section{Exception Handling}
\begin{frame}[containsverbatim]{Exception Handling}
\begin{flushleft}
\begin{itemize}
\item Try to handle null filled in the edit text in the previous app
\item Give a debugging trial run
\item A Mock for making mistake and finding out what happened.
\end{itemize}
\end{flushleft}
\end{frame}
\section{Custom Toast Message}
\section{Activity Class - details}
\begin{frame}[containsverbatim]{Life cycle}
\begin{flushleft}
\begin{itemize}
\item Life cycle
\end{itemize}
\end{flushleft}
\end{frame}
\section{Multiple Activities}
\begin{frame}[containsverbatim]{Multiple Activities}
\begin{flushleft}
\begin{itemize}
\item Intenet
\item Passing paramemters from activity to activity - this is not the only way
\item Navigation - backstack, clear backstack
\item delibratly stop an activity
\end{itemize}
\end{flushleft}
\end{frame}
\section{Layouts}
\begin{frame}[containsverbatim]{View groups}
\begin{flushleft}
\begin{itemize}
\item Linear - horizontal stacking, vertical stacking
\item Relative - anchor, positioning of other elements
\item Scrolling
\item linear, relative, viewgroup, id, width, height, padding
\item linear layout --- using XML
\item linear layout --- using JAVA
\end{itemize}
\end{flushleft}
\end{frame}
\section{Fragments}
\begin{frame}[containsverbatim]{Fragments}
\begin{flushleft}
\begin{itemize}
\item How is a fragment different from activity
\item Why use a fragment ?
\item When to use a fragment over and activity ?
\item When to use an activity over a fragment ?
\end{itemize}
\end{flushleft}
\end{frame}
\section{Event Handling}
\begin{frame}[containsverbatim]{Event Handling}
\begin{flushleft}
\begin{itemize}
\item what is an event ?
\item what is a listener ?
\item have you seen a listener before ? (You friendly, alright not so friendly server apache ! runs a listener) which port by the way ?
\item java the button click event, had a listener !
\end{itemize}
\end{flushleft}
\end{frame}
\section{Local Storage}
\begin{frame}[containsverbatim]{Local Storage}
\begin{flushleft}
\begin{itemize}
\item One form of local storage -
\item shared preferences
\item Now this is a singleton ! What the heck is this and what do you want to make it more complicated.
\end{itemize}
\end{flushleft}
\end{frame}
\section{Your powers combine ! Let us make an App}
\end{document}