Tag Archives: Programming

Android Oreo

How to Optimize GPS and Background Processes for Android Oreo

As our past article Android Oreo Serves Up the Sweets will show, Android Oreo lived up to expectations upon release and gave both consumers and app developers plenty of enhancements to enjoy.

However, for app developers, enhancements to the UI aimed to conserve battery life affect GPS services and require changes to the code in order to optimize pre-existing apps for the new OS. Specifically, Android Oreo restricts apps that are running in the background with limited access to background services. Additionally, apps can no longer use their manifests to register for most implicit broadcasts. When an app is in the background, it is given several minutes to create and use services, but at the end of that time slot, the app is considered idle and the OS will stop running background services.

These changes directly affect apps with geolocation functionality. Android Oreo limits how frequently apps can gather location in the background. Background apps can only receive location updates a few times each hour. The APIs affected due to these limits include Fused Location Provider, Geofencing, Location Manager, Wifi Manager, GNSS Measurements and GNSS Navigation Messages.

Apps that currently use location services in previous Android OS’s will require an update to optimize for Android Oreo. Apps that use location services range anywhere from navigational apps like Waze and Google Maps to social media apps like Twitter, and food apps like Yelp and Seamless.

For apps that require frequent location updates, increasing the usage of the app in the foreground will ensure that the app gets frequent access to location information. In order to program this, developers must implement startServiceinForeground() instead of startService() in Activity class.

In Service class in onStartCommand(), developers can use the following code:

Screen Shot 2018-05-07 at 12.46.57 PM

Via StackOverflow

When foreground services running in the background consume high energy, Oreo fires an automatic push notification to the user informing them of the battery-consuming service. With the push notification in place, app users are more likely to uninstall apps that track location without conserving battery life, putting the onus on software developers to deliver battery-efficient apps. One of the biggest issues facing some app developers is ensuring that battery life is not sucked as a result of tracking location in apps. Check out our full rundown of how to build battery-efficient geolocation apps for supplementary reading.

The results of the limits put in place with Android O are increased battery life for the user and the necessity for app owners to consider how their apps interact with location information. Retaining a thorough understanding of how location information will be retrieved and used through out the development process ultimately benefits both software developers and consumers with better UI and more energy efficient processes.

Data Encryption

How to Safely Encrypt Sensitive Data in Your Mobile App

In November 2014, cybercriminals perpetrated one of the biggest cybercrimes of the decade. They hacked into Sony’s computer systems, stole sensitive data, paralyzed the company’s operations, and gradually leaked embarrassing information to the media. The hackers threatened to continue until Sony agreed to pull the controversial comedy The Interview from its theatrical release.

As the headlines will tell you, the encryption of sensitive data is one of the most important investments a company can make. Facebook is currently under heat for data protection practices. The UK National Crime Agency called WannaCry a signal moment for awareness of cyberattacks and their real world impact. With the stakes higher than ever, the encryption of sensitive data in apps has never been more important.

Here are our top tips on how to safely encrypt sensitive data in your mobile app.

TIP #1: Coding and Testing

Writing secure code is fundemental to creating a secure app. Obfuscating and minifying code so that it cannot be reverse engineered is critical to keeping a secure environment. Testing and fixing bugs when they are exposed should be an ongoing investment of resources as it will pay off in the long run.

Tip #2: Scramble Data

Sometimes, the best method of encrypting data is scrambling. Software and web developers often become obsessed with storing every bit of data in databases and logs, assuming it may be useful later, but doing so can create a target for cybercriminals.

Cunning developers will only store a scrambled version of the data, making it unreadable to the outside eye, but still useful for those who know how to query it correctly.

For an in-depth dive into scrambling data, check out this awesome essay on how Amazon does it.

Tip #3: In Transit Vs. At Rest Encryption

There are two types of data to be encrypted: in transit data and at rest data. In transit data is moving data, be it in transit via email, in apps, or through browsers and other web connections. At rest data is stored in databases, the cloud, computer hard drives, or mobile devices. In transit data can be protected through the implementation of robust network security controls and firewalls. At rest data can be protected through systematically categorizing and classifying data with data protection measures in mind.

