Thứ Bảy, 14 tháng 2, 2015

Top 5 Android Apps for free calling(VOIP)



1.Dingaling- Best Free Calls






Unlike other free call apps such as Viber, Skype, etc. Dingaling also works on 2G networks! As a result, Dingaling can provide high quality calls where other apps cannot. The majority of the world's mobile phones still use 2G, this means billions of people now have access to free calls for the first time- thanks to Dingaling! Voice calls are transmitted through Dingaling’s high-quality network. With new voice technologies, most free calls between dingaling users sound as good as standard calls! "Free" no longer equals low quality!

Click Here To Download


2.Viber





 Viber is one of the most widely used free call solutions. As usual, you have to be calling other Viber users for it to be free. You can also use it for text and group messaging. Viber is a little more simple than many of the other apps but it gets the job done. There is also cross platform support should you need it!

Click Here To Download

3. Nimbuzz Messenger / Free Calls






Nimbuzz  has all of the features that most of these other apps have and it still works rather well. As per the norm you can voice call other Nimbuzz users free of charge and the service boasts HD calling service which is a plus since a lot of these apps do not have the best voice quality when calling. Of course, your mileage may very. You can also do the usual stuff like use stickers, group chat, text chat, and others.

Click Here To Download

4.Line:



Line is most popular option to make free calls on Android. It currently supports over 400 million users worldwide and contains a lot of nifty features. One of which is free phone calls to other Line users. You can call non-Line users but there is a small fee (which isn’t unusual for these apps). It also features text messaging and group texting. .Line  has multi-platform support for most mobile operating systems and PC which is always nice to have in case your friends or relatives don’t use Android.

Click Here To Download

5. magicApp by magicJack



magicApp can only be used for phone calls. So if you just need an app for calling, this is a good way to go. If you need something that includes texting too, then this won’t be a full solution.

Click Here To Download

Thứ Năm, 12 tháng 2, 2015

Top 10 Android Applications

1.Chrome to Phone


Install an extension (plug-in) on your computer and let your PC get synchronized with your phone, allowing the web browser to send any information across to your phone.

Download chrometophone

2.Easy Uninstaller

Download EasyUninstaller

3.ShopSavvy Barcode Scanner


ShopSavvy Barcode Scanner is a useful Android application which lets you to scan the barcode of things you purchase and check their prices online.

Download BarcodeScanner

4.GO SMS Pro



This Android application brings to you the most convenient way of SMS or MMS. Simple, amazing, wonderful, optimizing and much more, what more you can expect from an application like this. GO SMS Pro is a wonderful messaging experience to behold in.

Download SmsApp

5.Recycle Bin

Recycle Bin is an application which will enable you to restore all the deleted files on your android phone.

Download Recycle Bin

6. Vibe

 A phone call you want to actually feel it before you attend for it. Create a unique vibration pattern for those phone calls you want them to be recognized.

Download Vibe

7.Pixlr-o-matic

    The best photo editing tool/app you could ever wish for on your Android device.Edit your memories,make them look as you would have wished for.

Download

8.Beautiful Widgets:







     It is the best android app as far as the widgets are concerned.
Downloas here:

Download

9.SwiftKey:






    This application can replace the on touch keyboard kept by the manufacturer with your device. This application helps to keep a good, correct, precise spelling hold on the words. It even works as a fortunate predictor of words if used prop

 Download

10.Google Sky Map



    Google redefined the word search and with Google Sky Map it goes beyond the meaning of search. The Google Sky Map allows you to search the sky  for stars, planets, constellations and you don’t have to move out to do that beacause the app uses  you phone’s orientation tools.

Download

Thứ Tư, 11 tháng 2, 2015

How to get your java files back from .class (byte code) file

--This is a common problem for java developers.By using JD(Java Decompiler) you can get  .java files back from your .class files.

--JD (Java Decompiler) is a Decompiler for the Java programming language.

--JD is provided as a GUI tool as well as in the form of plug-ins for the Eclipse (JD-Eclipse) and IntelliJ IDEA (JD-IntelliJ) integrated development environments.

--JD supports all versions of Java from 1.1.8 through 1.7.0 as well as JRockit 90_150, Jikes 1.2.2, Eclipse Java Compiler and Apache Harmony and is thus often used where formerly the popular JAD (JAva Decompiler) was operated.

