Rss Feed Like Us on facebook Google Plus
Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

September 16, 2014

Get Mobile Number of Sim Card on Android Device

You can use the TelephonyManager to do this:
TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); 
String number = tm.getLine1Number();
The documentation for getLine1Number() says this method will return null if the number is "unavailable", but it does not say when the number might be unavailable.
You'll need to give your application permission to make this query by adding the following to your Manifest:
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
(You shouldn't use TelephonyManager.getDefault() to get the TelephonyManager as that is a private undocumented API call and may change in future.)





Example

Activity Class Look Like This

Class
GetMyPhoneNoActivity 
package com.kns;
 
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.widget.Toast;
 
public class GetMyPhoneNoActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);        
    
        String number =getMyPhoneNO();
        Toast.makeText(getApplicationContext(), "My Phone No is: "
        +number, Toast.LENGTH_SHORT).show();
        Log.v("Debug", number);        
    }
    
    private String getMyPhoneNO(){
     TelephonyManager mTelephonyMgr;  
     mTelephonyMgr = (TelephonyManager) getSystemService
       (Context.TELEPHONY_SERVICE);   
 
     String yourNumber = mTelephonyMgr.getLine1Number();
  return yourNumber; 
    }     
}

Permission in Manifest File
<uses-permission android:name="android.permission.READ_PHONE_STATE">
</uses-permission>


Read More

February 15, 2012

Programming Languages that Tech Entrepreneurs started with

Ever wonder where the biggest inventions started out, and by whom? Here is a list of programming languages, and frameworks that are behind some of the greatest technologies.
 

Facebook


Name of Developer: Mark Zuckerberg


Year:2004


Framework or Programing Language: PHP



This social networking site, which is the largest in the world, uses the PHP hypertext processor that is used for server-side scripting. Mark Zuckerberg wrote the site’s code and launched then named Thefacebook in 2004, when he was still a student at Harvard. His idea for Thefacebook came from his first attempt in late 2003, named Facemash. Facemash was later shut down by the universities’ administration.


LinkedIn


Name of Developer: Reid Hoffman


Year:2002


Framework or Programing Language: Java, C++



 Reid Hoffman, an employee at Paypal left to start this social networking site and was joined by Chris Saccheri and Lee Hower. The front end of this site is built on Java, and C++ helps take care of a few of its in-memory caches. The site allows users to connect via a “gated-access approach” which requires professionals on the site to have a pre-existing relationship, or the intervention of a common contact to connect. The site meant for professionals became popular very quickly, as a result of its strictly vocational interests, and went public last year.





iOS


Name of Developer: Steve Jobs


Year: 2007


Framework or Programing Language: Mac OSX, Darwin OS



This smooth operating system is used on the iPod Touch, iPhone, iPad and other Apple devices that have a touch-based interface. It is a derived operating system that is based on the Mac OSX. Both Mac OSX and the iOS have their roots in the Darwin operating system which was developed on UNIX predominantly by Apple, but also had contributions from NeXTSTEP, BSD, and other free software projects.



Android


Name of Developer: Andy Rubin


Year: 2003


Framework or Programing Language: Linux



This OS which is popularly used on smartphones, and tablets, is a Linux-based system that was developed by Andy Rubin and Rich Miner along with Nick Sears and Chris White in 2003. Their vision, according to Rubin, was to develop “smarter mobile devices that are more aware of its owner's location and preferences”. Development for the OS is now undertaken by the Open Handset Alliance which is piloted by Google.



WiFi


Name of Developer: Vic Hayes


Year: 1999


Framework or Programing Language: IEEE 802.11 family



WiFi is the brand name used for products that comply with the IEEE 802.11 family of standards. Vic Hayes, who developed a number of primary standards within the IEEE is known as the “Father of WiFi”. Since 2000, the internet was made available anywhere and at anytime because of the widespread use of this technology. This mechanism which allowed devices to exchange data wirelessly changed the face of technology and allowed laptops to become more popular than even desktop computers.




Linux


Name of developer: Linus Torvalds


Year:1991


Framework or Programing Language:inspired by MINIX



This Unix-like OS was initiated by Linus Torvalds in an attempt to build a portable operating system that was similar to the MINIX system. Since the scope of the MINIX system was limited to educational use, Linus started working on the kernel of the Linux system in 1991, and has contributed to about 2 percent of the entire system. The Linux system is built on the free and open source software development model and Torvalds retains the rights to determine which properties are retained by the kernel. Linux is one of the most preferred operating systems in the world, with a number of super- computers running on it.





Ruby


Name of Developer: Yukihiro Matsumoto


Year: 1990’s


Framework or Programing Language: Inspired by Perl



This programming language, developed in the 1990’s by Yukihiro Matsumoto from Japan, was inspired by the Perl and Eiffel languages, and has a couple of features from the Smalltalk OOPs. The specifications of Ruby language are developed by the Open Standards Promotion Center of the Information-Technology Promotion Agency (in Japan). Matsumoto stated that he decided to create the language because of the need for a "...language that was more powerful than Perl, and more object-oriented than Python."

Read More

© 2011-2016 Techimpulsion All Rights Reserved.


The content is copyrighted to Tech Impulsion and may not be reproduced on other websites.