# Titanium Dreamfactory tuto or example

**URL:** https://community.dreamfactory.com/t/titanium-dreamfactory-tuto-or-example/1017
**Category:** Client SDKs
**Created:** [April 20, 2015, 5:43pm UTC](https://community.dreamfactory.com/t/titanium-dreamfactory-tuto-or-example/1017 "2015-04-20T17:43:44Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jeebee](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@jeebee](https://community.dreamfactory.com/u/jeebee)
#### Post date: [April 20, 2015, 5:43pm UTC](https://community.dreamfactory.com/t/titanium-dreamfactory-tuto-or-example/1017/1 "2015-04-20T17:43:44Z")

</div>

Hi there  
I’m looking for documentation, spare code, example app on titanium intégration with DreamFactory  
i’m starting with titanium, and i’m a little bit lost …  
does someone can help me ?

best regards,

julien

---

<div class="post-metadata">

### Author: ![jeffreystables](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/jeffreystables/32/173_2.png) [@jeffreystables](https://community.dreamfactory.com/u/jeffreystables)
#### Post date: [April 20, 2015, 5:58pm UTC](https://community.dreamfactory.com/t/titanium-dreamfactory-tuto-or-example/1017/2 "2015-04-20T17:58:57Z")

</div>

I recommend downloading and playing with our Titanium SDK.

> **[dreamfactorysoftware/titanium-sdk](https://github.com/dreamfactorysoftware/titanium-sdk)**
>
> An address book app for Titanium showing user registration, user login, and CRUD - dreamfactorysoftware/titanium-sdk

It includes basic DSP API interaction as well as a sample app.

---

<div class="post-metadata">

### Author: ![jeebee](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@jeebee](https://community.dreamfactory.com/u/jeebee)
#### Post date: [April 20, 2015, 6:22pm UTC](https://community.dreamfactory.com/t/titanium-dreamfactory-tuto-or-example/1017/3 "2015-04-20T18:22:32Z")

</div>

hi jeffrestables  
i’ve already play with the sdk  
but i cannot find the sample app?  
thanks

---

<div class="post-metadata">

### Author: ![jeffreystables](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/jeffreystables/32/173_2.png) [@jeffreystables](https://community.dreamfactory.com/u/jeffreystables)
#### Post date: [April 20, 2015, 6:35pm UTC](https://community.dreamfactory.com/t/titanium-dreamfactory-tuto-or-example/1017/4 "2015-04-20T18:35:09Z")

</div>

If you have not already, you may import the Todo List sample app on the Apps tab of your DSP by clicking “Import” and selecting the appropriate sample application.

[This image is no longer available]

---

<div class="post-metadata">

### Author: ![jeebee](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@jeebee](https://community.dreamfactory.com/u/jeebee)
#### Post date: [April 20, 2015, 6:48pm UTC](https://community.dreamfactory.com/t/titanium-dreamfactory-tuto-or-example/1017/5 "2015-04-20T18:48:39Z")

</div>

sure, but i’m looking for a Titanium app sample

---

<div class="post-metadata">

### Author: ![jeffreystables](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/jeffreystables/32/173_2.png) [@jeffreystables](https://community.dreamfactory.com/u/jeffreystables)
#### Post date: [April 20, 2015, 7:00pm UTC](https://community.dreamfactory.com/t/titanium-dreamfactory-tuto-or-example/1017/6 "2015-04-20T19:00:02Z")

</div>

Well, if no one else in the community responds with an example for you, please do post back with the one you end up writing so that others may benefit.

---

<div class="post-metadata">

### Author: ![jeebee](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@jeebee](https://community.dreamfactory.com/u/jeebee)
#### Post date: [April 23, 2015, 5:29pm UTC](https://community.dreamfactory.com/t/titanium-dreamfactory-tuto-or-example/1017/7 "2015-04-23T17:29:49Z")

</div>

Hi  
please find below a login windows (tested & approved)

regards,

* * *

```auto
var win = Titanium.UI.currentWindow;
 
var username = Titanium.UI.createTextField({
    color:'#336699',
    top:10,
    left:10,
    width:300,
    height:40,
    hintText:'Username',
    keyboardType:Titanium.UI.KEYBOARD_DEFAULT,
    returnKeyType:Titanium.UI.RETURNKEY_DEFAULT,
    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});
win.add(username);
 
var password2 = Titanium.UI.createTextField({
    color:'#336699',
    top:60,
    left:10,
    width:300,
    height:40,
    hintText:'Password',
    passwordMask:true,
    keyboardType:Titanium.UI.KEYBOARD_DEFAULT,
    returnKeyType:Titanium.UI.RETURNKEY_DEFAULT,
    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});
win.add(password2);
 
var loginBtn = Titanium.UI.createButton({
    title:'Login',
    top:110,
    width:90,
    height:35,
    borderRadius:1,
    font:{fontFamily:'Arial',fontWeight:'bold',fontSize:14}
});
win.add(loginBtn);

/*
* Login Button Click Event
*/

 
loginBtn.addEventListener('click',function(e)
{
    var Promise = require('Promise');
   		var dreamfactory = require('dreamfactory');
    		var bodydb = {email: username.value , password: password2.value};
        	bodydb = JSON.stringify(bodydb);
        	dreamfactory.makeRequest("post","/user/session", bodydb).then(function(response) {
            	SESSION_ID = response.session_id;
            	Ti.API.info("login succes session id " + SESSION_ID);
            	Ti.App.fireEvent('grantEntrance', {
        		name:response.first_name,
        		email:response.email
       			});
            	
        	}, function (error) {
            	Ti.API.info("erreur" + bodydb);
            	alert("error" );
       		});

});

```

---

<div class="post-metadata">

### Author: ![jeffreystables](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/jeffreystables/32/173_2.png) [@jeffreystables](https://community.dreamfactory.com/u/jeffreystables)
#### Post date: [April 23, 2015, 5:54pm UTC](https://community.dreamfactory.com/t/titanium-dreamfactory-tuto-or-example/1017/8 "2015-04-23T17:54:29Z")

</div>

That’s awesome, @jeebee! I hope you don’t mind, I’ve edited your post a bit to provide a little better formatting on the code.
