Starting the Reactive Journey

Share if the site was helpful

Starting the Reactive Journey

If you’re an Android developer, then odds are you’ve heard of RxJava.  It’s a popular library that utilizes the observer pattern.  Rx (ReactiveX) allows us to program reactively, meaning our code can be executed as events happen.  It’s tough to fully wrap your head around it at first, but once you get it your codebase can become more efficient and clean.

The Observer Pattern:

The Observer pattern (and RxJava) revolves around three key concepts.  The three O’s: observables, observers, and operators.  When combined these three allow us to emit information, modify it, and then react to it.  The best way to think about the observable pattern is to consider everything a stream. Data starts at the top of a stream and flows downhill.  On its way down things can happen to it to modify the data, and then at the bottom of the hill we use the data.

This is a high-level view of how the observer pattern works.  Think of observables as the top of the stream, operators changing the data on its way down, and observers as the bottom of the hill.  Ok, maybe this analogy will make a little more sense after you learn a little more about each of these O’s.

Observables:

An observable is something that can be observed.  It is something that emits data that we can react to.  A good example that already exists in Android is a button.  Whenever a button is pressed by the user it emits data. That data is basically just saying “I was pressed”, but it’s still data emitted from an observable!  What we do with that data is our option and none of the observable’s concern (think about the standard Android button; it just knows it was pressed, we write the logic for what it does).

So an observable is…literally something that is observable.  Real life examples could be a movie playing or a singer singing. These are things we could watch happen, but they don’t really impact us until we observe them.  Which brings us to the bottom of the stream.

Observers:

We’ll skip over operators right now and jump straight to observers because they are essential to this paradigm. So we have a movie playing already (the observable), and once we turn on the TV to watch it we have become the observer. The data (movie) is coming to us and we can react to it however we want.  Likewise, with an observer in Android we can write a function to react to the data an observable emits.

In the RxJava world observables don’t always have to emit just one piece of data, that’s the beauty of it.  They can emit thousands and thousands of pieces of data, and then observers can react to each and every piece of data if they see fit.  And just like multiple people can watch one tv, multiple observers can observe one observable.

Wrapping Up:

It’s a lot of “o” words I know, but the concept is pretty simple.  Observables emit data, observers react to it.  We’ll dive into plenty of code in part 2, so stay tuned for that as well as examples of how operators come into the mix!  RxJava takes a little while to get down, but once you do it’s too addictive to quit!

Samsung Leaks Unfold

Share if the site was helpful

Samsung Leaks Unfold

The newest trend in Mobile is upon us.  We’ve seen generation follow generation of smartphones each with more features than the last, and while the software has changes dramatically the physically devices have just changed in size.  2019 is the year that this changes as the world adopts its first foldable phones (again!).

Samsung’s Leak(s)

Samsung announced the arrival of its first foldable phone a few months ago, but other than a few concept picture’s it’s just been floating around.  At their developer conference in November they unveiled the Infinity Flex flexible screen giving us a sneak peek at that idea.  Next week we can expect to see quite a bit more about this concept though.

The Galaxy S10 Unpacked event is scheduled for February 20th, and we have good reason to believe this event will also bring news about the foldable device. Ishan Agarwal, a reputable leaker, posted a GIF on twitter showing a demo of a phone folding.  With it he said

“EXCLUSIVE! Looks like Samsung’s sticking with the name ‘Galaxy Winner’ for the Foldable Phone right now. As far as I can see, the product page for special phone will be live after the event as well! Doesn’t exactly looks like a final name but it is I guess. Welcome Galaxy Winner!”

Winner is the rumored codename for the Galaxy F right now, and if what Ishan posted is true, then we will be seeing two new product pages after the event.

More on the S10:

There’s a lot of hype around the Galaxy F since it’s a revolutionary product, but let’s not forget the S10 is making its debut.  One of Samsung’s biggest leaks ever has just taken place releasing full specs for the three new phones we’ll be seeing soon.  These are the Galaxy S10e, S10, and S10+. It looks like they’ll range in size from 5.8 inches to 6.3, along with a side fingerprint sensor and facial recognition.

