惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Last Watchdog
The Last Watchdog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 热门话题
G
GRAHAM CLULEY
S
Schneier on Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
Recorded Future
Recorded Future
I
Intezer
云风的 BLOG
云风的 BLOG
博客园 - Franky
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
T
Tenable Blog
The Hacker News
The Hacker News
T
The Blog of Author Tim Ferriss
Attack and Defense Labs
Attack and Defense Labs
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
News and Events Feed by Topic
有赞技术团队
有赞技术团队
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
N
News and Events Feed by Topic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
The Register - Security
The Register - Security
B
Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
The Cloudflare Blog
Webroot Blog
Webroot Blog
W
WeLiveSecurity
H
Heimdal Security Blog
博客园 - 三生石上(FineUI控件)
V
Vulnerabilities – Threatpost
G
Google Developers Blog
O
OpenAI News
V
V2EX
罗磊的独立博客
博客园_首页
N
News | PayPal Newsroom
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
TaoSecurity Blog
TaoSecurity Blog
Cloudbric
Cloudbric
H
Hacker News: Front Page
博客园 - 叶小钗
T
Tor Project blog
AI
AI

ashishb.net

A day in Luxembourg - the richest country in the world I was asked to install malware during a fake interview Book summary: Breakneck - China's quest to engineer the future by Dan Wang Book summary: How to Teach Your Baby to Read Book Summary: The Discontented Little Baby Book by Pamela Douglas Introducing Amazing Sandbox - run third-party tools and AI agents securely on your machine Why software outsourcing gets a bad reputation? Book summary: The Natural Baby Sleep Solution by Polly Moore A day in Antwerp, Belgium Journey of online influencers Two days in Brussels, Belgium Shortcuts - when we love them and when we don't A visit to Rakhigarhi Three days in overhyped Paris Empty Japan, crowded Tokyo The real lock-in in GitHub is not the code, but the stars 11-day Norwegian Breakaway East Caribbean cruise Sanskrit and Sri Lankan Air Force Use REST with Open API The Achilles heel of American capitalism Costa Rica in 4 days At a juice stall in Sri Lanka A short stay at Warsaw, Poland Best practices for using Python & uv inside Docker Two days in Vilnius, Lithuania How IntelliJ IDEs waste disk space Pregnancy Why there aren't many digital nomads from India Two days in Riga, Latvia To keep your machine secure, run third-party tools inside Docker Family Ties in Your DNA: Some relatives are closer than others Doctors per capita Two days in Tallinn, Estonia Ship tools as standalone static binaries Made in America Two days in Helsinki, Finland Maintaining an Android app is a lot of work The land of good deals Two days in Oslo, Norway FastAPI vs Flask performance comparison Google Search is losing to Perplexity Two days in Dublin, Ireland Continuous integration ≠ Continuous delivery World's simplest project success heuristic London in 5 days It is hard to recommend Python in production Inflation, IRS, Credit cards, and Vendors Temu and the Chinese approach Things to do in Miami Florida Revenue vs Cost Axis Language learning as an adult The unanchored babies of the green card limbo Price variance in the United States A day in Louisville, Kentucky A surprisingly positive experience with Air India Unhospitable Airports Android: Don't use stale views USA = Union of Sales and Advertisement A day in Nashville, Tennessee Minimize Javascript in your codebase A day in Birmingham, Alabama In defense of ad-supported products Real vs artificial world The science behind Punjabi singers Hiking Mt. Fuji The Indian startup bubble is insane Repairing database on the fly for millions of users Book Summary: One up on Wall Street by Peter Lynch It is hard to recommend Google Cloud At the Prague airport Kyoto in three days Migrating from WordPress to Hugo Book summary: Sick Societies by Robert B. Edgerton Statistical outcomes require statistical games Illegal immigrants to Europe via Cairo Tokyo in three days Mobs are Status Games Writing Script matters as much as the spoken language Sri Lanka in 5 days LLMs: great for business but bad business Book Summary: Safe Haven by Mark Spitznagel Mac shortcut for typing Avagraha symbol On a bus with an asylum seeker Nicaragua in 5 days When to commit Generated code to version control Why I always buy a local SIM in a foreign country Use Makefile for Android Four days in Guadalajara, Mexico Android Navigation: Up vs Back Hotels vs Airbnb vs Hostels Currency issues in Argentina Abstractions should be deep not wide Some data on podcasting Always support compressed response in an API service A day in El Calafate - Patagonia, Argentina Hermetic docker images with Hugging Face machine learning models American Elections The sound of "ch" API services should always have usage Limits Hiking in El Chaltén - trekking capital of Argentina
Google I/O 2016: Android notes
Ashish Bhatia · 2016-05-19 · via ashishb.net

General

  1. Multitasking - multi-window mode and picture-in-picture mode. This includes the ability to launch window in adjacent activity, and drag and drop between activities.
  2. Notifications - Custom quick settings tile for an activity
  3. Multi-locale - users can specify locale beyond their primary locale
  4. ScopedDirectoryAccess for the shared storage
  5. New file-level encryption mode (as opposed to block-level encryption) and the corresponding Direct Boot
  6. Java 8, Jack, and ndk support in Gradle
  7. GCC deprecated in favor of Clang

TechTalk on Image size/compression

  1. PNG - Get image down to 256-bit palette (if possible) or compress them using Zopfli. Test the difference with butteraugli
  2. Convert PNG to Vector drawable using Potrace. Vector drawable are natively supported on Android 5.0 and above. Use compat to use them on the older versions. Or generate PNG for the older versions (not recommended)
  3. WebP is another option (Note: Speaker failed to mention that WebP is natively supported only on Android).
  4. Avoid JPEGs. They are usually larger in size.

