Wednesday, September 24, 2014

android layout tricks

Merging a image with map

<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<fragment
          android:id="@+id/map"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:name="com.google.android.gms.maps.MapFragment"/>

          <RelativeLayout
    android:id="@+id/rl"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >

    <ImageButton
        android:id="@+id/icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="20dp"
        android:
        android:src="@drawable/star" />

</RelativeLayout>
</merge>

Actionbar theming
-------------------------
http://jgilfelt.github.io/android-actionbarstylegenerator/#name=example&compat=sherlock&theme=light&actionbarstyle=transparent&texture=0&hairline=0&neutralPressed=1&backColor=E4E4E4%2C100&secondaryColor=D6D6D6%2C100&tabColor=9c0%2C100&tertiaryColor=690%2C100&accentColor=6ad869%2C100&cabBackColor=FFFFFF%2C100&cabHighlightColor=33B5E5%2C100

Sunday, September 21, 2014

All about signing the apk and its effect in google play

  1. Generate a private key using keytool. For example:
    $ keytool -genkey -v -keystore my-release-key.keystore-alias alias_name -keyalg RSA -keysize 2048 -validity 10000
    This example prompts you for passwords for the keystore and key, and to provide the Distinguished Name fields for your key. It then generates the keystore as a file called my-release-key.keystore. The keystore contains a single key, valid for 10000 days. The alias is a name that you will use later when signing your app.
  2. Compile your app in release mode to obtain an unsigned APK.
  3. Stand on google_play_services first then run below commands
    android update lib-project --path .
    ant clean
    ant release

    stand on your project root folder
    android update lib-project --path .
    ant clean
    ant release

    make sure your project file is updated with
    android.library.reference.2=../../Android/sdk/extras/google/google_play_services/libproject/google-play-services_lib
  4. Sign your app with your private key using jarsigner:
  5. $ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1-keystore my-release-key.keystore my_application.apk alias_name
    This example prompts you for passwords for the keystore and key. It then modifies the APK in-place to sign it. Note that you can sign an APK multiple times with different keys.
  6. Verify that your APK is signed. For example:
    $ jarsigner -verify -verbose -certs my_application.apk
  7. Align the final APK package using zipalign.
    $ zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk
    zipalign ensures that all uncompressed data starts with a particular byte alignment relative to the start of the file, which reduces the amount of RAM consumed by an app
  8. How to check your details in the keystore 
  9. keytool -list -keystore .keystore
  10. keytool -list -keystore .keystore -alias foo
    1. List all info ::
    keytool -list -v -keystore android-release-key.keystore
How to find that debug SHA1 ley to be used by Android MAP key

keytool -list -v -keystore C:\Users\<username>\.android\debug.keystore
password : android

keytool -exportcert -alias androiddebugkey -keystore C:\Users\ssaho3\.android\debug.keystore -list -v

Friday, September 19, 2014

websites building references

http://www.layoutit.com/
https://bootstrapbay.com/blog/bootstrap-editors/
https://css-tricks.com/perfect-full-page-background-image/
http://nicolasgallagher.com/css-background-image-hacks/
http://www.minimit.com/articles/solutions-tutorials/bootstrap-3-responsive-columns-of-same-height
Ready made themes
---------------------------
http://premium.wpmudev.org/blog/30-top-quality-free-minimalist-and-stunning-wordpress-themes/
http://www.wpexplorer.com/pytheas-free-wordpress-theme/
https://wordpress.org/themes/tags/one-column
http://theme.wordpress.com/themes/features/one-column/
http://www.wpexplorer.com/pytheas-free-wordpress-theme/
http://speckyboy.com/2014/05/27/free-bootstrap-3-templates/
http://speckyboy.com/2014/12/08/jquery-plugins-2014/
http://plugins.adchsm.me/slidebars/index.php#download