There’s no lack of pixels on these screens either.  The S10e weighs in at 2280 x 1080 with 438 ppi, the S10 at 3040 x 1440 with 550 ppi, and the S10+ at 3040 x 1440 with 522ppi.  We have some great displays on their way, and they’ll be running the newest software for a superb user experience.

Why So Sudden?

With the world waiting to see more of the S10 next week, why would Samsung mesh in a release of such a groundbreaking phone at the same event?  Because of healthy competition.  Huawei will likely be unveiling their first foldable handset later this month as well, and if you’re not first you’re last.

I’m sure we’ll see this trend in quite a few phone makers over the next year or two, and I’m particularly interested to see if Google takes any action with a foldable Pixel.  What are your thoughts on foldable devices?  Let us know in the comments below!

 

Magic Leap is Moving into Mobile

Share if the site was helpful

Magic Leap is Moving into Mobile

Augmented reality has been all the rage the past few years.  From headsets to mobile apps we’ve seen it start to infiltrate every piece of technology.  One of the companies behind this infiltration is Magic Leap.  They released their first headset last August after nearly 10 years of development work.  And now it seems their looking to up the ante by bridging the gap between headsets and phones.

Magic Leap’s History:

Magic Leap has been flying under the radar for quite some time now.  Their central product is a head-mounted virtual retina display which superimposes 3D images over real-world objects.  That’s the fancy way of saying AR goggles.  And fancy they are!  The company has raised more than $1.4 billion in investment capital since 2010 and in 2016 was valued at $4.5 billion by Forbes.

So the company has some serious backers, and in 2018 when they released their goggles for the first time they were available only to investors.  I wish I could say I’ve tried them on, but I unfortunately can’t attest to their experience.  CNBC, however, was granted an exclusive trial run of the goggles and the description is quite amazing.

Their tester wrote about how he was able to “place” a tv anywhere in a room to watch an NBA game. What’s more he could also place a 3D rendering of the entire game on the floor and walk around it seeing live gameplay from every angle.  Seriously, just think about this for a second and all the possibilities it holds!

Seeking AR Mobile Developers:

The goggles can already do some pretty sweet things, and when they came out in August they came with a mobile support app.  The main purpose of this was to help users with setup, but it seems now Magic Leap is hoping to go further.  Earlier this month they posted a job description for a senior software engineer with experience in mobile AR.  The description says

“In this role, you will help build a cross-platform framework that enables large scale shared AR experiences between mobile devices (iOS, Android) and Magic Leap devices. Your work will include implementing high-performance, production quality AR and computer vision algorithms, and designing and building the Magic Leap mobile SDK.”

ARKit and ARCore:

It also lists the developer should have experience with ARKit and ARCore, the AR frameworks by Apple and Google respectively.  The company’s CCO spoke on this saying that undoubtedly the whole world will not use Magic Leap’s goggles, but they should all have access to a smaller version of the experience.  Rio Caraeff said “…if there’s a 500 foot tall dragon in Central Park, you know we all want to see the dragon, not just the people with Magic Leap. And so we need an interoperability solution.”

Regardless of if you’re interested in Magic Leap as a company, the simple fact that AR is penetrating every corner of our world is undeniable.  That being said, the sooner you get in on the action the more likely you are to ride the wave up!  What are your thoughts on Magic Leap’s goggles?  Let us know in the comments below.

 

I/O 2019 Is Upon Us

Share if the site was helpful

I/O 2019 Is Upon Us

Mark your calendars, Google 1/0 2019 has been announced!  The company’s annual developer conference will be kicking off May 7th and run though the 9th.  Google tweeted about the event yesterday, and as usual it looks like there are some exciting things on the agenda.

Flash Back To 2018:

