Transitioning from Android to Spruce

Android development typically involves Java or Kotlin, while Spruce is a TypeScript-based platform.

While Android focuses on front-end and does support directly implementing some backend type functionality, most times an Android app is communicating with a remote API to do it’s work. Spruce, on the other hand, is a “full-stack platform” that allows for both beautiful UI’s and robust back-ends.

This guide will help you connect your knowledge of Android development to Spruce’s architecture, showing you how to adapt your existing skills to the Spruce environment.

Key Differences between Android and Spruce Development

AndroidSpruce
Programming LanguageJava/KotlinTypeScript
IDEAndroid StudioVisual Studio Code
App LifecycleApplication Class, Activities, Services, etc.No Equivalent
UI DesignActivities, FragmentsHeartwood, ViewControllers
Event HandlingBroadcast Receivers, LocalBroadcastManagerMercury
Data PersistenceCore Data, UserDefaultsData Stores
Error HandlingNSError, Error Protocol, Try-Catch BlocksTry-Catch Blocks, SpruceErrors
TestingXCTestTDD by the 3 laws
User AuthenticationApple’s Frameworks, Custom Server-Side SolutionsMercury, Authenticator
User PermissionsApple’s Frameworks, Custom Server-Side SolutionsMercury, Authorizor

Programming Language

Android

Coming soon...

Spruce

import {
 AbstractSkillViewController,
 CardViewController,
 ViewControllerOptions,
 buildSkillViewLayout,
 SkillView
} from '@sprucelabs/heartwood-view-controllers'

export default class RootSkillViewController extends AbstractSkillViewController {
 public static id = 'root'
 protected cardVc: CardViewController

 public constructor(options: ViewControllerOptions) {
  super(options)
  this.cardVc = this.Controller('card', {
   header: {
    title: 'Hello, World!',
   }
  })
 }

 public render(): SkillView {
  return buildSkillViewLayout('grid', {
   cards: [this.cardVc.render()]
  })
 }
}

IDE

Coming soon...

App Lifecycle

Coming soon...

UI Design

Coming soon...

Event Handling

Coming soon...

Data Persistence

Coming soon...

Error Handling

Coming soon...

Testing

Coming soon...

User Authentication

Coming soon...

User Permissions

Coming soon...

Something Missing?

Request Documentation Enhancement

Now What?

Install the Development Theatre
It looks like you are using Internet Explorer. While the basic content is available, this is no longer a supported browser by the manufacturer, and no attention is being given to having IE work well here.