Tip #4: Secret Vs. Public Key Algorithms

Secret Key Algorithms are algorithms that use the same key for encryption and decryption. Public-key algorithms us two different encryption keys, one for encryption and the other for decryption. The public key is how the data is sent and the private key decodes it. Public-key algorithms are more secure, but require more computer processing power.

Tip #5: Blockchain Cryptography

We’ve covered the Blockchain in our past article on The Revolutionary Mechanics of the Blockchain. Blockchain cryptography has been on the rise because blockchain databases are distributed and thus more resilient in the face of a DOS attack.

Tip #6: Apps that Clean Up after Themselves 

Apps that collect sensitive information don’t necessarily need to store it. It is wise to delete sensitive data from mobile apps when the data is no longer in active use.

Tip #7 Choose the Right Algorithm

There are several popular pre-existing algorithms in existence that can be used to encrypt sensitive data in mobile apps. Check out UpWork’s awesome rundown:

  1. Advanced Encryption Standard (AES)
  2. RSA
  3. IDEA
  4. Signal
  5. Blowfish and Two Fish
  6. Ring Learning With Errors or Ring-LWE

Over the last 10 years, enterprise-wide use of encryption has jumped by 22 percent according to the Ponemon Institute. When building a mobile app, investing in encrypting sensitive data will pay off in the long run and haunt those that short-change it.

toptal-blog-image-1407508081138

Everything You Need to Know About Machine Learning

A calculator can solve complex problems which would take even the most savvy mathematicians an incomparable amount of time. Artificial intelligence has become one of the most hotly debated and highly funded aspects of technology because the speed at which machines can process information yields innumerable possibilities and applications which can and will benefit humanity. One of the first popular incarnations of AI is Machine Learning.

Machine Learning is the ability for a computer to learn without being explicitly programmed. Machine learning focuses on computer programs which can identify patterns and create its own algorithms when exposed to new data. It is used in self-driving cars, in newsfeed algorithms on social media, in evaluating job candidates, in recognizing faces on your phone, and more.

The most powerful form of machine learning currently active is called “deep learning”. “Deep learning” builds a complex mathematical structure known as a neural network out of vast quantities of data. Machine learning’s ability to handle mass amounts of data makes it crucial to the advancement of IoT. The IoT collects enormous amounts of data which require computers with machine learning to recognize patterns and create algorithms.  In self-driving cars, IoT cameras and sensors in each autonomous vehicle absorb their surroundings and turn them into huge amounts of data. The data is then sent to the cloud where it is accessible to all autonomous vehicles on the road. Thus, when one self-driving car makes a mistake, all of them learn. In conjunction with the Internet of Things, machine learning will be vital to the building of a smartworld.

TOP PROGRAMMING LANGUAGES

Machine learning requires a great deal of statistical analysis; it demands an intelligent programming language which can process a number of complex issues and general paradigms.

R: Considered a statistical workhorse, R has emerged as one of the top programming languages for machine learning. R is intended for advanced users because of its complex nature and wide learning curve.

Python: A rising star for machine learning, Python is a data science book which has been in use in the manufacturing industry for awhile. Python gives users direct access to predictive analytics, making it the foremost data science language. Developers turn to Python when they are looking to frame better questions or expand the capabilities of their existing machine learning systems.

MATLAB/Octave: Millions of engineers are already using MATLAB, a matrix-based language, to analyze and develop cutting edge systems. MATLAB has emerged as the simplest way to demonstrate computational mathematics.

MACHINE LEARNING AND iOS 10

Machine learning laid much of the groundwork for the biggest upgrade in iOS 10. It is very difficult for computers to comprehend the intricacies of the human language. Machine learning has enabled iPhones to sense contextual clues with increasing confidence, improving iMessage’s ability to autocorrect and for Siri to understand the particulars of your vernacular. In the iPhone 7 camera, machine learning allows the device to separate the background from the foreground to achieve amazing portraits once possible only with DSLR cameras.