--You can directly download JD for various platforms by clicking below link

                                           Download

Thứ Ba, 10 tháng 2, 2015

changes in Java Interfaces

Interfaces:

    By using interfaces you can specify what a class must do,but not how it does.i'e it provides a contract to a class to implement defined methods.If you define one interface it can be used by any number of classes.Every field and method in an interface must be defined as a public,reason for this is class
must get access privilege.

    Prior to java8 interfaces does not allow any implementation of methods,but java8 allows default implementation for methods ,these methods named as default methods.Indirectly you can say java8 interfaces specify some behaviour like classes.Primary motivation for this feature  is expanding of an interface further with out breaking of an existing code.

Explanation in more detail:

    --If you want to provide any default behaviour to your interface create a default method .
   
    --Each default method will start with keyword "default".

    --This default method can directly accessed by implemented class.

Example:

    I will show you a simple example how we can use default method in an interface .lets observe below Interface


            public interface Java8Interface {
   
                       //abstract method must be implemented by its implemented class
                    public void sendMessage();
   
                        // a default method for this interface
                    default String currentMessage()
                    {
                            return "This is default Message";
                    }
           
                    }//end of interface
   
    --Above Java8Interface contains one default method and one abstract method.
   
    --implementaion for the sendMessage() will be provided by its contracted class,currentMessage() is a defaulte method you can observe its declaration preceded by default keyword.

Now lets define implemenatation class for Java8Interface



   

            //implement Java8Interface
            public class Java8Implementer implements Java8Interface{
   
                        //provide implementation for sendMessage()
                        public void sendMessage()
                        {
                            System.out.println("This message is not a default message");
                        }
   
   
                    public static void main(String args[])
                    {
                            Java8Implementer imp=new Java8Implementer();
                            //call sendMessage from here
                            imp.sendMessage()s
                            //now you can also call default method by using object imp
                            String msg=imp.currentMessage();
                            //print the message
                            System.out.println(msg);
                    }//end of main
   
                    }//end of class


let see the out put of Java8Implementer

output:
-------
This message is not a default message
This is default Message

i'e you can call a default method by using an object of a class by which an interface is implemented.

More About default implementation.
----------------------------------

    By above program we have a conclusion that a default method can be accessed by object of implemented class.However implemented class can also override existing interface default method.let see how it does

    Now am implementing same Java8Interface    with anothe class but this time am overriding currentMessage() of Java8Interface which is default






                    public class DefaultOverride implements Java8Interface{
   
                            public void sendMessage()
                            {
                                System.out.println("This is not a default message");
                            }
   
                            //now override default method
                            public String currentMessage()
                            {
                                   return"Message is overridden";
                            }
   
                            public static void main(String args[])
                            {
                                DefaultOverride def=new DefaultOverride();
                                    def.sendMessage();
                            //calling overrided method
                                String msg=def.currentMessage();
                                System.out.println(msg);
                            }//method
                    }//class

output
-------------
This is not a default message
Message is overridden

   

Pointy Problem

Let's define an array as "pointy" if it monotonically increases from element to some element k and then monotonically decreases from k onwards. (0 <= k).

Example: [1,2,3,4,5,4,3,1]
Not Pointy: [1,2,3,5,3,6,1]

Given an array "s", modify it so that it is pointy.

MySolution:


public class Pointy {

    public boolean isPointy(int array[])
    {
        boolean isdecreasing=false;
        int current=array[0];
        boolean finalres=false;
        int index=0;
        for(int i=1;i<array.length;i++)
        {
            if(current<=array[i])
            {
                current=array[i];
            }
            else
            {
                index=i-1;
                isdecreasing=true;
           
            }
            if(isdecreasing)
            {
                finalres=passing(index,array);
           
                break;
            }
           
        }
        return finalres;
    }
    public boolean passing(int index,int array1[])
    {
        boolean res=false;
       
        for(int i=index+1,j=1;i<array1.length;i++,j++)
        {
           
            if(array1[index-j]!=array1[i])
            {
               
                break;
            }
            //if there is
            if(i == array1.length-1)
                res=true;
        }
        return res;
    }
   
    //main method
    public static void main(String args[])
    {
        Pointy p=new Pointy();
        int ar[]={1,2,3,5,3,6,1};
        if(p.isPointy(ar))
            System.out.print("It is pointy");
        else
            System.out.print("It is not a pointy ");
    }
}

