Sunday 26 July 2015

Image Clicked in background using android camera service

Image Clicked in background using android camera service

hi friends,
Today i am going to taught how to create spy camera, basically if you want your smart phone camera clicked image in background with out using any fore ground graphics then you use this concept.
this idea you can use to create security application locker. This is also an example of android service that help to click picture in background.

Requirement to Create Spy Camera:-


1. we have to create an service that run camera application in background.
2.we have to give external storage write and  using camera permission in android manifest file.



Complete Code:


Android Activity code:



package com.apsmind.spycamera;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity1 extends Activity {


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_activity1);

startService(new Intent(MainActivity.this, CameraService.class) );

}

android Service Class : create a class name CameraService.


package com.apsmind.spycamera;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.hardware.Camera;
import android.hardware.Camera.Parameters;

import android.os.IBinder;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.widget.Toast;

public class CameraService extends Service
{
static int x=0;
      //Camera variables
      //a surface holder
      private SurfaceHolder sHolder; 
      //a variable to control the camera
      private Camera mCamera;
      //the camera parameters
      private Parameters parameters;
      /** Called when the activity is first created. */
    @Override
    public void onCreate()
    {
        super.onCreate();
         
    }
    @Override
    public void onStart(Intent intent, int startId) {
      // TODO Auto-generated method stub
      super.onStart(intent, startId);
     
       mCamera = Camera.open();
       SurfaceView sv = new SurfaceView(getApplicationContext());
   

       try {
                  mCamera.setPreviewDisplay(sv.getHolder());
                  parameters = mCamera.getParameters();
                   
                   //set camera parameters
                 mCamera.setParameters(parameters);
                 mCamera.startPreview();
                 mCamera.takePicture(null, null, mCall);
            
            } catch (IOException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
            }
       
       
       //Get a surface
         sHolder = sv.getHolder();
        //tells Android that this surface will have its data constantly replaced
         sHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
    }

     
     
    Camera.PictureCallback mCall = new Camera.PictureCallback()
    {
  
       public void onPictureTaken(byte[] data, Camera camera)
       {
             //decode the data obtained by the camera into a Bitmap
     
             FileOutputStream outStream = null;
                  try{
                   x++;
                      outStream = new FileOutputStream("/sdcard/Image"+x+".jpg");
                      outStream.write(data);
                      outStream.close();
                      mCamera.release();
                      Toast.makeText(getApplicationContext(), "picture clicked", Toast.LENGTH_LONG).show();
                  } catch (FileNotFoundException e){
                      Log.d("CAMERA", e.getMessage());
                  } catch (IOException e){
                      Log.d("CAMERA", e.getMessage());
                  }
     
       }
    };


      @Override
      public IBinder onBind(Intent intent) {
            // TODO Auto-generated method stub
            return null;
      }
}



Android Manifest File :



<?xml version="1.0" encoding="utf-8"?>
    package="com.apsmind.spycamera"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.CAMERA"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.apsmind.spycamera.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <service  android:name="com.apsmind.spycamera.CameraService"></service>
    </application>

</manifest>


To Learn Interesting and Live project Base Android Application Development join Apsmind Technology Pvt Ltd.http://www.apsmind.com (Training)http://www.apsmindtech.com  (Development)

Thursday 28 May 2015

internship-training-delhi

INTERNSHIP TRAINING IN DELHI




APSMIND Technology offers various type of Live Project Based industrial internship training on different - different technologies like Java, .Net, Android, PHP, Web Development, Web Designing, Web promotion, Networking SEO, Digital marketing, Ethical Hacking etc.

Why you Join Apsmind Technology?


APSMIND TECHNOLOGY one of the reputed and ISO 9001-2008 Certified Company.
Like Other Institute APSMIND not only institute but also a Mobile Application and Web Development Company. At APSMIND, you Learn Things in new way and also get Practical training with live scenario. You get guidance of Real Time Developer. After Completing Training we also provide Job Assistance.

Course Duration:


45 days to 60 days.

Course Fee:

8500 single student
7500 for 3+student
6500 for 5+student  
5500 for 8+ student

Course fee vary according to technology and content.

What we Provide after after completion of Training.

i) Course completion certificate provided  APSMIND TECHNOLOGY Training Department.
ii)Experience Letter Provided By APSMIND TECHNOLOGY Development Department.





Saturday 26 April 2014

phonegap-training

PHONE GAP TRAINING IN DELHI
APSMIND Technology Offers phonegap Training program. phonegap is a Framework enables a developer to create Cross platform Mobile application. It supports the HTML 5, Java Script, CSS 3, for mobile application development.

Our Trainer provide training on latest HTML 5, CSS 3, advance JavaScript that are used to make cross platform mobile application that run on more than one operating system like Android, IOS, Windows, Blackberry etc. 
We provide phonegap Training program according to current Market Demand. Our Specialist Trainer conduct the class and explore new ideas and experience with current marketing. APSMIND Technology Pvt. Ltd. one of leading institute in the field of Mobile application development training in Delhi.

visit here for detail course content:
contact:8750475003

Friday 25 April 2014

JAVA-TRAINING

Summer Training Java Pitampura, Delhi


Java is an oops based internet programming language. Core java is an initial stage Java Training. Here we learn about basic programming concept about java. java programming language is use to create variety of application like Website application, window software application, and mobile application development.

APSMIND Technology offers 45 days Java summer internship training for final or Pre final year B.TECH, BCA, MCA, BSC[IT], M.Tech, PGDCA, DOEACC students.

We provide Java Training according to current Market Demand. Our Specialist Trainer conduct the class and explore new ideas and experience with current marketing.
APSMIND Technology Pvt. Ltd. one of leading institute in the field of Core Java Training/ Advance Java Training in Delhi.

Thursday 24 April 2014

android-training

Android Training In Delhi India

Summer Training Android Pitampura, Delhi


Android is one of the most popular operating system for mobile application development. Now a day’s Android is one of growing era for Job opportunity in Mobile Application Development. APSMIND Technology Provide a simple but advance guideline during summer training in android to build impressive android mobile application.

APSMIND Technology provides 45 days android summer internship training for final or Pre final year B.TECH, BCA, MCA, BSC[IT], M.Tech, PGDCA, DOEACC students.

We provide Summer Training in android according to current Market Demand. Our Experience Android Trainer conducts the classes and explores new ideas and experience with current market aspects. APSMIND Technology Pvt. Ltd. one of reputed in institute for Android Training in Pitampura, Delhi.
android course
APSMIND TECHNOLOGY PROVIDE TRAINING