Realm is a mobile database that is meant to replace SQLite. It provides a simpler interface than SQLite and supports features like encryption, auto-updating, and cross-platform support between Android, iOS, and other platforms. Models are defined by creating classes that extend RealmObject. Objects can then be queried, created, updated, and deleted directly from Realm. Relationships between objects are also supported.
In a world where users have ever higher expectations from the apps they use, having data always available, even when the device is offline, has become increasingly important.
In this talk you will learn how thinking "offline first" not only makes your app architecture better but also result in cleaner code and happier users.
I will introduce Realm, a new database for easy persistence, and demonstrate how it enables truly reactive UI's by fitting seamlessly into the standard network stack of Retrofit and RxJava.
Finally we will take a look at the new Realm Mobile Platform, which provides real-time synchronization between devices, enabling features previously out of reach for many development teams.
In a world where users have ever higher expectations from the apps they use, having data always available, even when the device is offline has become increasingly important.
In this talk we will go through different ways of saving data on the phone and introduce Realm as a replacement for SQLite and ORM's.
Through an example app it will be demonstrated that thinking "Offline first" not only affects your apps architecture for the better, but also results in happier users.
Realm Mobile Database - An IntroductionKnoldus Inc.
Realm is a cross-platform mobile database.It is a data persistence solution designed specifically for mobile applications. Realm store data in a universal, table-based format
It is simple as data are directly exposed as objects and queryable by code, removing the need for ORM's maintenance issues. Realm is faster than raw SQLite on common operations, while maintaining an extremely rich feature set.
(Presented at JSConf US 2013. Be sure to check out the speaker notes!)
Frustration, a rant, a test suite, a gist. Then, community awesomeness. Boom! Promises/A+ was born.
Promise are an old idea for abstracting asynchronous code, but have only recently made their way into JavaScript. We'll look at the power they provide via two striking examples that go beyond the usual "escape from callback hell" snippets. First we'll show how, with ES6 generators, they can act as shallow coroutines to give us back code just as simple as its synchronous counterpart. Then we'll look at how they can be used as proxies for remote objects, across <iframe>, worker, or web socket boundaries.
However, the most interesting aspect of Promises/A+ is not just the code it enables, but how we worked to create it. We didn't join a standards body, but instead formed a GitHub organization. We had no mailing list, only an issue tracker. We submitted pull requests, made revisions, debated versions tags, etc.—all in the open, on GitHub. And, we succeeded! Promises/A+ is widely used and implemented today, with its extensible core forming the starting point of any discussions about promises. Indeed, this community-produced open standard has recently been informing the incorporation of promises into ECMAScript and the DOM. I'd like to share the story of how this happened, the lessons we learned along the way, and speculate on the role such ad-hoc, community-driven, and completely open specifications have for the future of the web.
Slowly but surely, promises have spread throughout the JavaScript ecosystem, standardized by ES 2015 and embraced by the web platform. But the world of asynchronous programming contains more patterns than the simple single-valued async function call that promises represent. What about things like streams, observables, async iterators—or even just cancelable promises? How do they fit, both in the conceptual landscape and in your day-to-day programming?
For the last year, I've been working to bring an implementation of I/O streams to the browser. Meanwhile, designs for a cancelable promise type (sometimes called "tasks") are starting to form, driven by the needs of web platform APIs. And TC39 has several proposals floating around for more general asynchronous iteration. We'll learn about these efforts and more, as I guide you through the frontiers of popular libraries, language design, and web standards.
In a world where users have ever higher expectations from the apps they use, having data always available, even when the device is offline, has become increasingly important.
In this talk you will learn how thinking "offline first" not only makes your app architecture better but also result in cleaner code and happier users.
I will introduce Realm, a new database for easy persistence, and demonstrate how it enables truly reactive UI's by fitting seamlessly into the standard network stack of Retrofit and RxJava.
Finally we will take a look at the new Realm Mobile Platform, which provides real-time synchronization between devices, enabling features previously out of reach for many development teams.
In a world where users have ever higher expectations from the apps they use, having data always available, even when the device is offline has become increasingly important.
In this talk we will go through different ways of saving data on the phone and introduce Realm as a replacement for SQLite and ORM's.
Through an example app it will be demonstrated that thinking "Offline first" not only affects your apps architecture for the better, but also results in happier users.
Realm Mobile Database - An IntroductionKnoldus Inc.
Realm is a cross-platform mobile database.It is a data persistence solution designed specifically for mobile applications. Realm store data in a universal, table-based format
It is simple as data are directly exposed as objects and queryable by code, removing the need for ORM's maintenance issues. Realm is faster than raw SQLite on common operations, while maintaining an extremely rich feature set.
(Presented at JSConf US 2013. Be sure to check out the speaker notes!)
Frustration, a rant, a test suite, a gist. Then, community awesomeness. Boom! Promises/A+ was born.
Promise are an old idea for abstracting asynchronous code, but have only recently made their way into JavaScript. We'll look at the power they provide via two striking examples that go beyond the usual "escape from callback hell" snippets. First we'll show how, with ES6 generators, they can act as shallow coroutines to give us back code just as simple as its synchronous counterpart. Then we'll look at how they can be used as proxies for remote objects, across <iframe>, worker, or web socket boundaries.
However, the most interesting aspect of Promises/A+ is not just the code it enables, but how we worked to create it. We didn't join a standards body, but instead formed a GitHub organization. We had no mailing list, only an issue tracker. We submitted pull requests, made revisions, debated versions tags, etc.—all in the open, on GitHub. And, we succeeded! Promises/A+ is widely used and implemented today, with its extensible core forming the starting point of any discussions about promises. Indeed, this community-produced open standard has recently been informing the incorporation of promises into ECMAScript and the DOM. I'd like to share the story of how this happened, the lessons we learned along the way, and speculate on the role such ad-hoc, community-driven, and completely open specifications have for the future of the web.
Slowly but surely, promises have spread throughout the JavaScript ecosystem, standardized by ES 2015 and embraced by the web platform. But the world of asynchronous programming contains more patterns than the simple single-valued async function call that promises represent. What about things like streams, observables, async iterators—or even just cancelable promises? How do they fit, both in the conceptual landscape and in your day-to-day programming?
For the last year, I've been working to bring an implementation of I/O streams to the browser. Meanwhile, designs for a cancelable promise type (sometimes called "tasks") are starting to form, driven by the needs of web platform APIs. And TC39 has several proposals floating around for more general asynchronous iteration. We'll learn about these efforts and more, as I guide you through the frontiers of popular libraries, language design, and web standards.
The next version of JavaScript, ES6, is starting to arrive. Many of its features are simple enhancements to the language we already have: things like arrow functions, class syntax, and destructuring. But other features will change the way we program JavaScript, fundamentally expanding the capabilities of the language and reshaping our future codebases. In this talk we'll focus on two of these, discovering the the myriad possibilities of generators and the many tricks you can pull of with template strings.
Http4s, Doobie and Circe: The Functional Web StackGaryCoady
Http4s, Doobie and Circe together form a nice platform for building web services. This presentations provides an introduction to using them to build your own service.
Alternatives of JPA
Requery provide simple Object Mapping & Generate SQL to execute without reflection and session, so fast than JPA, simple and easy to learn.
Async/await is a new language feature that will ship with Swift 5.5 this year. There’s no doubt it will have a significant impact on how we write asynchronous code.
In this talk, we’re going to look at some use cases for async/await, how we can call existing Swift APIs using this new feature, and why your decision to write your SDK in Objective-C might turn out to have been a very clever move.
We’ll also have a look at the refactoring support Apple is adding to Xcode and how it will help you migrate your existing code base.
This is an updated version of my "Add more fun to your functional programming with RXJS". It includes a bit more background information on Reactive programming.
Promises are a popular pattern for asynchronous operations in JavaScript, existing in some form in every client-side framework in widespread use today. We'll give a conceptual and practical intro to promises in general, before moving on to talking about how they fit into Angular. If you've ever wondered what exactly $q was about, this is the place to learn!
Donner le goût du ReactiveCocoa. L’objectif de la présentation étant de nous expliquer comment migrer du code lié au KVO vers une implémentation ReactiveCocoa. Cette approche du KVO par ReactiveCocoa permet de comprendre très facilement les bases et l’intérêt de ce nouveau framework et de s’y mettre facilement et progressivement.
Dpilot is a cloud based file transfer application that allows its user to upload data on cloud server and the receiver on the other hand can downlaod the data from the server. The Downlaod information is send to the receiver via mail service.
Other Features include:-
Secure Login system
Easy data Access
Lightening Fast Uploads and Downloads
Connect with your Facebook Or Gmail Account for easy access
An introduction to promises from the ground up; an overview of the recent history of promises; and some guidance on using promises in your real-world code.
Video at http://www.youtube.com/watch?v=MNxnHbyzhuo, and article at http://open.blogs.nytimes.com/2013/05/29/promises-promises/.
Domains were added to Node.js in 0.8, but their use and workings have been a relative mystery. In short, domains are a structured way of reacting to uncaught exceptions; for example, when creating an HTTP server, you can use domains to send 500 errors when exceptions occur instead of crashing your server. This talk will go over what domains are, how to use them, and some of the subtleties behind how they work.
The next version of JavaScript, ES6, is starting to arrive. Many of its features are simple enhancements to the language we already have: things like arrow functions, class syntax, and destructuring. But other features will change the way we program JavaScript, fundamentally expanding the capabilities of the language and reshaping our future codebases. In this talk we'll focus on two of these, discovering the the myriad possibilities of generators and the many tricks you can pull of with template strings.
Http4s, Doobie and Circe: The Functional Web StackGaryCoady
Http4s, Doobie and Circe together form a nice platform for building web services. This presentations provides an introduction to using them to build your own service.
Alternatives of JPA
Requery provide simple Object Mapping & Generate SQL to execute without reflection and session, so fast than JPA, simple and easy to learn.
Async/await is a new language feature that will ship with Swift 5.5 this year. There’s no doubt it will have a significant impact on how we write asynchronous code.
In this talk, we’re going to look at some use cases for async/await, how we can call existing Swift APIs using this new feature, and why your decision to write your SDK in Objective-C might turn out to have been a very clever move.
We’ll also have a look at the refactoring support Apple is adding to Xcode and how it will help you migrate your existing code base.
This is an updated version of my "Add more fun to your functional programming with RXJS". It includes a bit more background information on Reactive programming.
Promises are a popular pattern for asynchronous operations in JavaScript, existing in some form in every client-side framework in widespread use today. We'll give a conceptual and practical intro to promises in general, before moving on to talking about how they fit into Angular. If you've ever wondered what exactly $q was about, this is the place to learn!
Donner le goût du ReactiveCocoa. L’objectif de la présentation étant de nous expliquer comment migrer du code lié au KVO vers une implémentation ReactiveCocoa. Cette approche du KVO par ReactiveCocoa permet de comprendre très facilement les bases et l’intérêt de ce nouveau framework et de s’y mettre facilement et progressivement.
Dpilot is a cloud based file transfer application that allows its user to upload data on cloud server and the receiver on the other hand can downlaod the data from the server. The Downlaod information is send to the receiver via mail service.
Other Features include:-
Secure Login system
Easy data Access
Lightening Fast Uploads and Downloads
Connect with your Facebook Or Gmail Account for easy access
An introduction to promises from the ground up; an overview of the recent history of promises; and some guidance on using promises in your real-world code.
Video at http://www.youtube.com/watch?v=MNxnHbyzhuo, and article at http://open.blogs.nytimes.com/2013/05/29/promises-promises/.
Domains were added to Node.js in 0.8, but their use and workings have been a relative mystery. In short, domains are a structured way of reacting to uncaught exceptions; for example, when creating an HTTP server, you can use domains to send 500 errors when exceptions occur instead of crashing your server. This talk will go over what domains are, how to use them, and some of the subtleties behind how they work.
Policy and Charging Control - LTE / HSPA / EPC ‘knowledge nuggets’4G-Seminar
Advanced LTE, HSPA and EPC Cellular Systems Training - Public Seminars by Red Banana Wireless, register today at: http://4G-Seminar.com or contact us directly: info@4G-Seminar.com.
This presentation is done to list the configuration parts for a simple LTE-EPC script done with Cisco, the presentation assumes that u have a good LTE as well as Cisco Experience Packet Core experience. For more information, Cisco Documentations are included in the references part.
Introduction to Diameter: The Evolution of SignalingPT
As telecommunications networks have advanced, so have the signaling procedures. This introduction to Diameter gives you an overview of the evolution of signaling.
What is PCRF? – Detailed PCRF architecture and functioningMahindra Comviva
PCRF- Policy and Charging Rules Function- is a dedicated policy controller equipment standardized in 3GPP, enabling policy function for charging & bandwidth on the multimedia networks. Smart Policy Control function combines network and customer intelligence to launch tailored service offerings for business and residential customers.
Read more: http://www.mahindracomviva.com/products/internet-broadband-solutions/smart-policy-control-suite.htm
Diameter is an authentication, authorization, and accounting protocol for computer networks. It evolved from and replaces the much less capable RADIUS protocol that preceded it. in this presentation I will try to familiarize you with the new AAA protocol and deep dive into the diameter protocol details, Credit Control Application (Gx,Gy and GZ) and sample use case for peering Sandvine PTS (Working as PCEF) with freePCRF.server and finally introduce you with seagull, a popular test tool to test different diameter-based scenarios. Hope you like it
basim.alyy@gmail.com
basimaly.wordpress.com
https://eg.linkedin.com/pub/basim-aly/38/774/228
Functional Web Development – An Introduction to React.js
with Bertrand Karerangabo
Presented at FITC's Web Unleashed 2014 conference
on September 18 2014
More info at www.fitc.ca
React.js is a UI framework created by Facebook and Instagram. Its primary design goal is to help build large applications with data that changes over time. To do so at scale, conventional wisdom and some long-held assumptions about software development had to be challenged. Gone are the “M” and the “C” in MVC. Gone are templates and special HTML directives. Gone also are traditional data-bindings. The results are applications that are extremely fast and reliable, out of the box.
Bertrand Karerangabo will dive into those concepts that make React.js unique and along the way, also learn how to build web applications from simple, composable and reusable components.
OBJECTIVE
Rethink web development best practices and explore how you can build ambitious and performant application using functional programming with a virtual DOM representation.
TARGET AUDIENCE
Javascript developers working on medium to large dynamic applications.
ASSUMED AUDIENCE KNOWLEDGE
A solid understanding of Javascript and the DOM is strongly recommended.
FIVE THINGS AUDIENCE MEMBERS WILL LEARN
What React.js is and why it was built.
How to deal with the “evil” of mutable state in non-trivial applications.
A strategy for working around notoriously slow and expensive DOM operations.
The way to truly separate concerns, instead of just technologies, in an application.
The SEO, performance and usability benefits that come from using a client-side framework that plays nice with the server.
The Android world is full of great people that built great stuff and published it for saving other a lot of time. In this talk, we’ll
go over a list of must-have libraries, tools, and resources every Android developer should know to make their Android development much
easier and help them build better apps in less time.
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptGuy Royse
Long ago, in the late days of the first Internet boom, before jQuery, before Underscore, before Angular, there was a web application built by a large corporation. This application was written as a server-side application using server-side technology like Java or PHP. A tiny seed of JavaScript was added to some of the pages of this application to give it a little sizzle.
Over the ages, this tiny bit of JavaScript grew like kudzu. Most of it was embedded in the HTML in
Versão com GIFs:
https://docs.google.com/presentation/d/17M-jHlkAP5KPfQ4_Alck_wIsN2gK3dZNGfJR9Bi1L50/present
Códigos para instalação das dependências:
https://github.com/fdaciuk/talks/tree/master/2015/wordcamp-sao-paulo
Flask and Angular: An approach to build robust platformsAyush Sharma
AngularJS is a really powerful and extensible Javascript library that can be used for all number of applications. The team that up with Flask and you've got a great power and maintainability.
beyond tellerrand: Mobile Apps with JavaScript – There's More Than WebHeiko Behrens
abstract from http://2011.beyondtellerrand.com
Modern web technologies and responsive design aim at a platform independent code base while promising first-class experience on any mobile device. Even though purely web-based approaches can achieve stunning results, they (still) cannot compete with their native counterpart regarding platform features and integration.
In this talk, I will show you how we can use JavaScript to produce mobile apps that include features such as native UI, push notifications, sensors, and paid distribution. You can expect lots of live demos when I will compare the strengths and weaknesses of various frameworks.
Bringing order to the chaos! - Paulo Lopes - Codemotion Amsterdam 2018Codemotion
Chaos Engineering is an emerging discipline, but even before the first computer was built Failure was already there! Fast forward to today, how do you handle Failure? Do you deny it or accept it? Is your network really reliable? Is "the cloud", "the solution"? In this hands-on talk, I will explore the basic concepts of Chaos Engineering and demonstrate as a microservice application can be prepared for the chaos. I'll illustrate how to prepare a plan, break things so you will be ready when failure comes by! This talk is about going big or go home! Rolling back is not a plan!
Building Modern Apps using Android Architecture ComponentsHassan Abid
Android architecture components are part of Android Jetpack. They are a collection of libraries that help you design robust, testable, and maintainable apps. In this talk, We will cover LiveData, ViewModel, Room and lifecycle components. We will go through practical code example to understand modern android app architecture especially MVVM architecture.
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
2. REALM - A MOBILE DATABASE REPLACEMENT
PHOENIX MOBILE FESTIVAL
▸Use #phxmobi as the twitter hashtag and follow
@phxmobifestival for updates.
▸Download Phoenix Mobile Festival App (search for
'phxmobi') from AppStore or Google Play. From the app you
can create your own agenda for the day and provide
feedback on the sessions.
3. REALM - A MOBILE DATABASE REPLACEMENT
WHO AM I?
▸Android Developer at Mokriya.
▸Developing Android apps since the start (first Android phone
was the Droid)
▸Before working at Mokriya, worked for Jaybird, and a few
smaller companies
▸Self published a few apps - Spotilarm, Volume Sync, Bill
Tracker
4. REALM - A MOBILE DATABASE REPLACEMENT
WHAT IS REALM?
▸It’s a database.
▸A replacement for Sqlite.
▸It is NOT an ORM for Sqlite.
5. REALM - A MOBILE DATABASE REPLACEMENT
WHY SHOULD I USE IT?
▸Easy Setup
▸Cross Platform
▸ Android, iOS (Objective-C and Swift), Xamarin, React Native
▸FAST
6. REALM - A MOBILE DATABASE REPLACEMENT
WHO IS USING REALM?
7. REALM - A MOBILE DATABASE REPLACEMENT
FEATURES OF REALM
▸Fluent Interface
▸Field Annotations
▸Migrations
▸Encryption
▸Auto Updates and Notifications
▸RxJava Support
8. REALM - A MOBILE DATABASE REPLACEMENT
FLUENT INTERFACE
getRealm().where(Bill.class)
.equalTo("deleted", false)
.between("dueDate", new
DateTime().minusWeeks(1).toDate(), new
DateTime().plusWeeks(1).plusDays(1)
.toDate())
.findAll();
https://github.com/djrausch/BillTracker/blob/master/app/src/main/java/com/djrausch/billtracker/util/BillUtil.jav
a#L46
9. REALM - A MOBILE DATABASE REPLACEMENT
FIELD ANNOTATIONS
▸@PrimaryKey
▸Table PK
▸@Required
▸Require a value, not null
▸@Ignore
▸Do not persist field to disk
10. REALM - A MOBILE DATABASE REPLACEMENT
MIGRATIONS
public class Migration implements RealmMigration {
@Override
public void migrate(DynamicRealm realm, long oldVersion, long newVersion) {
RealmSchema schema = realm.getSchema();
if (oldVersion == 0) {
//Add pay url to bill
schema.get("Bill")
.addField("payUrl", String.class);
oldVersion++;
}…
}
}
https://github.com/djrausch/BillTracker/blob/master/app/src/main/java/com/djrausch/billtracker/models/Migration.java
11. REALM - A MOBILE DATABASE REPLACEMENT
ENCRYPTION
RealmConfiguration config = new
RealmConfiguration.Builder(context)
.encryptionKey(getKey())
.build();
Realm realm = Realm.getInstance(config);
https://realm.io/docs/java/latest/#encryption
12. REALM - A MOBILE DATABASE REPLACEMENT
AUTO UPDATES & NOTIFICATIONS
bills.addChangeListener(new RealmChangeListener<RealmResults<Bill>>() {
@Override
public void onChange(RealmResults<Bill> element) {
if (adapter.getItemCount() == 0) {
noBillsLayout.setVisibility(View.VISIBLE);
recyclerView.setVisibility(View.GONE);
} else {
noBillsLayout.setVisibility(View.GONE);
recyclerView.setVisibility(View.VISIBLE);
}
}
});
https://github.com/djrausch/BillTracker/blob/master/app/src/main/java/com/djrausch/billtracker/MainActivity.java#L132
13. REALM - A MOBILE DATABASE REPLACEMENT
RXJAVA
getRealm().where(Bill.class).contains(“uuid”, billUuid).findFirst().asObservable()
.filter(new Func1<Bill, Boolean>() {
@Override
public Boolean call(Bill bill) {
return bill.isLoaded();
}
}).subscribe(new Action1<Bill>() {
@Override
public void call(Bill bill) {
setUI(bill);
if (bill.paidDates != null) {
if (adapter == null) {
adapter = new PaidDateRecyclerViewAdapter(ViewBillDetails.this, bill.getPaidDates());
recyclerView.setLayoutManager(new LinearLayoutManager(ViewBillDetails.this));
recyclerView.setAdapter(adapter);
}
}
}
});
https://github.com/djrausch/BillTracker/blob/master/app/src/main/java/com/djrausch/billtracker/AddOrEditBillActivity.java#L109
https://realm.io/docs/java/latest/#rxjava
14. REALM - A MOBILE DATABASE REPLACEMENT
OK, SO HOW DO I USE IT?
▸There is no schema set up
▸Simply have your model classes extend RealmObject
public class Bill extends RealmObject {
@PrimaryKey
public String uuid;
public String name;
public String description;
public int repeatingType = 0;
public Date dueDate;
public String payUrl;
public RealmList<BillNote> notes;
public RealmList<BillPaid> paidDates;
public boolean deleted = false;
public int amountDue = 0;
https://github.com/djrausch/BillTracker/blob/master/app/src/main/java/com/djrausch/billtracker/models/Bill.java
15. REALM - A MOBILE DATABASE REPLACEMENT
FIELD TYPES
▸Supports standard field types including Date
Realm supports the following field types: boolean, byte, short, int, long, float,
double, String, Date and byte[]. The integer types byte, short, int, and long are all
mapped to the same type (long actually) within Realm. Moreover, subclasses of
RealmObject and RealmList<? extends RealmObject> are supported to model
relationships.
The boxed types Boolean, Byte, Short, Integer, Long, Float and Double can also
be used in model classes. Using these types, it is possible to set the value of a
field to null.
https://realm.io/docs/java/latest/#field-types
17. REALM - A MOBILE DATABASE REPLACEMENT
QUERIES
▸You can group conditions for complex queries
RealmResults<User> r = realm.where(User.class)
.greaterThan("age", 10) //implicit AND
.beginGroup()
.equalTo("name", "Peter")
.or()
.contains("name", "Jo")
.endGroup()
.findAll();
https://realm.io/docs/java/latest/#logical-operators
18. REALM - A MOBILE DATABASE REPLACEMENT
CREATING MODEL
realm.beginTransaction();
User user = realm.createObject(User.class);
user.setName("John");
user.setEmail("john@corporation.com");
realm.commitTransaction();
https://realm.io/docs/java/latest/#creating-objects
19. REALM - A MOBILE DATABASE REPLACEMENT
CREATING MODEL
final Bill b = new Bill(name.getText().toString(), "", repeatingItem.code,
selectedDueDate.toDate(), payUrl.getText().toString(), (int) (amount.getValue() *
100));
realm.executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
realm.copyToRealm(b);
}
});
https://github.com/djrausch/BillTracker/blob/master/app/src/main/java/com/djrausch/billtracker/AddOrEditBillActivity.jav
a#L171
20. REALM - A MOBILE DATABASE REPLACEMENT
READING MODEL
BillTrackerApplication.getRealm().where(Bill.class).contains("
uuid", billUuid).findFirst()
‣ findFirst()
‣ findAll()
‣ findAllSorted()
‣ These all have an async version as well
https://github.com/djrausch/BillTracker/blob/master/app/src/main/java/com/djrausch/billtracker/AddOrEditBill
Activity.java#L109
21. REALM - A MOBILE DATABASE REPLACEMENT
UPDATING MODEL
realm.executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
editBill.setName(name.getText().toString());
editBill.setRepeatingType(repeatingItem.code);
editBill.setDueDate(selectedDueDate.toDate());
editBill.setPayUrl(payUrl.getText().toString());
editBill.setAmountDue((int) (amount.getValue() * 100));
}
});
https://github.com/djrausch/BillTracker/blob/master/app/src/main/java/com/djrausch/billtracker/AddOrEditBill
Activity.java#L155
22. REALM - A MOBILE DATABASE REPLACEMENT
DELETING MODEL
getRealm().executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
bill.deleteFromRealm();
}
});
https://github.com/djrausch/BillTracker/blob/master/app/src/main/java/com/djrausch/billtracker/AddOrEditBill
Activity.java#L218
23. REALM - A MOBILE DATABASE REPLACEMENT
RELATIONSHIPS
▸Many-to-One
▸Used for One-to-One
▸Many-to-Many
https://realm.io/docs/java/latest/#relationships
24. REALM - A MOBILE DATABASE REPLACEMENT
MANY-TO-ONE
public class Contact extends RealmObject {
private Email email;
// Other fields…
}
https://realm.io/docs/java/latest/#many-to-one
25. REALM - A MOBILE DATABASE REPLACEMENT
MANY-TO-MANY
public class Bill extends RealmObject {
…
public RealmList<BillPaid> paidDates;
…
}
final BillPaid billPaid = new BillPaid(new Date());
BillTrackerApplication.getRealm().executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
bill.setDueDate(DateUtil.createNextDueDate(bill));
bill.getPaidDates().add(billPaid);
}
});
https://github.com/djrausch/BillTracker/blob/master/app/src/main/java/com/djrausch/billtracker/models/Bill.java#L28
https://github.com/djrausch/BillTracker/blob/master/app/src/main/java/com/djrausch/billtracker/util/BillUtil.java#L20
https://realm.io/docs/java/latest/#many-to-many
26. REALM - A MOBILE DATABASE REPLACEMENT
THREADING
The only rule to using Realm across threads is to remember that
Realm, RealmObject or RealmResults instances cannot be passed
across threads.
Get Realm in any thread you need it.
getRealm().where(Bill.class).equalTo("deleted",
false).findAllSortedAsync("dueDate");
https://github.com/djrausch/BillTracker/blob/master/app/src/main/java/com/djrausch/billtracker/util/BillUtil.java#L43
27. REALM - A MOBILE DATABASE REPLACEMENT
USING WITH RETROFIT
It just works!
apiService.getUserBills(BillTrackerApplication.getUserToken()).enqueue(new Callback<List<Bill>>() {
@Override
public void onResponse(Call<List<Bill>> call, final Response<List<Bill>> response) {
for (Bill b : response.body()) {
Log.d("Bill", b.toString());
}
BillTrackerApplication.getRealm().executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
realm.copyToRealmOrUpdate(response.body());
}
});
}
});
https://github.com/djrausch/BillTracker/blob/master/app/src/main/java/com/djrausch/billtracker/network/controller
s/BillApi.java#L45
28. REALM - A MOBILE DATABASE REPLACEMENT
ADAPTERS
‣ RealmRecyclerViewAdapter
‣ Keeps the data updated from a RealmResult or RealmList
‣ No need to notifyDataSetChanged()
https://github.com/djrausch/BillTracker/blob/master/app/src/main/java/com/djrausch/billtracker/adapters/M
ainRecyclerViewAdapter.java
https://realm.io/docs/java/latest/#adapters
29. REALM - A MOBILE DATABASE REPLACEMENT
LIMITATIONS
▸The upper limit of class names is 57 characters. Realm for Android
prepend class_ to all names, and the browser will show it as part of
the name.
▸The length of field names has a upper limit of 63 character.
▸Nested transactions are not supported, and an exception is thrown if
they are detected.
▸Strings and byte arrays (byte[]) cannot be larger than 16 MB.
▸Does not support lists of primitive types (String, Ints, etc), yet.
https://realm.io/docs/java/latest/#current-limitations
30. REALM - A MOBILE DATABASE REPLACEMENT
QUESTIONS?
▸Use #phxmobi as the twitter hashtag and follow
@phxmobifestival for updates.
▸Download Phoenix Mobile Festival App (search for 'phxmobi')
from AppStore or Google Play. From the app you can create your
own agenda for the day and provide feedback on the sessions.
▸Slides will be on djraus.ch/realm soon!
▸Bill Tracker is open source -
https://github.com/djrausch/BillTracker
Editor's Notes
Migrations work much like onUpgrade in Sqlite
boxed types
I haven’t used this yet.
Android KeyStore
Note, I am not using the new RealmResults. It is recommended to only use this to notify the UI of any data changes.
I am still new with RxJava so this isn’t that advanced. Realm docs go into more details on this
POJO
Can have public, private, protected methods as well
contains is like where clause in sql
If using this method, and want to perform action on the bill, you must use the object returned by copyToRealm
Append async to method
Update the model as you would any object. Do it inside a transaction (should probably use Async transaction)
Setting the value to null for a RealmList field will clear the list. That is, the list will be empty (length zero), but no objects have been deleted. The getter for a RealmList will never return null. The returned object is always a list but the length might be zero.
The realm instance cannot be shared between threads. Just get the instance again, and data in the other thread will be updated due to the auto updates