output:
--------------------------
It is not a pointy

Thứ Bảy, 7 tháng 2, 2015

Amazon coding round question for fresher

Question

Given a number A, find the smallest number which has only 1s and 0s as its digits which divisible by the number A. For example: if the given number A is 4, the smallest number with 1s and 0s is which is divisible by 4 is 100.

My solution stratagy:

Am gona take a maximum 8 bit digit to stop my checking process(You may get result between these numbers surely).get remainder for each element and check for individual digits ,if these digits were 0 or 1 proceed further else stop algorithm.




FindNumber.java

package com.shashi.carrercup;

/**
 *
 * @author shashi
 */
public class FindNumber {
   
    public static void main(String args[])
    {
        FindNumber n=new FindNumber();
        System.out.print(n.getNumber(4));
    }
    public  int getNumber(int number)
    {
        //check for invalid condition
        if(number<0)
            return 0;
        //if not do some operations
        //let take maximum 8 bit digit
        int max=11111111;
         int current;
         int c1=0;
        for(int i=2;i<max;i++)
        {
            //take the current number
            boolean check=false;
             current=number*i;
            //copy number
            c1=current;
            while(current>0)
            {
                int rem=current%10;
                if(rem == 0 || rem == 1 )
                {
                    current=current/10;
                    if(current == 0)
                    {
                        check=true;
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
            //you got first min if check is true
            if(check)
                break;
        }
         return c1;
    }  
 }
 

result;
-------------
100


 

Shop selling problem

Question:
Mr. Xhas recently shut down his factory and wants to sell off his metal rods to a local businessman. Mr. Octopus has many rods whose length are represented by array - lengths = {lengths[0], lengths[1], lengths[2],...}.The local businessman will only pay for rods that have same length. Let's say Mr. Octopus plans to sell rods of lengthL only. Then he had to cut each rod 0 or more time, so that he can maximize the profit. The remaining rods whose length is not L will be thrown away. Price of N rods of length L will be N × L × unit_price. Also note that for each cut made to a rod, he had to pay cut_cost.

What is the maximum amount of money Mr. Octopus can make? You have to complete the function int maxProfit(int cut_cost, int unit_price, int[] lengths).

My Solution Stratagy:

The problem states we have to find solution in such a way that seller must get maximum profit.you can do this by cutting irons with minimum length(I assume that if we take a minimum length iron ,we can cut  lot number of pieces ,so that seller profit become high)

pseudo code :

1.get the minimum length iron from given array of items

2.cut each and every iron with respect to minimum length iron

3.thrown away if some of irons length not compatable with minimum iron.


Program Solution:

ShopSelling.java
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package craeercu.com;

/**
 *
 * @author shashi
 */
public class ShopSelling {
   
    //the person gives iron ores ,cuting cost,unit cost return total cosst
    public int totalcost(int unitcost,int cuttngcost,int[]irons)
    {
       
        //to get max profit select a minimum length iron from given itorns
        //get the min length iron
        int shortiron=miniron(irons);
        //get each and every irin from the array of irons and match with shortiron
        //if it is equal  or atleast great
        int numberofirons=0;
        int noofcuttings=0;
        int currentiron;
        int aftercutting;
        for(int i=0;i<irons.length;i++)
        {
            //get the first one
           currentiron=irons[i];
           //check for x length ie short
           if(currentiron>shortiron)
           {
               //cut this till you find some exact length
               while(currentiron>=shortiron)
               {
                   aftercutting=currentiron-shortiron;
                   noofcuttings++;
                   numberofirons++;
                   currentiron=aftercutting;
               }
           }
           if(currentiron==shortiron)
           {
               //for same length irons
          
               numberofirons++;
           }
          
           
        }
        //calclate final result
        int result=(numberofirons*unitcost*shortiron)-(noofcuttings*cuttngcost);
        return result;
    }
    public int miniron(int []irons)
    {
        int min=irons[0];
        for(int i=1;i<irons.length;i++)
        {
            if(irons[i]<min)
                min=irons[i];
        }
        return min;
    }
 
   
}

MainClass

/**
 *
 * @author shashi
 */
public class CraeercuCom {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        ShopSelling sell=new ShopSelling();
        int []irons={10,20,30,40};
        int cost=sell.totalcost(10, 1, irons);
        System.out.print(cost);
    }
   
}