---
title: "Build Better Mobile Apps with FirebaseUI"
description: "Build Better Mobile Apps with FirebaseUI"
published: "2015-08-27"
last_updated: "2015-08-27"
authors:
  - "Mike McDonald (Engineer)"
categories:
  - "iOS"
  - "Android"
  - "Authentication"
canonical_url: "https://firebase.blog/posts/2015/08/build-better-mobile-apps-with-firebaseui_78"
---

# Build Better Mobile Apps with FirebaseUI

*Published August 27, 2015 by Mike McDonald (Engineer)*

---
Designed to help native mobile developers quickly and easily develop Firebase apps, FirebaseUI eliminates bloat in your application code by providing native bindings to common UI controls.

FirebaseUI adds support to quickly hook a Firebase database reference or query to a `ListView`, `GridView`, `RecyclerView` on Android or a `UITableView` or `UICollectionView` iOS.

Start by creating an [Android Firebase project](https://www.firebase.com/docs/android/quickstart.html) or [iOS Firebase project](https://www.firebase.com/docs/ios/quickstart.html) then follow our Android or iOS quickstarts below.

### Android Quickstart
On Android, add the latest version of FirebaseUI to your `build.gradle`:

```js
compile 'com.firebase:firebase-ui:0.2.0'
```

Resync your project and you're ready to continue.

More information, including a more in-depth installation walkthrough, can be found on the [FirebaseUI-Android README](https://github.com/firebase/firebaseui-android#using-the-library-in-your-android-app).

Once we've installed FirebaseUI, create a `FirebaseListAdapter` which binds a Firebase database reference or query to a `ListAdapter` and provides developers an easy way to populate `ListView` views with developer specified model objects (more information on using Java Objects is available in the [docs](https://www.firebase.com/docs/android/guide/saving-data.html#section-set)).

```java
Firebase.setAndroidContext(this);
Firebase ref = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com");

mAdapter = new FirebaseListAdapter<ChatMessage>(this, ChatMessage.class, android.R.layout.two_line_list_item, ref) {
    @Override
    protected void populateView(View view, ChatMessage object) {
        /* Populate view with contents of the model object */
    }
};

mListView.setListAdapter(mAdapter);
```

If you want more examples, check out the [Android README](https://github.com/firebase/firebaseui-android#firebaseui-android), or see our [Android chat app](https://github.com/firebase/firebaseui-android/tree/master/app) example. The Javadoc is available [here](https://firebaseui.com/docs/android/index.html).

### iOS Quickstart
On iOS, add the latest version of FirebaseUI to your `podfile`:

```ruby
pod 'FirebaseUI', '~> 0.2.0'
```

If you're using Swift, make sure to add:

```ruby
platform :ios, '8.0'
use_frameworks!
```

`pod install`, then open the generated `.xcworkspace`.

More information, including a more in-depth installation walkthrough, can be found on the [FirebaseUI-iOS README](https://github.com/firebase/firebaseui-ios#installing-firebaseui-for-ios).

Once we've installed FirebaseUI, create a `FirebaseTableViewDataSource`. This datasource will provide cells and the associated `FDataSnapshots` (or a custom model object, a feature in beta) to populate `UITableViewCells`, a custom subclass, or even a custom `XIB`.

```swift
Firebase *ref = [Firebase alloc] initWithUrl:@"https://<YOUR-FIREBASE-APP>.firebaseio.com/chat"];

self.dataSource = [[FirebaseTableViewDataSource alloc] initWithRef:ref
                                                        modelClass:[FDataSnapshot class]
                                                         cellClass:[UITableViewCell class]
                                               cellReuseIdentifier:@""
                                                              view:self.tableView];

[self.dataSource populateCellWithBlock:^void(UITableViewCell *__nonnull cell, FDataSnapshot *__nonnull snap) {
    /* Populate cell with contents of the snapshot */
  }
}];

self.tableView.dataSource = self.dataSource;  
```

```swift
let ref = Firebase(url: "https://<YOUR-FIREBASE-APP>.firebaseio-demo.com")

self.dataSource = FirebaseTableViewDataSource(ref: ref,
                                       modelClass: FDataSnapshot.self,
                                        cellClass: UITableViewCell.self,
                              cellReuseIdentifier: "",
                                             view: self.tableView)

self.dataSource.populateCellWithBlock { (cell: UITableViewCell, obj: NSObject) -> Void in
    let snap = obj as! FDataSnapshot // Force cast to an FDataSnapshot
    /* Populate cell with contents of the snapshot */
}

self.tableView.dataSource = self.dataSource  
```

FirebaseUI can also be used to back a `UICollectionView` using the `FirebaseCollectionViewDataSource`.

If you want more examples, check out the [iOS README](https://github.com/firebase/firebaseui-ios#firebaseui-for-ios--ui-bindings-for-firebase), or see our [iOS chat app](https://github.com/firebase/FirebaseUI-iOS/tree/master/examples/firebaseuichat) example. The Appledoc is available [here](https://firebaseui.com/docs/ios/index.html).

### Next up, Login
We're working on making mobile development as effortless as possible, so we're always looking for ways to improve development speed and reduce complexity. One major area that we hear a lot of developers struggle is around mobile authentication, which typically requires installation of third party SDKs and understanding lots of additional docs.

While we have login demo apps on [Android](https://github.com/firebase/firebase-login-demo-android) and [iOS](https://github.com/firebase/login-demo-ios) that explain these processes, FirebaseUI 0.3 will incorporate a set of login helper classes and standard views to make adding authentication to your mobile apps simple.

Our long term strategy involves adding support for pagination, infinite scroll, and client side filtering. We'd also love to hear feature requests from you.

### Submit a Pull Request!
Do you want to see those features added faster? Are you excited about making Firebase apps easier to develop? Is writing quality code your passion?

We'd love to have your help building and maintaining these libraries. Please submit issues for bugs and feature requests on [Android](https://github.com/firebase/firebaseui-android/issues) and [iOS](https://github.com/firebase/firebaseui-ios/issues), and pull requests are always welcome.

Lastly, if you've built anything, don't be shy! Share your apps with us on Twitter [@Firebase](https://twitter.com/firebase) or in our [Google Group](https://groups.google.com/forum/#!forum/firebase-talk)--we're excited to see what you build.
