Monday, 16 September 2013

Text To Speech Available in Appcelerator MarketPlace

// Text To Speech is very good thing and i already create blog on that and many people like it.

// One day i decide to share that product with Appcelerator. i just send that to appcelerator that accept that and that product is now in marketplace.

// That product is available in Open Marketplace and that created in alloy. 

// Best thing of that code is that work fine in both platform .

// Same code works for both (iOS , android)

// Most Important Point in Text TO Speech  :)

"Google now requires an API Key to use Google Translate on your website and charges $20 USD per million characters. Question: Where do you add the key within the above URL in order not to get a 404 message from Google"

Here, i share with you marketplace link with the help of this link you can directly download that sample code and i hope that it will help you a lot.

Download Link :)  https://marketplace.appcelerator.com/apps/6518?837327809

Slider widget In Appcelerator Marketplace

// The slider like facebook is now available in appcelerator Open Marketplace. 

// And the best thing is that product is accepeted by appcelerator i really happy about this.

// That product is available in Open Marketplace and that created in alloy. 

// Best thing of that widget is that work fine in both platform .

// There is not difference in that widget look and feel and also in their how is works.

// Same code works for both (iOS , android)

Here, i share with you marketplace link with the help of this link you can directly download that sample widget and i hope that it will help you a lot.

Download Link :)  https://marketplace.appcelerator.com/apps/6373?2033952617

Friday, 30 August 2013

How-to-use i18n(Internationalization) folder in Appcelerator

//  How-to-use i18n(Internationalization) folder

// Rather than hard-coding strings into your project, you can use localized strings. Localized strings are replaced at runtime with values appropriate to the user's language. Titanium relies on resources files and string placeholders to accomplish this task.

Example :)

 // Titanium provides two functions for obtaining a localized string from your resource files. Both take the key of the string requested as their first parameter. The L() macro is a short form for Ti.Locale.getString():


Helpful LINK :  https://wiki.appcelerator.org/display/guides/Internationalization

LIKE

var str1 = L('welcome_message');
var str2 = Ti.Locale.getString('welcome_message');
// str1 === str2

Sample code is available on GIT :) 
https://github.com/dharmik/How-to-use-i18n-folder--

Thursday, 15 August 2013

How to use paint module and save that image in local . .

// In this blog we learn that how to use paint module in appcelerator

// This module is very easy to use.

// This paint module is available on appcelerator market place.

//Sample code is available here. :)

You can get module using this link

https://dl.dropboxusercontent.com/u/72783403/paint.zip


var Paint = require('ti.paint');

var win = Ti.UI.createWindow({
    backgroundColor : '#fff'
});
var paintView = Paint.createPaintView({
    top : 0,
    right : 0,
    bottom : 80,
    left : 0,
    strokeColor : 'black',
    strokeAlpha : 255,
    strokeWidth : 5,
    eraseMode : false
});
win.add(paintView);

var clear = Ti.UI.createButton({
    bottom : 40,
    right : 50,
    width : 75,
    height : 30,
    title : 'Clear'
});
clear.addEventListener('click', function() {
    paintView.clear();
});
win.add(clear);
var save = Ti.UI.createButton({
    bottom : 40,
    left : 50,
    width : 75,
    height : 30,
    title : 'Save'
});
save.addEventListener('click', function() {
    var filename = "sample.png";
    var file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, filename);

    if (file.exists()) {
        file.deleteFile();
    }

    file.write(paintView.toImage());
    var path = file.nativePath;
    Ti.API.info('path of image' + path);
    alert('Image Save');
});
win.add(save);

win.open();




Sunday, 11 August 2013

Different project structure

// Today we simply discuss some project structure.

// How to display menu in appcelerator in different style.


// Sample code is available on GIT :)

https://github.com/dharmik/MenuStructure


Pic :)

 
 



Drag Pin on MAP in Android device In Appcelerator

// Today we learn something different in appcelerator .

// In appcelerator we all kown that we drag pin on Map in iOS we can easily do that .

// In iOS there are some property is available like Dragabble .

// With the use of this property we can easily drag that pin on map in iOS

// But HOW to DRAG that PIN on MAP in ANDROID Device in Appcelerator ?

// Draggable property is only available in iOS not for ANDROID.  :( :( :(

Here one video is available on Youtube that really good and with the help of this URL i solve my problem and that i share wuth you.

http://www.youtube.com/watch?v=M4fUlqKWg7g
And that sample code is also available on GIT.. :)

https://github.com/dharmik/Drag-Pin-In-Android

Friday, 2 August 2013

Text Field In ALERT BOX in Android in APPCELERATOR

Below is Simple code for TextField in ALERT BOX. 



app.js

//Helpful code :)

var win = Titanium.UI.createWindow({
    backgroundColor:'#fff'
});

var textfield = Ti.UI.createTextField({
    value : 'Hello :)'
});

var dialog = Ti.UI.createAlertDialog({
    title: 'Enter text',
    androidView: textfield,
    buttonNames: ['OK', 'cancel']
});
dialog.addEventListener('click', function(e){
    Ti.API.info(textfield.value);
});
dialog.show();

win.open();

Snap :)