Last year’s I/O was a particularly exciting one, and there were a few core themes behind it.  While buzz-wordy, the event revolved around the ideas of Machine Learning and Artificial Intelligence.  We got to see demonstrations of Google’s Duplex making a phone call, as well as learning about what Android P brought to the table.  It offered improved battery life, brightness, and app suggestions to refine the mobile experience for users.

Up This Year:

Last year had a lot of interesting concepts, and this year is sure to be even more impressive.  It’s far too early to say everything that will be taking place in this year’s reveals, but there are a few things we can be certain are on the agenda.  The first of these is of course a new version of Android.  Following it’s alphabetical trend, Q is next on the roster.

We’ve talked a little about Q here before but very little has been revealed thus far.  Rumors have it that the new version will be featuring an expansive Dark Theme for battery saving and, well because dark themes are all the rage right now.  There is also discussion about a change to the android activity life cycle to include a multi-resume.  This could allow for easier interaction with multiple apps at the same time when using split screen on your phone.

Watch and Learn:

Many believe we are about to see the reveal of a Pixel Watch.  iOS has definitely been the dominant culture when it comes to accessories for your primary device, but that’s all the more reason for Google to try and match it.  No leaks have come yet regarding what it will look like but news that Google bought $40 million of smartwatch technology and researchers from Fossil is a definite hint that big things are coming.

There are also bound to be Google Assistant improvements this year, an we could see these play a big role in how the watch functions for things like speech-to-text. Duplex was demoed last year but we haven’t seen to much of it in the real world up until the last few months either.  I would predict the artificial intelligence of the Assistant opens up a few new doors this year.

Fuchsia is the Future:

And of course there is the ever prevalent mystery that is Fuchsia in development.  Said to be Android’s replacement, Fuchsia is on the rise and will likely be utilized in some demos this year.  It’s a ways off from being the new OS for smartphones, but it’s been development for a few years now and it is starting to make it’s way into the limelight.

For the fourth consecutive year the event will be held at the Shoreline Amphitheater in Mountain View, California.  What are you most excited about for Google I/O 2019?  Do you have any predictions about what we may see this year?  Let us know in the comments below!

 

Microsoft Moving Out Of Mobile

Share if the site was helpful

Microsoft Moving Out Of Mobile

It’s the end of an era for Microsoft phones.  While back in 2017 Microsoft announced they were done developing new hardware for their devices, now they’ve decided to end support altogether.  Security and software updates will be coming to a close In December of this year.  It’s time to move on to an Android or iPhone.

Failure To Launch:

The company once had huge plans for their mobile phones, but things never really took off quite as expected. The Windows Phone 7 launched in 2010, but now less than a decade later Microsoft is moving out of the mobile hardware industry. Back then Microsoft touted that the emergence of their phones would be the death of both BlackBerry and iPhone. One of these has come true, but the other…not so much.

There are many reasons for the Windows phones not resonating with users, but a hefty one was the lack of apps in the app store.  Many popular apps on Android and iOS devices simply weren’t available for Windows users. Now Microsoft has decided to bypass this issue and instead focus on providing its services to other carriers. 

The Future of Mobile For Microsoft:

Microsoft phones may be done for, but the company’s future in mobile is far from over.  They’ve invested heavily in making Office products available on both Android and iPhones.  They also have a partnership with Samsung, who sells some of their Galaxy phones with Office pre-installed.

Android seems to be the mobile choice that Microsoft has embraced.  With an Android launcher and upcoming app mirroring support, users moving away from Microsoft phones will likely lean towards that option.

Moving Forwards:

It’s no huge surprise that Microsoft dropped support for Windows 10 mobile, since the same thing happened for the Windows Phone 8.1 in 2017.  While Microsoft will be playing a role in mobile phones down the road, their attention has shifted elsewhere.  They’re still a mega player in the tech world (we just wrote about their changes to GitHub).

Still, Microsoft is urging users to move to either one of the two main players.  They said “With the Windows 10 Mobile OS end of support, we recommend that customers move to a supported Android or iOS device.  Microsoft’s mission statement to empower every person and every organization on the planet to achieve more, compels us to support our Mobile apps on those platforms and devices.”

