A talk on which I try to explain some of the problems and concerns android developers (and mobile in general) have. That developing for android is not just drawing an UI to visualize data. As well as some libraries and suggestions by the community.
always available nor always speedy; - Can fail in a middle of a request => inconsistent state • Limited mobile data and battery; • Divided Attention (must be objective);
always available nor always speedy; - Can fail in a middle of a request => inconsistent state • Limited mobile data and battery; • Divided Attention (must be objective); • Handedness;
always available nor always speedy; - Can fail in a middle of a request => inconsistent state • Limited mobile data and battery; • Divided Attention (must be objective); • Handedness; • Small screens.
Email • name What is the user doing? (Activity API) • Walking • Running • Sleeping Where is your user? (Location API) • Location (latitude, longitude) Who or what are they near? (Places API) • Places • People
the application. • Broadcast Receiver - Subscribes OS events (ex: internet connection). • Service - Long running operations without a UI. • Content Provider - Manages access to structured data.
about android app architecture. • Aside from 2010’s Google IO talk by Virgil Dobjanschi on “Android REST client applications” which was very focused on android components like Content Providers (that are rarely needed), Services, Loaders (not suitable for network requests). • Last year on Android DevSummit, Google did a talk on android apps architecture; • This is a 5 years gap. • In between, the community came forward with different solutions.
for the User Experience; • Offline or online use must be transparent to the user. • Pending web requests should be persisted until performed. • The best apps are not only the most clean and simple to use but those that sync online with offline like magic. • Google Keep, Gmail, Pocket Casts, etc.
using observable sequences for the Java VM.” • Helps a lot with its threading API. • Contains operators to transform, filter and convert multiple sets of data;
using observable sequences for the Java VM.” • Helps a lot with its threading API. • Contains operators to transform, filter and convert multiple sets of data; • Handles errors in a clean and organised way;
using observable sequences for the Java VM.” • Helps a lot with its threading API. • Contains operators to transform, filter and convert multiple sets of data; • Handles errors in a clean and organised way; • RxAndroid adds a specific scheduler for the UI thread;
using observable sequences for the Java VM.” • Helps a lot with its threading API. • Contains operators to transform, filter and convert multiple sets of data; • Handles errors in a clean and organised way; • RxAndroid adds a specific scheduler for the UI thread; • RxBindings adds RxJava binding APIs for Android UI widgets from the platform and support libraries.
• And for the presentation layer: • Espresso • Android Instrumentation Testing • MonkeyRunner • Mockito and JUnit can also be used in the data layer as well as the domain layer.
Turn your http api into a java interface: public interface GithubApi { @GET("group/{id}/users") Call<List<User>> groupList(@Path("id") int groupId, @Query("sort") String sort); } 2 - Create a retrofit instance: Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://api.github.com") .addConverterFactory(GsonConverterFactory.create()) .build(); 3 - Instantiate it and perform the request: GithubService service = retrofit.create(GithubService.class); Call<List<User>> response = service.groupList(10,"asc");
until completed. We should prevent the loss of data, in cases like when we run out of battery, the system crashes or the app closes. • Tape - by Square • Android Priority Job Queue - Yigit Boyar
seems, since we should: • Cache images (since downloads are costly) • Load them as fast as possible • With little memory footprint • UI Lifecycle aware Fortunately Glide does all of this (and more), through a simple api: Glide .with(myActivity) .load("www.images.com/image.png") .centerCrop() .placeholder(R.drawable.loading_spinner) .crossFade() .into(myImageView);
stream semantics (RxJava). Apps still need to implement SQL logic. • ORM - (ActiveAndroid, OrmLite, SqlBriteDAO, etc) add an abstraction over SQL. • RealmDb - Closed source c++ database with java bindings. Simple to use and generally fast.
was introduced to the Android experience. • Days after the announcement, Google provided a spec sheet on how to design android applications. • However, implementing some of those behaviours and components was usually very hard.
was introduced to the Android experience. • Days after the announcement, Google provided a spec sheet on how to design android applications. • However, implementing some of those behaviours and components was usually very hard. • Almost a year later, Google announced the Design Library to help developers achieve a consistent visual experience in a easier way.
view Hierarchies • RelativeLayout does two measure passes. It’s usually negligible but with nested complex RelativeLayouts, could be a problem. • Avoid nesting weights on Linear layouts
caused by setting the alpha property on the small little circles under the title. • This means there are more reasons for performance problems than the previously mentioned. GOOD BAD
caused by setting the alpha property on the small little circles under the title. • This means there are more reasons for performance problems than the previously mentioned. • Android doesn’t like the blur effect either. :( GOOD BAD