MACHINE LEARNING AND ANDROID

Google is among the dominant forces in machine learning. Much of Google Search’s prominence is owed to advances in the machine learning field. In November 2015, Google released TensorFlow, an open-source software library for machine intelligence. TensorFlow effectively simulates “deep learning” neural networks across different computer hardware and offers a straightforward way for users to train computers to perform tasks by feeding them large amounts of data.

Google uses Tensorflow in many of their internal processes, including RankBrain for information retrieval, image classification, SmartReply, and more.

MAXIMIZING MACHINE LEARNING IN MOBILE APPS

Now that mobile devices have the high productive capacity level to perform tasks to the same degree as a traditional computer, the question of what machine learning can offer apps has arisen. Large retailers like Amazon and eBay use machine learning in their mobile apps to improve customer experience with smarter product search and recommendation features, along with the ability to forecast buying trends with analytics.

While Machine Learning algorithms require a high level of programming experience and a ton of data to be effective, integrating apps with Siri & iMessage for iOS 10 allows developers to take advantage of the vast deep learning neural networks embedded into Apple’s 1st-party apps.

While the future of machine learning  on a commercial level remains to be seen outside of tech titans like Facebook, machine learning algorithms will be crucial in conjunction with the IoT in building a new SmartWorld with unparalleled predictive capabilities.

Get Fluent in IoT: Top Programming Languages for the Internet of Things

As we explored in our previous blog, the Internet of Things is shaping our future. With Internet of Things development on the rise and potentially $11.1 trillion in economic value generated per year due to IoT, many companies are creating strategies to develop for the platform.

To all the decision-makers out there looking to develop for the loT platform, getting familiar with the programming languages and how they relate to the platform will have a major impact on the budget and quality of any given IoT project. IEEE, the largest technical professional organization dedicated to advancing technology for human benefit, recently ranked the top programming languages of 2015. Bearing in mind embedded devices present their own programming difficulties, here are the top programming languages for the IoT:

Java: James Gosling, Mike Sheridan, and Patrick Naughton began developing the Java language project in June 1991. Java has become the most popular programming language and many choose Java when developing for IoT. Java is an object-oriented language designed for portability. With few hardware dependencies, Java is a great choice from an economic standpoint. Java code can be transmitted to multiple platforms and hardware-support libraries give Java developers the ability to control specific pieces of hardware. Developing for Java can be deterred by the hardware-support libraries available for control functions.

Python: In December 1989, implementation of Python began. Designed by Guido van Rossum, Python is a multi-paradigm programming language which has become one of the go-to languages for web developers. Python’s flexibility and emphasis on readability have caused it to rise in the ranks of top languages used for embedded control and IoT. Readability increases workflow as programmers who have attempted to decipher other programmer’s optimized C code would know.

C: With development beginning in 1972 on the PDP-11 Unix system, C is one of the most popular programming languages. C has influenced many languages, including C++, Go, Java, JavaScript, & Python. Due to its long history, C functions as a common language for many software developers. C’s popularity and lack of built-in hardware bias toward a graphical interface make it a good choice for IoT development.

C++: Created in 1979 by Danish computer scientist Bjarne Stroustrup, C++ was designed as an object-oriented pre-processor for C, keeping the spare nature of the language but adding data abstraction, classes and objects. C++ is commonly used to write embedded and IoT code for Linux systems.

Assembler: Assembler is the simplest method intended to keep projects as compact as possible. Assembler is a low-level language which maintains a high correspondence between language and the hardware’s machine code instructions. Assembler minimizes overhead, making a popular choice despite how it doesn’t allow a safety net. Silly mistakes are easy to make and some hardcore programmers may be frustrated by its simplicity.

Go: Announced by Google in 2009, Go is an open-source, embedded-specific programming language gaining traction in the IoT world. Go supports concurrent input, output, and process different channels, an asset to gathering data from and sending data to separate sensors. Go was created in the tradition of C, but with specific changes to make it simpler, safer & more concise.

