(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // | |
| // Find contact based on name. | |
| // | |
| ContentResolver cr = getContentResolver(); | |
| Cursor cursor = cr.query(ContactsContract.Contacts.CONTENT_URI, null, | |
| "DISPLAY_NAME = '" + NAME + "'", null, null); | |
| if (cursor.moveToFirst()) { | |
| String contactId = | |
| cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID)); | |
| // |
| Download the following ZIPs: | |
| ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links) | |
| Download the correct GApps for your Android version: | |
| Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip) | |
| Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip) | |
| Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip) | |
| Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip) | |
| Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip) |
| Native Browser JavaScript | |
| >>> abc | |
| => undefined |
| (function() { | |
| var app = angular.module('app', ['ionic', 'ngCordova']); | |
| app.factory('GeoService', function($ionicPlatform, $cordovaGeolocation) { | |
| var positionOptions = {timeout: 10000, enableHighAccuracy: true}; | |
| return { | |
| getPosition: function() { |
| //BasePresenter.java | |
| public interface BasePresenter<V extends BaseView> { | |
| /** | |
| * Set or attach the view to this presenter | |
| */ | |
| public void attachView(V view); | |
| /** | |
| * Will be called if the view has been destroyed. Typically this method will |
| public Observable<List<Profile>> reloadProfiles() { | |
| return mJobAppApiService.getAllProfiles().subscribeOn(Schedulers.io()) | |
| .concatMap(new Func1<List<Profile>, Observable<List<Profile>>>() { | |
| @Override | |
| public Observable<List<Profile>> call(List<Profile> profiles) { | |
| return mRealmProfileRepo.setProfiles(profiles); | |
| } | |
| }); | |
| } |
| @Override | |
| protected void onDestroy() { | |
| super.onDestroy(); | |
| if (mSubscription != null) mSubscription.unsubscribe(); | |
| } |
| @Override | |
| public void onError(Throwable e) { | |
| getMvpView().hideProgressIndicator(); | |
| if (e instanceof IOException || e instanceof HttpException) { | |
| mDataManager.getProfiles().subscribe(new Action1<List<Profile>>() { | |
| @Override | |
| public void call(List<Profile> profiles) { | |
| renderProfilesUi(profiles); |