Thursday, 24 October 2013

Installing plugins in Phonegap 3.0

Check whether the plugin supports Phonegap CLI, or not,
-          If it does,  run the command.
Using the Phonegap CLI run:
Ø p  phonegap local plugin add https://github.com/aharris88/phonegap-sms-plugin.git
This will place the plugin in your plugins directory and update your android.json file that keeps track of installed plugins.
Then when you run:
Ø     phonegap  build android
or phonegap install android
phonegap will put the necessary files into the platforms/android directory. It will update AndroidManifest.xml, res/xml/config.xml, and it will add the src/org/apache/cordova/sms directory.

-         If it doesn’t,

-   Copy the .js file to your 'www' folder. And link it to your html.

-   Create a package, create the folder structure as yours package name.
                        com>Nuevalgo>plugin>

-   Copy the .java file into this package.
-   Update your platforms\android\res\xml\config.xml adding the following line.



The plugin will be added to your project. Once these things are done, all you have to do implement the js functionality in your app, as you need it.

To view the errors while building:

Add verbose argument to the build command as follow.
-  phonegap -V build android


If you’re getting a class not found exception, check the config.xml where you added your plugin. The package name might be not correct.

Friday, 17 May 2013

Infopark Logo


Its the infopark logo. When I was  in need of this, i couldn't find out anywhere.

If you're good at something,

never do it for free.


Simple News Ticker



Its a simple jquery news-ticker. Its very light weight and easy understandable

Script

/*
* news ticker
* Rahmathullah
*/
var homeTicker = function (ticker) {
var delay = 5000;
var speed = 500;
$(ticker+' li:first').fadeIn(speed);
function tickOut(){
        $(ticker+' .ticker li:first').fadeOut(speed,function () {
$(this).appendTo($(ticker+' .ticker'));
$(ticker+' .ticker li:first').fadeIn(speed);
});
    }
var interval = setInterval(function(){ tickOut() }, delay);
$(ticker+' #next').click(function() {
clearInterval(interval);
$(ticker+' .ticker li:first').fadeOut(speed,function () {
$(this).appendTo($(ticker+' .ticker'));
$(ticker+' .ticker li:first').fadeIn(speed);
});
interval = setInterval(function(){ tickOut() }, delay);
}); 
$(ticker+' #prev').click(function() {
clearInterval(interval);
$(ticker+' .ticker li:first').fadeOut(speed,function () {
$(ticker+' .ticker li:last').prependTo($(ticker+' .ticker'));
$(ticker+' .ticker li:first').fadeIn(speed);
});
interval = setInterval(function(){ tickOut() }, delay);
}); 
}
CSS



/* news */

.news-ticker {
width: 435px;
height: 200px;
background: #f4f4f4;
padding: 15px 18px;
float:left;
margin-left:15px;
}
.news-ticker .head {
float: left;
font-size: 22px;
font-family: 'myriad';
text-transform: uppercase;
color:#323232;
}

.news-ticker .navs {
float: right;
width: 64px;
}
.news-ticker h4 {
margin:10px 0;
color:#900;
font-size:18px;
font-weight:normal;
}
.news-ticker .navs .nav {
margin-left: 2px;
width: 30px;
height: 24px;
float: right;
cursor:pointer;
background-image: url(../images/arrows.png);
}
.news-ticker .navs #next {
background-position: 30px 0px;
}
.news-ticker .navs #prev {
background-position: 0px 0px;
}
.news-ticker .navs #next:hover {
background-position: 30px 24px;
}
.news-ticker .navs #prev:hover {
background-position: 0px 24px;
}
.news-ticker .head .red {
color: #c51500;
}
.news-ticker ul {
height: 170px;
overflow: hidden;
list-style: none;
padding: 0;
font-family:Verdana, Geneva, sans-serif;
font-size:11px;
}
.news-ticker ul .news-head{
font-weight:bold;
margin-top:15px;
}


.news-ticker li {
height: 175px;
display:none;
}

.clear {
clear: both;
}


HTML

<div class="news-ticker">
        <div class="head">
                News Updates
        </div>
        <div class="navs">
            <a class="nav" id="next" ></a>
            <a class="nav" id="prev" ></a>
        </div>
    <div class="clear"></div>
      <ul class="ticker">
            <li>
            <h4>News title 1</h4>
            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
            </li>
            <li>
             <h4>News title 1</h4>
                <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
            </li>
        </ul>
</div>

This is how its started


<script type="text/javascript">
$(document).ready(function() {
homeTicker('.news-ticker');
});
</script>



This is an attempt.

A Place where i would share my thoughts and ideas. Its not bounded, can be anything i would like to share, for free.