Plugins
------------
http://tutorialzine.com/2013/04/50-amazing-jquery-plugins/
https://css-tricks.com/text-blocks-over-image/
http://nick-jonas.github.io/windows/
http://joelb.me/scrollpath/
http://www.seanmccambridge.com/tubular/
http://buildinternet.com/project/supersized/download.html
http://vegas.jaysalvat.com/
http://tutorialzine.com/2012/06/quick-tip-fullscreen-backgrounds/

Web Color theme and pallet choosers
------------------------------
http://www.colorzilla.com/
kuler.adobe.com
http://paletton.com
http://www.google.com/design/spec/style/color.html#color-ui-color-application
http://pixabay.com/en/
http://apps.pixlr.com/editor/

Logo : 250/100 px
http://ocpsoft.org/tutorials/regular-expressions/java-visual-regex-tester/
http://ocpsoft.org/opensource/guide-to-regular-expressions-in-java-part-1/
http://www.mobyaffiliates.com/blog/how-to-promote-your-ios-and-android-mobile-apps/

For android
-------------
http://romannurik.github.io/AndroidAssetStudio/index.html
http://jgilfelt.github.io/android-actionbarstylegenerator/
http://android-holo-colors.com/
https://developer.android.com/distribute/tools/promote/device-art.html
http://www.norio.be/android-feature-graphic-generator/
http://www.cs.dartmouth.edu/~campbell/cs65/lecture24/lecture24.html

Theming a searchview's autocomplete is tricky as it looks black !! from Theme.Holo.Light.DarkActionBar
This is what you need to do

<!-- this style is only referenced in a Light.DarkActionBar based theme -->
    <style name="Theme.Zpulse.Widget" parent="@android:style/Theme.Holo">
        <item name="android:popupMenuStyle">@style/PopupMenu.Zpulse</item>
        <item name="android:dropDownListViewStyle">@style/DropDownListView.Zpulse</item>
        <item name="android:autoCompleteTextViewStyle">@style/AutoCompleteTextViewAppTheme</item>
    </style>

 <style name="AutoCompleteTextViewAppTheme" parent="android:Widget.Holo.Light.AutoCompleteTextView">
      <item name="android:dropDownSelector">@drawable/apptheme_list_selector_holo_light</item>
   <item name="android:background">@drawable/apptheme_edit_text_holo_light</item>
  </style>

Promote:
On launch date, you can also consider submitting your press release to sites like PRWeb  There’s no shortage of Press Release submission websites but definitely go for quality, not quantity.
http://www.rahuljiresal.com/2014/02/user-location-on-android/

LogoDesign
--------------
http://www.logogarden.com/

Saturday, September 6, 2014

Integrating php-mailgun for auth user

Follow : https://github.com/mailgun/mailgun-php


Install curl php as below
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
restrat the apache server.
sudo service apache2 restart



Github Most frequent command

git push origin master
git tag -a v1.4 -m 'my version 1.4'
git push origin --tags

Go back to last version
git reset --hard HEAD

Thursday, July 3, 2014

Compatibility chart for java script libaries

BackBone

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script src="http://ajax.cdnjs.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min.js"></script>

Sunday, June 15, 2014

How to read phonebook with phonegap from android

                function queryPhoneBook()
                {
// find all contacts field
var options = new ContactFindOptions();
options.filter="";
options.multiple=true;
var fields = ["name", "phoneNumbers"];
navigator.contacts.find(fields, onSuccess, onError, options);
                }

                function onSuccess(contacts) {
                //navigator.notification.alert(contacts.length);
                var j = 0;
                $.mobile.showPageLoadingMsg(true);
                //$("#userList").html('');
                for(var i=0; i < contacts.length ; i++)
                {
if( contacts[i].phoneNumbers == null )
continue;
                if(contacts[i].phoneNumbers.length > 0)
                {
                //navigator.notification.alert(contacts[i]);
                //var temp = contacts[i].displayName + "" + contacts[i].phoneNumbers[0].value;
        //navigator.notification.alert(temp);

var htmlData = '<li id="'+j+'"><a href="#"><h2>'+contacts[i].displayName+'</h2><p class="ui-li-aside">'+contacts[i].phoneNumbers[0].value+'</p></a></li>';
$("#userList").append(htmlData).listview('refresh');
j++;
        }
        }
        $.mobile.changePage($("#index"), { transition : "slide"});
$.mobile.hidePageLoadingMsg();
}

