Saturday, 30 November 2013

GCM PushNotification in Android

Today we learn how to setup GCM push Notification in appcelerator for android.

In this whole process i divided in to 3 steps.

Here we go to start that how configure it.

1) First Step :
     Open this link https://developers.google.com/console/
     than login with you account. Create a new project

    i) "Creating a Google API Project",
    ii)"Enabling the GCM Service"
    iii)"Obtaining an API Key"


Image snap link : https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkwiSgVPd9Tup8zDXxfZ4mX3XZPLeRp1vDjvDDX_RH1-VuOdlb_dqbb97g6y4FMdSOjJ1x1gfOoHPHWEn-knhX162KBAathR6z53Bxd5lLLwYHN_E8JkmSoOuSvlZ3QlPZecsRaJLN9rk/s1600/all_steps.png

2) Second Step :
      Click on this link https://cloud.google.com/console#/project
     You can found you project that you already created.
     Just Click on that and you found the Example: Project Number: 91060sdsdgsd

3) Third Step :
    Now next step open this url https://my.appcelerator.com/apps
    Login with your appcelerator account where you want to configure this vcm.
    Click on your project than at the top side there are two option (Production/Development).
    Click on Development. Now the main menu box will open in that there is 2nd (Second) tab            click on that.
    Now you found in that page Android Push Configuration
    please fill this both fields
    i) Google Cloud Messaging(GCM) API Key:
    ii)Google Cloud Messaging (GCM) sender ID:


when you finish this process you can register use or create user with this code.

Code : ) https://github.com/dharmik/GCM-PushNotification

If any one need help in this please leave comment i will surely help you.

Thanks,
Dharmik

Thursday, 14 November 2013

Implement Ti Jasmin in appcelerator

Hi,

I successfully implement Jasmin inappcelerator . i want to share code for implemented Jasmin.

Here the git link. it help you to implement it.


ABOUT IT :

Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. And it has a clean, obvious syntax so that you can easily write tests.

It helps me a lot for implement in my current project.

Some of helpful links : http://pivotal.github.io/jasmine/

Source Code Link : https://github.com/dharmik/TiJasmin

If any one face any problem to implement this just Comment your mail address i contact you as soon as possible.

Tuesday, 8 October 2013

How to use sugar.js file in Appcelerator ?

// Sugar.js file is very useful in our developing process .

// Today I create one sample  code which contain sugar.js file and it help me a lot.

// Sugar is a Javascript library that extends native objects with helpful methods. It is designed to be intuitive, unobtrusive, and let you do more with less code.

// Sugar provides methods on strings like from, to, first, last, add, and remove to make modifying strings intuitive and readable, as well as others like each, chars, words, lines, paragraphs which allow iterating over chunks of text. Common escaping methods like escapeURL, escapeHTML, and escapeRegExp provide quick shortcuts for string escaping. Multilingual support is also enhanced with shortcut methods to Unicode script blocks, such as Kanji (Chinese and Japanese), Hiragana (Japanese), Hangul (Korean), Greek, Hebrew, and more. 

// sugar gives the Date class much love starting with the Date.create method which can understand dates in just about any format in 15 major languages, including relative formats like "1 hour ago".

// I create one sample project in appcelerator and i really happy to use this file .

And that project is available on Git. :)

https://github.com/dharmik/use-of-sugar.js-file

Helpful Link : )

sugarjs.com

 I hope this code helps you and solve your some problems. :)


Tuesday, 1 October 2013

How to check the valid Youtube URL ?

// Here, The simple way to valid YouTube url in Appcelerator.

// Typically, the thing that most people want is the youtube video ID valid or not. 

// Some one also check that front part youtube.com/ that one very easy in appcelerator.

Here , some code

 var _videoUrl = "youtube.com/watch?v=FhnMNwiGg5M";
 var _videoUrlNotValid = "go.com/watch?v=FhnMNwiGg5M";

var matches = _videoUrl.match(/((http|https):\/\/)?(www\.)?(youtube\.com)(\/)?([a-zA-Z0-9\-\.]+\/?/);

var matches = _videoUrlNotValid.match(/((http|https):\/\/)?(www\.)?(youtube\.com)(\/)?([a-zA-Z0-9\-\.]+)\/?/);

  if (matches) {
        alert('valid youtube URL');
    }else{
        alert('Not valid');
    }

Output :)

1) _videoUrl is valid
2) _videoUrlNotValid not valid

Hope it helps you , i use this in Appcelerator and it works for me.

Monday, 30 September 2013

Very Simple use to MATH function in javascript

// This one is very simple blog to understand littlebit about MATH function in appcelerator.

// This one is very to easy but i want to share it because today i waste my 3 hour in one simple line code

// I just want to do one simple this like if i get value
3.5 it would be 4 same as,
4.1 it would be 4 same as,
4.9 it would be 5 same as.

It means simple ROUND .

But i didnt think about MATH function at that time . I just try it my own way that one is successful but here one simple mathod ROUND in MATH with the use of this function i easily get may goal.

Example : 
  1. var ratingInfo = Math.round(2.5);
  2. var ratingInfo = Math.round(3.9);
  3. var ratingInfo = Math.round(4.1);
  4. var ratingInfo = Math.round(2.7);
Output :)
  1. 3
  2. 4
  3. 4
  4. 3
This one is very easy in Appcelerator i use this function for Rating Functionality in my Application.

There are lots of other part method is available in MATH .

Like

1 ) Math.random() :  It return a random number between 0 and 1.

2 ) Math.max(15,10) : It return the number with the highest value of two specified numbers.

3) Math.min(25,40) : It return the number with the lowest value of two specified numbers.

That one really helpful me its very easy but it help me a lot so i share it with you.

I hope it helps to all.



 

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