ParaSail: ParaSail was created in 2009 as an embedded-specific language. ParaSail stands for Parallel Specification and Implementation Language. ParaSail was created to support safe, secure, highly parallel applications which can be mapped to multicore, many core, heterogenous, or distributed architecture.

Choosing the right programming language will have a major impact on the budget and functionality of any IoT project. Doing the proper research on the subject will pay off in the long run. Stay tuned for more blogs on this subject and learn more about best IoT development practices via this awesome article by InformationWeek. 

Swift Execution: Apple’s New Programming Language Shakes Up Tech Community

In July 2010, Chris Lattner, at the time a Senior Manager and Architect for Apple, began working on a brand new programming language. He developed it at night and on weekends and told no one, not even his closest friends and colleagues. After a year and a half, he had outlined the basics of the new language and proceeded to reveal his creation to the top executives at Apple. Initially impressed, they gave him a few seasoned engineers to help on the project. After 18 months, it became a “major focus” for the company with a huge team of developers working with Lattner. Little did Lattner know in July 2010, he had begun a project which would potentially change the world of app development.

Swift is Lattner’s creation: a new programming language developed and marketed by Apple designed specifically for iOS and OS X development. Companies have created programming languages before, such as Go, a language created by legendary designers Ken Thompson and Rob Pike for Google, but Swift is a different beast. Wired says “[Swift] could achieve mass adoption with unprecedented speed.”

What exactly makes Swift so groundbreaking? For one, it’s designed specifically for iOS. App developers are constantly designing apps for Apple products, be it iPhones, iPads or MacBooks. Apple is at the forefront of the tech revolution and every year pushes the industry forward into the future. Swift offers a language which caters directly to iOS and OS X development. It will soon become the premiere language on which to develop iOS and OS X apps.

Swift is also more approachable than previous counterparts. “It’s more of a helpful language. It understands what you’re doing a little bit better and allows the computer to help you figure it out a bit better,” says Mike Ash, a programmer for Plausible Labs, in Wired. Swift hopes to appeal to the average programmer and make the process of coding not only easier, but more interactive.

One of the most innovative and exciting features in Swift is PLAYGROUND. Playground allows developers to code on one side of their computer screen, while watching the results appear on the other side. It makes coding not only more fun, but more interactive.  At the Apple World Wide Developers Conference, Lattner demonstrated the feature by making real-time changes to an animated circus game while the crowd watched.

Check out the video of Lattner’s demonstration via YouTube. (Note: the video opens with Apple’s initial introduction of Swift featuring a bunch of great, specific info for iOS developers. Lattner’s presentation begins at 3:30).

Playground was designed with the hopes that “By making programming more approachable and fun, we’ll appeal to the next generation of programmers and to help redefine how Computer Science is taught.” says Lattner on his homepage. Objective-C forced developers to wait for their project to compile and run before allowing them to test any code changes, a time-consuming process. The instant feedback of Playgrounds makes the process of coding less daunting and more fun for neophytes.

Swift aims to replace Objective-C, which is the most prominent coding language (and will remain so until Swift [presumably] seizes the crown). Swift doesn’t aim to replace Objective-C off the bat. As mentioned in the Apple Developers Conference, Swift can work concurrently with Objective-C to fit into an app originally developed using Objective-C, however, the hope is that when Swift gains popularity Objective-C will become obsolete for iOS Developers.

Objective-C and Swift are different in a number of ways. As we’ve discussed, Swift is more accessible to new developers. The abbreviated syntax makes for easier and more intuitive coding, at the expense of being less verbose (easy to read) than Objective-C. Switching over to Swift, experienced developers will have a bit of an adjustment period before they can read it with ease, but it’s a minor set-back considering Swift’s potential impact on the developer community.

For more on the differences between Objective-C and Swift, check out this awesome run-down via fastcolabs.com

While only time will tell what Swift’s ultimate legacy in the developer world will be, the immediate impact is undeniable. Swift has already been thrust into computer science curriculums across the country. The interactivity in the app development process created by Playgrounds makes coding more accessible and will surely draw a lot more people into app development. The big question is whether Swift will convince non-Apple developers to migrate.