What are your thoughts on the end of Microsoft mobile support?  Will these phones be missed or is it best that Microsoft focus their efforts elsewhere?  Let us know in the comments below!

 

Private Repos Coming to a Website Near You

Share if the site was helpful

Private Repos Coming to a Website Near You

Chances are you’re familiar with GitHub, the web-based hosting service for version control.  It’s where many developers go to save their code online or share it with others.  While GitHub is free to use, if you wanted more privacy then that cost money.  At least it used to!

Free Private Repos:

Earlier this week GitHub underwent a change.  Users are now allowed to host as many private repositories as they want.  A dramatic change considering this feature used to cost $7 a month.  Private repos are free to use with up to three collaborators, and public repos still allow for unlimited collaborators.

The number of collaborators is the only real limitation on private repos, and the change is aimed at improving the version control experience for smaller fish in the development pool. The idea being that if you’re on a small team or an individual you won’t have to pay the fees larger companies do. 

GitHub’s Going Through Changes:

GitHub has been making headlines a lot in the past few months. In October Microsoft completed their $7.5 billion acquisition of it.  In November of 2018 GitHub passed 100 million repositories (and that number could sky rocket now that anyone can utilize private repos for free).

A number of pricing changes have come along with free repos, but this is the most noteworthy for individual developers.  Originally called GitHub Developer, the $7/month plan has been rebranded to GitHub Pro.  The company also offered GitHub Enterprise and GitHub Business Cloud for $21 each and has now consolidated them into one $42/month subscription.

Moving Forward:

It’s worth noting that these changes bring GitHub more in line with other version control services like Bitbucket and GitLab.  The former allows unlimited private repos with up to five collaborators, and the latter has no limit.

This is definitely a plus for GitHub users like myself, but it by no means that public repos will come to an end.  The development community thrives on open source technology.  That being said having options is certainly nice.  What are your thoughts on Microsoft making private repos free? Let us know in the comments below!

Keep The Resolutions Going With Phonlab

Share if the site was helpful

Keep The Resolutions Going With Phonlab

We’re one week into the new year, and hopefully sticking with resolutions.  The most common goals tend to revolve around exercising, eating healthier, or learning something.  We can’t help you out with the first two, but if you’re looking to pick up a new skill this year you’re in luck!

Mobile Developer Courses:

Phonlab’s Mobile Development courses offer a great affordable way to learn app development.  Whether you’re completely new to programming or looking to add a new skill to your repertoire, it’s worth it.  These courses will take you from writing your first line of code all the way up to publishing your first app on the Google Play Store or Apple App Store.

Coursework is great, but really sets Phonlab apart from other online educational materials is the personal touch.  As you’re learning you’ll undoubtedly get stuck. Instead of having to spend hours researching your issue, you’ll receive personalized support walking you through solutions.

What’s in a Lesson?

Depending on your level of dedication, you could go from never programming to publishing an app in less than a month.  And you only have a few spare hours a week, fear not!  With Phonlab’s one-time payment you get access to the coursework forever.  You can either speed through the course again and again or take your time and absorb all the knowledge it has to offer.

And that knowledge covers all the core topics in mobile development.  Whether it’s Material Design tips for how to create an aesthetic layout of images, or efficiently downloading information from online and displaying it to users, there’s a video teaching it.  These videos feature footage of apps being built in real time with audio explaining every step.  And along with the actual creations are animations helping to explain any tricky concepts.  The goal is to make it as easy as possible for you the developer.

Sign Up Today!

If you’re interested in taking your programming skills to the next level or starting at line 1, I’d definitely recommend you check out these courses.  Who knows, by the end of 2019 you may be making apps for a living.

Pie Is On The Roll

Share if the site was helpful

Pie Is On The Roll