Techtalk on App size

  1. Four types of sizes - raw apk size, download size (which includes expansion files), install size (apk size + oat files + extracted .so files), and update size ( binary diff)
  2. Resources.arsc is uncompressed since it has to be memory-mapped - don’t manually compress it. Instead, eliminate the bloat in it using blamer
  3. Native libraries are uncompressed. To use them without extraction, use “android:extractNativeLibs=false” (6.0+ only)
  4. Scrape unused configs using resConfigs
  5. Analyze third-party dependencies using " gradlew app:dependencies"

Techtalk on new App library

  1. New MessagingStyle notification and NotificationCompat#areNotificationsEnabled
  2. Faster Chrome custom tabs with preloading in the background
  3. Dropping support for versions below API 9
  4. Breaking library into multiple modules (similar to how Google Play Services were broken last year)

Techtalk on fragments

  1. ChildFragment creation was a mess and Google is trying to fix that.
  2. Don’t use Fragments when a ViewGroup will suffice.
  3. New FragmentTransaction#commitNow for synchronous commits but without side-effects of executePendingTransactions.
  4. Fragments allow high-level integration since they automatically plug themselves into activity life-cycles
  5. Use Activity#onInflate to provide config key etc. to a third-party fragment.
  6. There were tons of questions related to how to deal with IllegalStateException which happens when a FragmentTransaction is committed after Activity#onSaveInstanceState has been executed. Google’s answer was “it depends on the situation”.

Techtalk on themes and styles

  1. Themes and styles are both collections of key: value pairs (or key:value-type:value triplet)
  2. Styles are used for styling a View while Theme is used for setting the theme at the Activity level
  3. Themes inherit while styles overlay

Techtalk on effectively using Android Studio

The session was filled with effective use of Android Studio. Some useful tips are listed below

  1. Multi-cursor editing using Cmd + Shift + 8
  2. Ctrl-shift-<n> for adding bookmark, use ctrl-<n> to jump to that line
  3. _Object._ <Cmd-J> to see possible auto-generated code completion options on the _Object_.
  4. Ctrl-shift-space for smarter auto-completion
  5. Conditional breakpoints
  6. C++11 support is available (still experimental)
  7. adb shell setprop debug.checkjni 1 for JNI debugging
  8. Setting android.defaultConfig.multiDexEnabled = true in the gradle file will produce legacy multi-dex (which uses DexClassLoader) for API < 21 and modern multi-dex (ART supports loading multiple dex files natively). Incremental legacy multi-dex builds are slower than the modern. Therefore, for faster testing and debugging, add two targets, one <21 and one >= 21, and use the latter for debug builds.
  9. At least provide 4GB (Xmx4096m) for gradle to run

Android Application architecture for next one Billion users

  1. In 2000, 25% of 400M users were in the developing world. In 2016, 63% of 3B users are in the developing world.
  2. 90% of the urban population has at least 3G. 30% of rural population has at least 3G.
  3. Applications should work in the offline mode. And they should be optimized for bad networks.
  4. For the offline mode, remove the network from the user flow. Use a local persistent model, all user changes will be synced into this model. And the local model will be synced with the remote model when the network is available. Give feedback to the user on the local model change. Network feedback will always update the local model first and that will be synced to the view.
  5. Network and non-network tasks should be in different queues. So, if network tasks are pending, they should not block non-network tasks.
  6. Don’t just translate, localize the app.
  7. Text-free layouts are more global.
  8. Fetch lower quality content on 2G (and maybe re-fetch higher quality on 4G)
  9. Autoplay video only on fast networks. Google ExoPlayer automatically supports that.
  10. Rather than pre-fetching content using an AlarmManager, use JobScheduler (for API >= 21) or GCMNetworkManager (for older versions).
  11. Pre-fetching should not fill the internal storage. Warn the user before large pre-fetches.
  12. Check for the metered network and (deprecated) background data restricted setting.
  13. Search should work locally in the offline state.
  14. Auto-retry user’s state-change actions like sending messages. Or at least, show notification on the failure.
  15. Show “No Internet connected” banner
  16. Batch network requests
  17. When returning a photo URL, return its size as well, so, a good placeholder can be displayed till it is downloaded.
  18. For network-local model interaction, don’t think request-response. Think sync.
  19. For network-local model interaction, some versioning might be needed to perform the sync.

Techtalk on Recycler View

  1. ListView was not originally created for the infinite scroll social network streams. Developers started using various undefined features to make it work. That has made it even harder for Google to improve the ListView. Also, the animations are difficult with ListView.
  2. RecyclerView was created with infinite scroll streams in mind.
  3. It has a LayoutManager which decides the layout, scrolling, and bringing new items int the focus area.
  4. It has an Adapter which asks “what changed” not just “something changed”. The adapter creates the View/ViewHolder, binds an item, notifies the RecylerView, handles clicks and takes care of the recovery.
  5. RecyclerView gets the child from ChildHelper. Use AdapterHelper to synchronize calls to the Adapter.
  6. RecyclerViewPool pools unused ViewHolders (to avoid memory allocation/deallocation).
  7. ItemTouchHelper takes care of Drag and Drop.
  8. ItemDecoration is used for drawing on the RecyclerView canvas.
  9. ItemAnimator is used for animations when an item is added, removed, changed, or moved.
  10. Adapter and layout positions are not always in sync. That’s why helpers are important to perform the automatic translation.

Note: I missed a session on Espresso UI testing