Thursday, June 5, 2014

Playing with digital Ocean

amazon ec2 seemed to be complecated though not so difficlut but I am trying didgital ocean now for all my home based research here is what i did today to setup a new instance of droplet and installed Lamp


passwd
adduser sandeep

visudo

# User privilege specification
root    ALL=(ALL:ALL) ALL
demo    ALL=(ALL:ALL) ALL

nano /etc/ssh/sshd_config
Port 4444

PermitRootLogin no
AllowUsers sandeep

sudo apt-get update
sudo apt-get install apache2

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

sudo nano /etc/apache2/mods-enabled/dir.conf 
change index.php

https://www.digitalocean.com/community/tutorials/how-to-set-up-multiple-wordpress-sites-using-multisite

Get the Mysql password

tail -1 /root/.my.cnf | awk -F'=' '{print $2}'
Setting Up Java

sudo apt-get install default-jre
sudo apt-get install default-jdk
sudo nano /etc/environment and append this line
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
source /etc/environment
echo $JAVA_HOME

Installing SFTP/ProFtp

sudo apt-get update && sudo apt-get install proftpd
apt-get install openbsd-inetd
lrwxrwxrwx   1 root root    16 Sep 23 15:34 openlibs -> /opt/GLOBAL/libs
lrwxrwxrwx   1 root root    20 Sep 23 15:34 openservices -> /opt/GLOBAL/services


00 12 * * sat /home/root/monitoring/config/start/procmon.sh
00 12 * * sat /home/root/monitoring/config/stop/procmon.sh

CLASSPATH="/usr/java/bin:/home/s_gcm/gcmserver:/home/s_gcm/gcmserver/libs"
https://www.digitalocean.com/community/tutorials/how-to-configure-proftpd-to-use-sftp-instead-of-ftp
Setting up Smack library in Ubuntu
wget http://www.java2s.com/Code/JarDownload/xmlpull/xmlpull-xpp3-1.1.4c.jar.zip
http://www.java2s.com/Code/JarDownload/xmlpull/xmlpull-xpp3-1.1.4c.jar.zip
Setting up two domain names with DO
https://www.digitalocean.com/community/tutorials/how-to-set-up-multiple-wordpress-sites-on-a-single-ubuntu-vps

Setting up a subdomain e.g <blog> in this case


Lets say subdomain name is blog on zoogaru.com



sudo mkdir -p /var/www/blog.zoogaru.com/public_html
sudo chown -R www-data:www-data /var/www/blog.zoogaru.com/public_html
sudo chmod -R 755 /var/www

put all content with an index file at 
/var/www/blog.zoogaru.com/public_html/

cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/blog.zoogaru.com.conf
vi /etc/apache2/sites-available/blog.zoogaru.com.conf

update ServerAdmin blog@zoogaru.com
add ServerName blog.zoogaru.com
update DocumentRoot /var/www/blog.zoogaru.com/public_html

last and final step:
sudo a2ensite blog.zoogaru.com
sudo service restart apache2
or
/etc/init.d/apache2 restart

create a CNAME record in your owned domain as
* => @ 
give 20-30 minutes to zone file to be propagated.

Using filters on JSON
$scope.selectedTransporter = $filter('filter')($rootScope.CACHE['TRANSPORTER'], $scope.record.transporter_id);

phpmyadmin upgrade =>

sudo add-apt-repository ppa:nijel/phpmyadmin;
sudo apt-get update;
sudo apt-get install phpmyadmin;