Pie made its debut earlier this year on Pixel devices, and since then other users have been waiting patiently for it to expand.  Now Christmas presents have been delivered and Android has begun rolling out Pie to a number of other devices.  So read on and see if Google got you anything for the holidays.

Android Is SLOW:

Android’s OS offers some incredible experiences, but there’s no denying that rollouts take forever.  Roughly a year after Oreo’s release it made it onto 12% of Android phones.  Five months after its release it was only at 1%!  While these statistics aren’t perfect due to factors such as the Play Store’s unavailability in China, it still paints a good picture.  Things move slow.

With rollouts taking so long, every new wave of devices is big news when it’s yours.  Today rollouts have begun to a number of new phones.  These include the Galaxy S9/S9+, the OnePlus 5/5T, and the Infinix Smart 2 (a very popular phone in India).  Older phones will be receiving this update as the year goes on, but Christmas came just in time for these parties. 

Times Are Changing:

The Android circle of life must continue.  As new versions like Pie come out, they replace the older ones.  With a shrinking number of phones running earlier versions of Android support for them becomes difficult in an efficient manner.  Earlier this month Google Play Services ceased support for Ice Cream Sandwich.  The version came out seven years ago, and it’s userbase has dwindled below the 1% mark for a while. 

And along with this new Android apps must target at least Oreo when they are released to the Play Store.  It may seem tough to leave users behind, but it really just makes sense.  At a certain point upgrades need to take place so that companies/developers can make new features available in their apps without having to worry too much about ancient versions. 

There is still a span of versions that run any app on the Play Store, but the line has to be drawn somewhere.  The good news with this is that deprecating versions simply means that new and improved versions are being released.

Pie Is Hot

And for the most part Pie has been just that; new and improved.  Having played around with a Pixel 3XL running Pie for some time I have to say that its user interface has been very pleasant.  Pixel users have experienced a some bugs over the past months, but nothing has come close to outweighing the pro’s the new version has offered.  My personal favorite has been Google Call Screen to identify unknown numbers.  I’ve taken 0 calls from telemarketers since upgrading to this phone!

There are certainly things users wish Pie could do that it doesn’t.  One of these being multi-resume.  The software allows users to have two different apps open simultaneously, but as the Android Activity Lifecycle is currently implemented only one can be in the resumed state at a time.  This can lead to funky behavior if you’re trying to play two videos as the same time, but there are already rumors that this is in the works. 

The bottom line is Pie rolling out is good news, and it’s sure to continue doing so as time goes on.  Hopefully Pie proves to roll out faster than previous Android versions, but only time will tell.  And if you want to run your phone on a different version flashing is always an option.  What are your thoughts on the Pie rollout?  Let us know in the comments below!

Reduce, Reuse, RecyclerView

Share if the site was helpful

Reduce, Reuse, RecyclerView

Mobile users have developed a rigorous set of standards in the past few years.  If an app takes more than a few seconds to launch, they’re annoyed.  If a button takes more than one second to react to a click, there will be some uninstalls.  With such high expectations for performance app developers need to make sure they do everything in their power to speed up their apps. 

RecyclerView For Efficiency:

The Android OS has grown alongside user expectations.  New libraries and views have emerged to offer improvements to an app’s efficiency.  One of these that EVERY Android developer should know is the RecyclerView.  RecyclerView is (as defined byAndroid) a flexible view for providing a limited window into a large data set.

Basically, think about every list you scroll through on an app.  Odds are that list is a RecyclerView.  The idea is you can map out how large you want the space to be on a user’s screen, and then that portion of the screen will be scrollable showing a number of smaller layouts.  Each of these can be designed however you see fit. 

Think of Spotify’s list of songs in your library for example.  Each layout in the list holds TextViews displaying the song name, artist, an ImageView of the album cover, and an arrow on the right indicating you can click on it for more information.  This layout is used again and again but different information is loaded into it each time.

But How Is It Efficient?

