Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ Android Get App version number and version name     - Using RAID in Linux: Create a RAID 5 (Linux)

- Use window.name + iframe cross-domain access to data Detailed (Programming)

- Redis configuration file interpretation (Database)

- Yii2 Advanced Version Copy New Project Problem Solved (Programming)

- HTTPS and SSH and use the difference between the way: Git User's Manual (Linux)

- Linux beginners to develop the seven habits (Linux)

- Examples of safety testing system notes for RedHat Linux (Linux)

- CentOS 7 hard disk expansion toss record (Linux)

- DM9000 timing settings (Programming)

- Setting grep Highlight Matches (Linux)

- Linux install and configure Heartbeat (Server)

- CentOS 6.5 installation using a data recovery software extundelete (Linux)

- Reset CentOS / RHEL root account password 7 (Linux)

- Linux basic introductory tutorial ---- regex basis (Linux)

- Laravel cache paged results (Server)

- Rely on IP chain established Linux firewall (Linux)

- CentOS7 virtual machine creation failed Solution (Linux)

- Node.js developers must know four JavaScript concepts (Programming)

- Why JavaScript basic types can invoke methods (Programming)

- Linux itself disguised illusion strengthen security (Linux)

  Android Get App version number and version name
  Add Date : 2017-08-31      
  Android Get App version number and version name

// Here's how to get the version information

  // The version name
  Public static String getVersionName (Context context) {
   Return getPackageInfo (context) .versionName;

  //version number
  Public static int getVersionCode (Context context) {
   Return getPackageInfo (context) .versionCode;

  Private static PackageInfo getPackageInfo (Context context) {
   PackageInfo pi = null;

   Try {
    PackageManager pm = context.getPackageManager ();
    Pi = pm.getPackageInfo (context.getPackageName (),

    Return pi;
   } Catch (Exception e) {
    E.printStackTrace ();

   Return pi;
- Installation under Linux to deploy Java (Linux)
- Ubuntu 14.04 LTS to compile the source code Android4.4.2 (Linux)
- Oracle common internal event tracking number (Database)
- The Hill sorting algorithm (Programming)
- To compile and install MySQL 5.7.7 RC under CentOS 7.1 (Database)
- sed and awk in shell usage and some examples (Linux)
- Linux can modify the maximum number of open files (Linux)
- Error: Unable to establish connection with FTP SFTP server (Server)
- RVM installation instructions (Linux)
- SSH port forwarding application (Server)
- Install Apache streaming media services on CentOS 6.4 (Server)
- Red Hat Linux mount U disk (Linux)
- NaSC using simple mathematical operations on Ubuntu and Elementary OS (Linux)
- ogg Oracle to SQL Server 2005 to achieve synchronization (Database)
- Linux how to prohibit the use of Ping command (Linux)
- Ubuntu 14.04 install Sublime Text 3 plug and use SublimeClang (Linux)
- Installation of Ubuntu Make under Ubuntu 15.10 (Linux)
- Linux check disk parameters trapping lack amendments (Linux)
- Using Python to find a particular file extension directory (Programming)
- Open log in Hibernate (Programming)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.