Wednesday, December 26, 2012

Wirelessly manage your Android from your favorite browser


Android, touchscreen keyboards may not sometimes the ideal surface for getting things done. A physical keyboard and computer are sometimes faster for many tasks, but there are a number of things they can’t do that a mobile or a tablet can do. So this problem can be solved by an “Airdroid”.

Airdroid is a fast, free app that’s lets you wirelessly manage and control the Android devices such as phone and tablet from a web browser.  It is designed with the vision to bridge the gap between the Android device and web browser, on desktop computer on Windows, Mac/iOS or Linux. Airdroid for Android replaces your USB cable with your web browser. It actually functions as a web server, allowing your Android device and your computer to communicate over the network.

            Fig 1. Airdroid with the Android and Desktop



Requirements to run Android:
  • Airdroid should be compatible with most Android devices running Android 2.1 or later (4.0 is not supported yet).
  • Web Desktop should be compatible with most modern web browsers, including Chrome, Firefox etc.
  • Android device and the computer should be in the same WiFi network to connect.
Now, to start with Airdroid app, you need to first download and install it on your Android devices. The set up will take about five seconds. Airdroid is available from the Android market. Launch the Airdroid app once it’s installed and then tap Start to start the Airdroid server. Then open your favorite web browser, input the address and give a dynamic password to login in phone and give the same address and dynamic password to login to Airdroid Web Desktop. Dynamic password is generated each time the Airdroid app is started and will be displayed on the homescreen if no predefined Password is set. But if you want to set a predefined password then you can do this by doing the changes in the settings, i.e. enabling the predefined password and set the password as it is by default disabled. But Dynamic passwords are better for security purposes. Remember the requirement that both Android device and computer should be in the same WiFi network to connect.


Once you have connected, you’ll see Airdroid’s homescreen, which contain all your   contents of your Android device. And now, you're ready to do a pretty amazing number of things. 

This App has following access:-

  • Files:- You can transfer files between your Aindroid device and your computer.  Now it also has the drag and drop support. You can cut, copy, paste, search, rename or delete files on the SD card
  • SMS:-If you hate typing messages on your Android device, Airdroid will let you send, receive and view messages from the browser based interface.
  • Apps:- You can install, uninstall, backup, search and do batch processing on your Android device through the web browser and the computer.
  • Photos:-You also can delete, preview, upload, download, set as wallpaper and photos slide show from your desktop.
  • Clipboard:- You can share the clipboard text between desktop and Android device.
  • Contacts:- You can also manage your phone contacts i.e. you can search, group, create, delete your contacts and also can delete the call logs.
  • Music & Ringtones:- You can play, search, upload, download, delete and customize ringtones for your phone calls, notifications and alarms.
  • Videos:-Mobile devices are great for videos shooting but for viewing those clips, the big screen of your desktop is best.
  • Real-time Android screen:-With some devices you can even control your Android's screen, take screenshots, or make a screencast.
  • Multiple virtual desktops:- Airdroid is designed for multitasking. You can move apps between desktops to better organize with your work.
  • More features:-Photo match for most of the devices, various widgets like calendar, weather, url transfer etc.
 Airdroid also comes with some in-built features. They are as follows:-

  • Device status:-It also shows the real-time ROM, SD card, Battery, CPU and RAM status report. And it also gives you a pictorial representation with charts to demonstrate the available/used/total resources, and one-tap memory boost.
  • Tasks manager:-It kills or uninstall the running apps, batch operation are also supported.
  • Apps manager:-It also uninstall, share or check details of user and systems apps.
  • Files:-It also control, cut, copy, rename, send/share, delete, sort and create visible or hidden folders and files.
It is remarkably a comprehensive app, operates securely and it’s free to download. So have fun with Airdroid.

Monday, December 24, 2012

TestDisk: A Tool for Backup and Data Recovery on Linux....


Part II:
As we have learnt in my last blog regarding Data recovery in Windows. In this post we will learn the technique to backup and recover the data on Linux Operating System.
To backup and recover the data we will use the testdisk as a recovery tool.
Step I:-
     get install TestDisk on your Linux Distro
E.g :-
On Fedora: - run following command on your terminal
     sudo yum install testdisk
On Ubuntu:- run following command on your terminal
            sudo apt-get install testdisk
TestDisk checks and recovers lost partitions. It works with following file systems:
          - BeFS (BeOS)
          - BSD disklabel (FreeBSD/OpenBSD/NetBSD)
          - CramFS, Compressed File System
          - DOS/Windows FAT12, FAT16 and FAT32
          - HFS and HFS+, Hierarchical File System
          - JFS, IBM's Journaled File System
          - Linux Ext2 and Ext3
          - Linux Raid
            RAID 1: mirroring
            RAID 4: striped array with parity device
            RAID 5: striped array with distributed parity information
           RAID 6: striped array with distributed dual redundancy information
          - Linux Swap (versions 1 and 2)
          - LVM and LVM2, Linux Logical Volume Manager
          - Mac partition map
          - Novell Storage Services NSS
          - NTFS (Windows NT/2K/XP/2003/Vista)
          - ReiserFS 3.5, 3.6 and 4
          - Sun Solaris i386 disklabel
          - Unix File System UFS and UFS2 (Sun/BSD/...)
          - XFS, SGI's Journaled File System 
Test Disk also backups the file. To back up the files one can use testdisk effectively on Linux Operating System by the following steps:
Linux Operating System by the following steps:
Step II:-
Run testdisk by the command “testdisk” on to the terminal.
Step III:-
After running testdisk command you will get the following testdisk window in the same shell....
fig 1. testdisk

Now for backing up the file you can view it in the log file so press enter on the first option i.e. create.
Now it will show the disk detected (normally it is a hard-disk) 
Fig 2. Proceed


fig 3. press enter

fig 4. select your appropriate partition and press enter

fig 5. select analyse as we are backing up 


fig 6. select appropriate drive to backup and press enter on Backup 


fig 7. if you want to search in other OS (here Windows Vista) then press Y otherwise  press N.

fig 8.Select the disk to be backed up


fig 9. Select Write operation to take the backup

fig 10. Confirm to Write Partition Table
fig 11 Reboot the system
Now your new partition is created and the respective drive is backed up.
To see the log file and backup file you can go into your home folder, there you will find two log files i.e.
1>backup.log
2>testdisk.log
To see the contents of that file you may view it through log file viewer.
That's all, now you have back up of your files and you are able to restore it back even if it’s   deleted.


Saturday, December 22, 2012

Compile and execute C++ program on Linux



The Borland Turbo C++ compiler which works on Windows operating System, does not have all the capabilities of C++ programming. The core C++ compiler is present on Linux operating System. The gcc is bundled with the compiler of C++ too. It is basically GNU C/C++ Compiler Collection. You may use g++ compiler to compiler your C++ program file on Linux.

Let's see, how to do it.

1.      Open any text editor such as gedit, vi, vim, or emacs and types your program in it. Save the file with extension .cpp. It is required to identify that the file contains C++ code.
2.      You need to write this code in pure C++ format. Look at the program no.1, which is written for Turbo C++ compiler and program no. 2 is written for gcc/g++ compiler.

#include<iostream.h>
class Add
{
public:
int calculate(int a, int b)
{
return a + b;
}
};
void main()
{
int x, y, z;
Add a;
cout<<"Enter two numbers: ";
cin>>x>>y;
z = a.calculate(x, y);
cout<<"\nAddition is: "<< z <<endl;
}
Program 1: Written for Turbo C++ Compiler.


#include<iostream>      //Line-1
using namespace std;    //Line-2
class Add
{
public:
int calculate(int a, int b)
{
return a + b;
}
};
int main()              //Line-3
{
int x, y, z;
Add a;
cout<<"Enter two numbers: ";
cin>>x>>y;
z = a.calculate(x, y);
cout<<"\nAddition is: "<< z <<endl;
}
Program 2: Written for Linux g++ compiler.

3.      Look at the changes made in the second program, which is written for g++ compiler. In line number-1 #include<iostream> is written instead of #include<iostream.h>. All C++ related header files must be included in this fashion only. If C programming header files such as stdio.h are required then these are included as usual fashion such as #include<stdio.h>.
4.    The Line-2 is an extra line in program-2. It is pure C++ statement. In C++, namespaces allow to group entities like classes, objects and functions under a name. This way the global scope can be divided in "sub-scopes", each one with its own name. The keyword 'using' is used to introduce a name from a namespace into the current declarative region. All the files in the C++ standard library declare all of its entities within the std namespace. That is why we have generally included the using namespace std; statement in all programs that used any entity defined in iostream.
5.      The robust compiler like g++ says that your main() function must return only 'int', it must not be void. It is compulsory to return the int from main().
6.      In order to compile the program use command g++ on the terminal:

g++ add.cpp             [Command-1]

7.      It will compile the file, check for the errors, prints on screen if any and generates an a.out output file. The a.out is default output file name of g++ compiler. You may change it by providing -o option to the command such as,

g++ add.cpp -o addition [Command-2]

8.      Now, this will generate output executable file by name 'addition'.
Now execute the file as,

./a.out                 [Command-1 output]
./addition              [Command-2 output]

9.      Your program will get executed and generate output.

Enter two numbers: 56 41
Addition is: 97