For more first-party information on Swift, check out Apple’s Swift Developer Guide. Also, stay informed on the latest updates by checking Apple’s Swift Blog.

Mystic Media is an app development and marketing firm with vast experience in iOS and Android application development. Learn more by clicking here or by phone at 801.994.6815

Making the Most of Your Tablet Design Part 1: The Top Tablets in 2014

In Part One of our two part series on tablets, we’ll explore the top tablets on the market in 2014 and what they have to offer both consumers and developers. Part Two will intensively explore the perks of cross-platform tablet application design and optimization.

The tablet market has experienced unprecedented growth with sales growing by over 50% in 2013. Although tablets have existed for over 20 years, the iPad revolutionized the industry when Steve Jobs suggested that a tablet was not simply a personal computer, but a game machine, music player and movie player as well. Rather than a laptop in a different shape, the iPad represented a portable media consumption device with a longer battery life and seemingly endless possibilities for applications. The top tablets for 2014 indicate the future of a business already in an upswing.

iPads are the gold standard when it comes to tablets. They represent the combination of mainstream consumer satisfaction with high-class IOS design and delivery. The top two iPads on the market are the iPad Air and the iPad Mini with Retina display. Retina display entails that the graphics on iPad Minis are so clear, one cannot decipher the pixels at a typical viewing distance. iPad Air has been widely praised as the best tablet on the market. It’s sleek and fast with a 1.4 GHz processor and Apple A7 chip, and while it is on the pricey side, you get what you pay for. IOS designed apps generally yield the most pleasant user experience, although, at Mystic Media, our experienced design team are highly capable of designing aesthetically impeccable cross-platform apps in  IOS, Android, Windows & Blackberry.

The top Android tablets include the Amazon Kindle Fire HDX, Samsung Galaxy Note 10.1, and the Google Nexus. Android’s open-source programming code allows for a greater variety of devices, as well as a more crowded app store. Developers love the Android OS because their apps are more easily approved and reach a broader audience. Many hail Samsung’s Galaxy Note 10.1 as the premier Android tablet on the market. With a 10.1 inch screen, 1.9 GHz processor speed, and 2560 x 1600 pixels, the Galaxy Note 10.1 is bigger, faster, and also more crisp than both iPads currently on the market. It’s also $100 cheaper than the iPad Air. Its main competitor within the Android tablet sphere is the Amazon Kindle Fire, which has the fastest processor speed among mainstream tablets with 2.2 GHz. Its graphics are also on par with the Galaxy Note, and it offers 24/7 video tech support. What sets the Amazon Kindle Fire apart is its compatibility with Amazon, which led cnet.com to label it a must-have tablet for Amazon Prime members.

The Microsoft Windows 8.1 OS is the middle child of Operating Systems, ignored but gifted in its own right. Microsoft’s Surface 2 is generally regarded as THE Windows tablet. The Surface 2 sets itself apart by offering a full contractible keyboard, making it a practical device for getting work done. The Asus Transformer Book T100 also offers a contractible keyboard, along with a 10.1 inch screen and the longest battery life of a mainstream tablet with almost 11 hours. While Windows tablets have major processing power and practicality, they are much less popular, and thus have fewer applications, which also works to the advantage of developers who will have less competition in the App store.

In deciding upon your tablet, you must evaluate the size of the screen, the processor speed, screen resolution, operating system, storage capacity, and battery life. You must ask how you’re going to use it–is it for media consumption, or productivity? Where you’re going to take it, will it be around the house or are you bringing it to work? Will you listen to music on it, or make music? For the casual user, the iPad generally fits the bill, for the developer, Android tablets tend to take the cake, and for the workhorse, Windows offers the best processing power and functionality.

At Mystic Media, we’re experts in the application design field and are highly capable designers for both tablets and smartphones of all Operating Systems. Contact us today at www.mysticmediasoft.com or by phone at 801.994.6815

Stay tuned next week for Part 2 of our two part series on Tablet design focusing on cross-platform optimization.