Showing posts with label articles. Show all posts
Showing posts with label articles. Show all posts

Monday, May 24, 2010

First official coding day (night?)

I knew I would overdo it.. The beards are already singing and it's 4:15 AM on the clock :P
Is this the best coding time, or what :D! I was afraid of OAuth, which I'm new to, so I dug tens of pages and browsed at least 5-6 sample codes, using this or that, newer or older oauth version, with and without callback, blah blah blah. And I got it :D Signpost is dead simple (yeah, it's true what they write :) ), and they have those lovely sample codes, so I used one :) I jumped into ubuntuone-client Python code and dug a reference to /etc/xdg/ubuntuone/oauth_urls which I needed, set up few more variables, and..
Fetching request token from Ubuntu One...
Request token: GnpqrjR98jBcXXXXXXX
Token secret: pvBlJDjq1jgm9M14rzx0hgH2xXNnhFG8zC3VkqxDdshrSKcnbBNJwD6CCJR4XXXXXXXX
Now visit:
https://one.ubuntu.com/oauth/authorize/?oauth_token=GnpqrjR98jBXXXXXXXX
... and grant this app authorization
Enter the PIN code and hit ENTER when you're done:
XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX
Fetching access token from Ubuntu One...
Access token: ddxQlp8tfltXXXXXXXX
Token secret: Zn172Q7xsFdTlfB58LhLg4c8TzFmHRRhLWMQDCdvrrjJ27d0fkbk8qvVjN9rtbcnmfXXXXXXXXXXXXX
Sending request to Ubuntu One...
Response: 200 OK
Well, I'm more confident now ;)

Sunday, May 2, 2010

Regular update, May 1st

Videos watched & notes taken + reading materials


Androidology - Architecture Overview [ link ]

Decompose the app into application building blocks, which include
  • Activities
  • BroadcastReceivers (triggered by any event)
  • Services
  • ContentProviders
Androidology - Application Lifecycle [ link ]
Androidology - APIs [ link ]


Google I/O 2009 - ...Make your Android UI Fast and Efficient [ link ] (good one!)
  • reuse views with Recycler for higher fps
  • prescale bitmaps with
    image = Bitmap.createPrescaledBitmap(image, view.getWidth(), view.getHeight(), true);
  • remove backgrounds from views, which fill parents full width and height (eg if you have a map, you don't see the background, which is still rendered) [00:17:23]
  • invalidate() to redraw a view is inefficient, use invalidate(rect) or invalidate(left, top, right, bottom)
  • fewer (views) is better ;) (try to get rid of views that have only one child, too: HierarchyViewer)
  • use compound drawables (eg TextView instead of ImageView+TextView)
  • use ViewStub to inflate part of the UI on demand (eg for part of the UI that for majority of the time is invisible) [00:35:20]
  • use merge tag to reuse UI hierarchy elements
  • RelativeLayout instead of embedding linear layouts; hard to use, but it pays off
  • use custom views, custom layouts instead of overusing numerous views
  • garbage collection kicks in for 100~500ms, stops threads (so allocate little memory, or even none :d)
  • do not allocate memory in those time-critical points:
onMeasure()
onLayout()
draw()
dispatchDraw()
onDraw()
dispatchTouchEvent()

Saturday, May 1, 2010

Recommended reading


For students using GSoC mailing lists:
This will be probably announced soon:

For mentors: