Tuesday 28 June 2016

HOW  TO MAKE    A  PHONE CALL USING ANDROID APP??

                                        
Android provides Built-in applications for phone calls, in some occasions we may need to make a phone call through our application. This could easily be done by using implicit Intent with appropriate actions. Also, we can use PhoneStateListener and TelephonyManager classes, in order to monitor the changes in some telephony states on the device.
This chapter lists down all the simple steps to create an application which can be used to make a Phone Call. You can use Android Intent to make phone call by calling built-in Phone Call functionality of the Android. Following section explains different parts of our Intent object required to make a call.

Intent Object - Action to make Phone Call

You will use ACTION_CALL action to trigger built-in phone call functionality available in Android device. Following is simple syntax to create an intent with ACTION_CALL action
Intent phoneIntent = new Intent(Intent.ACTION_CALL);
You can use ACTION_DIAL action instead of ACTION_CALL, in that case you will have option to modify hardcoded phone number before making a call instead of making a direct call.

Intent Object - Data/Type to make Phone Call

To make a phone call at a given number 91-000-000-0000, you need to specify tel: as URI using setData() method as follows −
phoneIntent.setData(Uri.parse("tel:91-000-000-0000"));
The interesting point is that, to make a phone call, you do not need to specify any extra data or data type.




Now see the following code :









NOW AFTER INSTALLATION OF APP & FILLING NECESSARY DETAILS ......
THE FOLLOWING OUTPUT IS RECIEVED.......



SO FOR MORE EASY & INTERESTING POSTS AHEAD IN LATEST TECHNOLOGIES ........STAY TUNED WITH techgenes.com......

Sunday 9 August 2015

Why Windows 10?

Windows 10 is the OS that will impact the maximum number of people on this planet. Bigger than anything on any apple device, bigger than any android platform update, bigger than any app with new version. That's because about 1.5 billion (yes,billion) people use Windows as their primary OS on desktops,notebooks and tablets- and each of them wants to know if they should risk an upgrade. Windows 8 turned out to be real clunker for most. It was an OS in search of an identity. It wanted to be a touchscreen OS but really messed up the notebook and tablet users. It wanted to be radical but went too far with its live tiles and no start-button stubbornness. Thus a lot of people are wary about Win10. Here are your answers....

THE BIG QUESTION 

Yes,it does have a start button. A really good one. It takes all of what was good about the OSes before and adds some great functionality. It has all the real goodies you need and adds live tiles but in a controlled space.

THE OTHER BIG QUESTION 

Win10 has Cortana and yes, shes's coming to India. She'll also understand India accents. If you don't know who Cortana is, do let me know the shape and size of the stone you were under. Cortana is the name of AI(Artificial Intelligence) voice assistant built into the mobile version of windows and she's now making an appearance on Win10. Arguably, it's superior to Apple's Siri and Google version, with some smart features as well as a fantastic ability to build a profile around the user and offer help. She understands plain-language queries so you don't have to structure question, she refers to you by your name and also got some humour in her.

IS IT REALLY FREE? 

Yup. It really is. There's no sleight of hand and no elaborate fine print here. If you have a legitimate copy of anything above and including Win7,you get Win10 for free. Forever! Further upgrades happen after a year, but in essence, Win10 for you is free. If you have a pirated version then thing get a little more complicated.

SO WHAT'S TO LIKE? 

Lots, actually. Task view is a new feature and real revolution in true multitasking as it provides full thumbnail previews of all open apps and can be used to manage multiple desktops. Frankly, it's better  than anything I've used on any laptop  with any OS. Win10 also has a central notifications area, called Action Center where literally everything going and all messages accumulate in one easy-to-use area. Microsoft Edge is the new browser that comes with slick features. It's fast, comes with a reading mode that removes all clutter from a web page, a read later area that saves things for offline reading and of course Cortana works here too. The good part is that Win10 is lighter and runs easily on old hardware that has Win7 or even XP. New Win10 embedded versions run on a Raspberry Pi or even on a TV stick.
So, should you upgrade to Win10? Considering it's free, fast, and you don't need to invest in new hardware, plus the OS is actually good. I really don't see a plausible reason for anyone thinking otherwise.


Wednesday 5 August 2015

Microsoft Lacks Here

Well this post is not just to the frustation I am bearing with the developers of Microsoft, Infact it is the bitter truth that most of developers do feel and have practically realised...

Lol to the Developers of Community

One may not be pretty sure even after targetting the biggest downloads of microsoft softwares. No doubt it is leading at many places but at the same time it lacks too. Here are some of my experiences with largest software applications;;;

The Biggest OS release 8.1 a BOON or a NUISANCE

Amazed with the graphics or the new startup thought of 8.1? Well here are some more things you should know about it. The wifi connectivity for windows 8.1 is worst. Often many of us might have experienced it.
When we talk about GAMES , clearly one could easily understand microsoft is to promote its own Xbox games. The worst experience is all the shit about making big updates and also one is still not pretty sure about the working of that big troublesome;

The troubleshoot feature is no more than a big shit.


The only browser By microsot -Internet Explorer

Although Internet Explorer provides a good sort of security but there is a trafficing problem for explorer. And that is the reason why it responds slow to social networking sites like facebook, twitter etc.


In this pace of microsoft vs Google Microsoft stands no where beside google. The stock price for Microsoft is Stock price
MSFT (NASDAQ)US$ 47.58 +0.04 (+0.08%)
5 Aug, 4:01 PM 

while
Google
Stock priceGOOG (NASDAQ)US$ 643.78 +14.53 (+2.31%)
5 Aug, 4:01 PM



Talking about the Environment or Developing Platforms By microsoft

Microsoft after its biggest release of Visual studio 2015 is stilll full of quite many bugs. Installing Visual studio means crapping up of disk space nothing rally more than that.
That is the reason one is advisable to install other platforms like Eclipse(luna/mars) rather than visual studio.
So this makes the platform a little procedure oriented.


The Revolutionary Upgrade for Windows 10 offering Errors


One has been Upgrading to windows 10 since 29th of July.
There are two option of either reserving your upgrade or downloading it via Media Creation tool. Many of us did by reserving but even after making a big download of about 2.72 GB. There is an installation error offered.






Sunday 2 August 2015

C Code For Bisection Method

Bisection Method: The following method is used to find the accurate roots of transcendental equation and polynomial equation.
The transcendental equation is the equation which contains trigonometric,algorithmic and exponential functions associated with it for ex: xsinx-logx+1=0. With the help of following code every time you can modify your function and can find root in one go without any pen and paper. Lets get started...

PSEUDO CODE: 

1)First we will input two intervals for desirable function.
2)We will check whether their function values lies in range or not if yes then programme continue else it will display wrong intervals and will exit the programme.
3)If intervals will be correct then value of x2 will be find out and for every interval its function value    will be stored.
4)Again we will check function values of intervals and accordingly intervals will be assigned
5)This whole programme will be exectued untill we will find our root upto desirable decimal place 

C-Code:

#include<stdio.h>
#include <math.h>
#include<conio.h>
#define ESP 0.001 //For finding root upto desirable decimal digit
#define F(x) (x)*(x)*(x) + (x)*(x) + (x) + 7 //For defining function
void main()
{
  int i = 1;
  float x0,x1,x2; //Intervals
  double f1,f2,f0,t; //Function

  printf("\nEnter the value of x0: ");
  scanf("%f",&x0);

  printf("\nEnter the value of x1: ");
  scanf("%f",&x1);
  if(f0*f1<0)
 { printf("\n__________________________________________________________________\n");
  printf("\niteration\t x0\t       x1\t x2\t   f0\t   f1\t   f2");
  printf("\n___________________________________________________________________\n");
  do
  {
  x2=(x0+x1)/2;
  f0=F(x0);
  f1=F(x1);
  f2=F(x2);
  printf("\n%d %f %f %f %lf %lf %lf", i, x0,x1,x2,f0,f1,f2);
  if(f0*f2<0)
   {
    x1=x2;
   }
   else
   {
    x0=x2;
   }
   i++;
  }while(fabs(f2)>ESP);
printf("\n__________________________________________________________\n");
printf("\n\nApp.root = %f",x2);
}
else 
{ printf("\nIntervals are not correct\n");
   exit(0);
}
getch();
}
NOTE:
this code is written in codeblocks GNU GCC compiler
this code might encounter issues when tried to run in turboC or any other compiler

Saturday 1 August 2015

c program for checking mutual exhaustivity of two sets

I love to code much more than anything else.I am just a noob in the world of programming but still I try to code any possible problem that comes in my mind.Today in my discrete mathematics class mutual exhaustivity and mutual exclusivity was going on.I thought why not design a program for checking whether two sets are mutually exhaustive or not.
I have written code for this program using two approaches
In the first approach i will straight out compare whether all elements of U are contained in A and B or not,In the second approach i will be first forming a union of set A and B and then comparing it to universal set.
the below text is in reference to first approach 

What are mutually exhaustive sets??
the sets whose union when combined together forms universal set then such set is known as mutually exhaustive sets.for example
U={1,2,3,4,5}
A={1,2,3}
B={1,4,5}
then as A union B = U,set A and B are mutually exhaustive sets
PSUEDOCODE
  • Firstly we will take input for universal set,set A and set B
  • Then we will check whether set A and set B are valid sets or not i.e. all elements contained in set A and set B belong to universal set or not .
  • If any exception is found we will immediately exit mentioning the sets are not mutually exhaustive
  • If number of elements in set A and set B are equal to or greater than elements in universal set then we will continue
  • otherwise exit  because if  number of elements in set A and set B are less than elements in universal set then how is it possible that a union B will form universal set
  • then we will pick one by element of Universal set and check whether it is contained in A or B if any element is found that is not in A ir B then it is not mutually exhaustive if found then counter is increased by one
  •  if at the end the value of counter is equal to number of elements n universal set than they are mutually exclusive set
CODE
___________________________________________________________________________________
#include<stdio.h>
main()
{
    int u[100],a[100],b[100],nu,na,nb,i,j,k,count=0;
    printf("\nenter the number of elements in universal set,set a& set b\n");
    scanf("%d%d%d",&nu,&na,&nb);
    printf("\nenter the elements in universal set\n");
    enterElements(u,nu);
    printf("\nenter the elements in set A\n");
    enterElements(a,na);
    if(validSet(u,nu,a,na)==-1) /* because function returns -1 if it is not a valid set */    {
        printf("non mutually exhaustive");
        exit(0);
    }
    printf("\nenter the elements in set B\n");
    enterElements(b,nb);
    if(validSet(u,nu,b,nb)==-1) /* because function returns -1 if it is not a valid set*/
    {
        printf("non mutually exhaustive");
        exit(0);
    }
    if(na+nb>=nu &&(nu>na && nu>nb)) /* the number of elements in set A and set B should be equal or greater than number of elements is universal set to be mutually exclusive*/
    {
        for(i=0; i<nu; i++)
        {
            for(j=0; j<na; j++)
            {
                if(*(u+i)==*(a+j)) /* for exiting the inner loop of set A */
                {
                    count++;
                    break;
                }
            }
            if(*(u+i)==*(a+j)) // for going on to next iteration            

{
                continue;
            }
            for(k=0; k<nb; k++) // for exiting the loop of set B
            {
                if(*(u+i)==*(b+k))
                {
                    count++;
                }
            }
        }
        if(count==nu)
        {
            printf("\nthe sets are mutually exhaustive\n");
        }
        else
            printf("\n the sets are not mutually exhaustive");
    }
    else
        printf("\n the sets are not mutually exhaustive");
}
enterElements(int *arr,int len) //function for entering elements in an array
{
    int i;
    for(i=0; i<len; i++)
    {
        scanf("%d",&*(arr+i));
    }
}
validSet(int *u,int nu,int *arr, int len) /* function for checking whether an entered set is valid subset of universal set*/{
    int i,j,count=0;
    if(len>nu)
    {
        printf("invalid set");
        return -1;
    }
    for(i=0; i<len; i++) /* this whole loop is for comparing each element in set A with universal set */
    {
        for(j=0; j<nu; j++)
        {
            if(*(arr+i)==*(u+j))
            {
                count++;
                break;
            }
        }
    }
    if(count==len) /* if count is not equal to length of array that means some other element other than universal set is present in Set */    {
        return 1;
    }
    else
    {
        return -1;
    }
}

___________________________________________________________________________________ 

NOTE:
this code is written in codeblocks GNU GCC compiler
this code might encounter issues when tried to run in turboC or any other compiler