So if you saved 2000 songs to your library then every time you open the app you’ll have to load 2000 layouts? That sounds like an awful user experience as they have to wait.  No you won’t, and that’s the beauty of a Recyclerview.  Your app is only going to create 10-15 of those layouts. Then as you scroll it will empty the top layout’s info, kick it back down to the bottom of the RecyclerView, and load it with new data. 

Your app has all the info from the list, but it only has to create views for items as they appear to the user.  And once a few views have been created, it won’t ever have to make new views since it recycles them as you scroll.  I wonder how they came up with the name RecyclerView…

Setting Up RecyclerView

Adding a RecyclerView to your app’s layout is not too complicated, but there is a fair amount of work involved.  Phonlab’s Android App Developer Course shows a detailed step by step tutorial, but we’ll cover the 30,000ft view here.  The process essentially breaks down into two parts:  Your layout and your adapter.  The layout is more straightforward; it’s you creating an xml wireframe view for where you want the info to load.  What should a layout look like when it’s given the proper info?

The adapter is a little more complicated.  There are three methods that your RecyclerView adapter will override.  These are onCreateViewHolder(), onBindViewHolder(), and getItemCount().  In order these tell your adapter what to do when creating a new layout, adding new data to a layout, and how many items are in the list total.  onCreateViewHolder will be called every time we need to make a new layout, but once the initial work is done and a user begins to scroll onBindViewHolder will be where you add click listeners and other interaction logic.

Seeing it in action:

After you have all of your logic for loading the data into a ViewHolder (layout) you need to create an instance of the RecyclerView in your app.  Then set the RecyclerView’s LayoutManager and Adapter using the class’s methods.  If everything is set up correctly and you’ve added an xml RecyclerView in your parent layout, then clicking run should show your scrollable list of views.

It’s essential your app meets current standards for efficiency.  RecyclerView is a great way to improve responsiveness.  With it you can present users with immense amounts of data without slowing down their experience at all!

Configuring Features With Remote Config

Share if the site was helpful

Configuring Features With Remote Config

Here’s a scenario for you: you built an app that is now being used by thousands of people.  It’s a huge success, but you want to really make it pop with some live updates.  Let’s say on Halloween you want your app to be black and orange, but on Christmas you want users to see red and green.  There’s a way to do this, and it’s shockingly easy with Firebase Remote Config! 

Rolling Out Updates:

Rolling out changes to your app is not an incredibly difficult process.  If you know what you’re doing you can do it in a matter of minutes.  Getting those changes into user’s hands worldwide…well it’s another story.  Android users can be somewhat reluctant to update their apps, and months after a release you may still have users running older versions.  In fact, this is almost a guarantee.

With user’s taking a long time to update to newer versions of your app, you can’t just create a new release with orange and black colors the day of Halloween.  Even if you target 100% of your users in the rollout it won’t hit the majority within a day.  Instead you need to create a feature that you can toggle on and off from a remote location. Enter the aptly named Remote Config.

Firebase Remote Config:

Remote Config is one of the many features Firebase offers for superior app development.  It allows developers to create variables and update their values from the Firebase console.  So for our example above, we could create a currentColor variable and set it to orange.  Then when we want the app to change color we can go online and change currentColor to green. No release necessary, and as long as we set things up in the app to read this correctly, any users logging on will now see a green screen.

This is great news for us as developers, but it gets even better.  Implementing remote config is EASY. 

Step one: create a FirebaseRemoteConfig instance using the class’s method getInstance(). 

Step two:  call the config’s method fetch( Long cacheExpiration) and pass in a time interval.

Step three: add an OnCompleteListener to the result of ‘fetch’ which calls activateFetched()

Step four: get the specific value by calling the config’s method getString(String) and pass in the variable name as it shows up in Firebase.

Thats It!

 After doing these four steps your app will have a variable to use however you want in the rest of your logic.  The uses for this are endless if you apply the right amount of creativity.  The important thing is that you can now change parts of your app without having to release new versions!

Firebase has lots more to offer, and if you want to learn about some of these other features you should either check Firebase’s website or Phonlab’s Android App development courses!

en English
X