Monday 9 January 2017

ANDROID APP- GALLERY OPTIMIZER


This app will let users optimize their devices by cleaning unwanted images from Gallery and hence thereby increasing free space in memory.

1. COMPRESS IMAGES: 
Images selected from Gallery will be compressed to 30% of original size without much alteration in quality. It will be stored to "Internal Storage/Gallery Optimizer/Images".

2. REMOVE BLURRED IMAGES: 
Helps you remove images that have been clicked blurred. However, it does not directly deletes them but asks you if you want to delete it not.

3. Whats-app Images:
 Images that are frequently downloaded from whatsapp daily have generally one time use like jokes,Memes etc. These slowly flood your precious memory. Hence it will allow you to delete them.

4. Texted Images:
 Images having text in them like Notes,Greeting Images like "Happy New Year","Happy Diwali","Merry Christmas" etc can be deleted from the Gallery.


Concepts used: 
Android  Tesseract OCR, Android Open CV Image Processing , Bitmap compression etc. 

Playstore Link:




Saturday 31 December 2016

Android App- PC CONNECT

APP SCREENSHOTS


This app has been designed to allow users to control their PC/Laptops using their Mobile Phones.
It allows following functionalities:

1. CONTROL PC using MOBILE PHONE

It allows users to create a virtual Mouse that allows users to move their fingers on Mobile phone while the mouse pointer on the PC moves. This will allow users to control their PC even if they are a few meters away as like when to deliver a presentation etc. The app also allows users to Play/Pause music of their choice on PC and control the songs like next, previous ,mute etc from the app itself.
Think if you are playing songs on Laptop and it is placed on table away from your bed, then you can control it without moving from your bed.


2. MOBILE To PC Transfer

This app allows users to transfer any file(JPEG/PDF/WORD/CONTACT etc) from their mobile phone to PC instantly without any Bluetooth connection or any use of Data Cable. The user needs to have a small software(Link below) and just select a file to be transferred and it will be available in few milliseconds.

3. PC to MOBILE Transfer

Users can also transfer files from their PC to Phone instantly. The file transferred will be available in a folder named PC CONTROL in the External Storage of the phone which can be seen in the File Manager app.

CONCEPTS USED:

The PC CONTROL APP has been created on Android Studio 2.2.1. It uses concepts of Socket Programming. The software for PC have been created using JAVA and Python and have been converted into .exe Applications. It is based on the fact that the PC and Mobile Phone should be connected to same WiFi or the PC should be connected to the Hotspot of the Phone. Having done so, rest all is handled by the app and software as well. The source code of the app and software is Open Source on the following Github Repository. Any updates/modifications to it are most welcome.
GITHUB: https://github.com/subhamG98/PC-CONNECT


HOW TO USE:

1. Download the Mobile app from Google Playstore.
2. Download the software on PC from the following Link.
3. Make sure your Phone and Pc is connnected to same hotspot zone /Wifi.
3. Run the App. It will ask for the IP Address and Socket Number.
4. Run the PcIP App in the software downloaded for PC from Point no 2. It will return the IP Address. Type that IP Address to your Mobile App.
5. Type any four digit number as PORT Number. Remember this no as it will be used further.

I. FOR PC CONTROL 

1. Press the Connect Button on Top corner of the app to establish Connection. It will show message 'Connected to Server'.
2. Move your fingers on the blue screen and you will see your Mouse Pointer on PC also moves. Hence you can now control your PC through Phone.
3. If you play Music say using VLC Media Player, then if you press 'NEXT' button, next song will be played and so on all the buttons work. 

II. FOR MOBILE TO PC TRANSFER

1. Run the MOBILE TO PC Software on PC and then enter the IP Address and any port Number. 
2. Select MOBILE TO PC tab from Android app and then tap on GREEN UPLOAD ICON.
3. Select the File on the phone to be transferred.
4. The File reaches the directory where the Software is present.

III. FOR PC TO MOBILE TRANSFER

1. Select PC TO MOBILE tab from Android App and then tap on BLUE COLOR DOWNLOAD button.
2. Run PC to MOBILE software and Enter the PORT NUMBER.
3. Select the File to be transferred.
4. The File reaches in the folder PC CONNECT of the Mobile Phone.

Please refer following video for more details.




Monday 26 December 2016

Android Networking Library- Android Networking Library


One Line Library is a power android networking library. This
library can be imported in any android existing project using
following
With an aim to minimize developer hardwork this library will help
them to focus on their UI rather then handling network error
themselves.
At present library supports the following:
1. VolleyWithOKHTTP Request
2. ImageUpload
3. Download Image
4. Post Request
5. Get Request
6. Cancel / Abort Request
7. JSON Object Request
8. Network Health Status

 Download and use the library now:

 Maven:
        <dependency>
        <groupId>onelinelibrary.com.onelinelibrary</groupId>
        <artifactId>onelinelibrary</artifactId>
        <version>1.0.0</version>
        <type>pom</type>
        </dependency>

 Gradle:

compile 'onelinelibrary.com.onelinelibrary:onelinelibrary:1.0.0'


Tutorial :

  • VolleywithOKHTTP:
As we know volley by Google is well known for its network cancel feature and OKHTTP for its speed and performance. We tried to integrate both into one function by modifying the Volley function to use OKHTTP Response.
StringRequest stringRequest = new StringRequest("http://resolvefinance.co.uk/Whatsapp/json3.txt",
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.i("Response returned is","-"+response);
try{
parseJSON(response);
}
catch (Exception e){
Toast.makeText(c1,"Please check your Internet
Connection",Toast.LENGTH_LONG).show();
}
}
}, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { // Toast.makeText(MainActivity.this, error.getMessage(), Toast.LENGTH_LONG).show(); Log.i("Volley ka error", "" + error); } }); RequestQueue requestQueue = Volley.newRequestQueue(c1, new OkHttpStack(new com.squareup.okhttp.OkHttpClient())); requestQueue.add(stringRequest);


  • Getting response from API() 
Getting reponse from API is now very simple. Just add the URL of the API to the load parameter and pass all the query parameters as key value pairs, the response could be parsed as String, JSON object ,JSON Array, Bitmap etc.


OneLineLibrary.load("http://jiittute.esy.es/getContents.php")
.setTag("LoadingAPI")
.addQueryParameter("userid","1")
.setPriority(Priority.LOW)
.start()
.getAsString(new StringRequestListener () {
@Override
public void onResponse(String response) {
Log.d(TAG, "onResponse API"+response);
}
@Override
public void onError(ANError error) {
Log.d(TAG, "ERROR aPI");
}
});

  • ImageUpload() 

Use this to upload image from your internal storage of your phone. For instance suppose you have an image name screens.png located at following path
―Environment.getExternalStorageDirectory().getPath()+"/MAJOR/screens.jpg"
We can push the following file directly to servers by writing the following one Line function.


 File file=new
File(Environment.getExternalStorageDirectory().getPath()+"/MAJOR/screens.jpg");
OneLineLibrary.upload("http://jiittute.esy.es/MAJOR/postFile.php")
.parameter("pic",file)
.setTag("uploadTest")
.start()
.getAsJSONObject(new JSONObjectRequestListener() {
@Override
public void onResponse(JSONObject response) {
// do anything with response
Log.d("MAJOR","IMAGE_REQUEST MADE"+response.toString());
}
@Override
public void onError(ANError error) {
// handle error
Log.d("MAJOR","IMAGE_REQUEST MADE"+error.getMessage());
}
});



  • LoadImageDirectly()-

Use this to download image as a Bitmap response from the network.



 OneLineLibrary.load("http://jiittute.esy.es/MAJOR/uploads/screens.jpg")
.setTag("imageRequestTag")
.setPriority(Priority.LOW)
.setBitmapConfig(Bitmap.Config.ARGB_8888)
.start()
.getAsBitmap(new BitmapRequestListener() {
@Override
public void onResponse(Bitmap response) {
Log.d(TAG, "onResponse Bitmap");
}
@Override
public void onError(ANError error) {
Log.d(TAG, "ERROR Bitmap");
}
});



  • Cancel/Abort Network Request

OneLineLibrary.cancelAll();




  • Network Health Status - Calling this function will return you the network heath

    • status. In background it downloads the 1MB file from the remote servers and calculate
        time. Based on this it calculate bandwidth of the network that ie. Bits transferred per
          second.
            Additional Features
              1. ―Priority TYPES : User can choose from the multiple request time which
                includes LOW, MEDIUM, HIGH and IMMEDIATE.
                  2. TAG name: You can assign Tag with your network call and can later cancel it
                    using.


                    3. ProgressListner: Some of the modules include progress listeners by

                    calculating received bytes and send bytes;



                    cancelRequestWithGivenTag(tagname);


                    GITHUB CODE:

                    Visit:  https://github.com/subhamG98/Android-Parse-JSON-in-one-line-function


                    License:

                    Licensed under the Apache License, Version 2.0 (the "License");
                    you may not use this file except in compliance with the License.
                    You may obtain a copy of the License at

                       http://www.apache.org/licenses/LICENSE-2.0

                    Unless required by applicable law or agreed to in writing, software
                    distributed under the License is distributed on an "AS IS" BASIS,
                    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
                    See the License for the specific language governing permissions and limitations under the License.



                    Thursday 15 December 2016

                    Android App- JIIT CONNECT

                    This app has been designed and conceptualized to aid students at JIIT-62 and JIIT-128 to view their daily attendance and timetable with all new cool layouts.
                    The following are the features of the app:
                    1. Timetable(View/Add/Delete)
                    2. Annapurna Menu(Offline as well)
                    3. Attendance(You can also set a threshold attendance and will be notified if attendance falls short.)
                    4. CGPA-SGPA Calculator
                    5. Seating Plan View.
                    6. Predict attendance on missing/attending next class.


                    Playstore Link

                    Wednesday 7 September 2016

                    Android Easy ViewPager Library

                    Android View Pager Library

                    This Library can be used to create view pager in android very easily.
                     View Pager is a Layout element that helps users to slide images one after the other.
                    In this Library only one function is used and can be customized to user needs.

                    The repository is uploaded on Bintray and has been compiled for Maven and JCentre.


                    Below you can see is a GIF of the output







                     Download and use the library now:



                    Maven:

                    <dependency>
                      <groupId>com.example.mypc.mylibrary</groupId>
                      <artifactId>mylibrary</artifactId>
                      <version>1.0</version>
                      <type>pom</type>
                    </dependency>

                    Gradle:

                    compile 'com.example.mypc.mylibrary:mylibrary:1.0'


                    Tutorial :


                    1. Open your Android Studio and start with new Project.
                    2. Go to build.Gradle file and add the following dependency:
                       compile 'com.example.mypc.mylibrary:mylibrary:1.0'
                    3. Sync the project with Gradle Files.
                    4. In your MainActivity.java File use the following code:


                    
                    
                    public class MainActivity extends Activity {
                        int[] imageId = {
                                R.drawable.b1,
                                R.drawable.b2,
                                R.drawable.b3,
                                R.drawable.b2,
                                R.drawable.b1,
                                R.drawable.b3
                        };
                        @Override
                        protected void onCreate(Bundle savedInstanceState) {
                            super.onCreate(savedInstanceState);
                            View v = new MyView(this);
                            setContentView(v);
                            MyView.addViewPager(5, MainActivity.this,imageId,100,3000);
                           
                            //Here first param is no of images
                            // second is activtity
                            // third is images array
                            // fourth is speed of transition
                            // fifth is duration for one image to stay.
                           
                        }



                    .
                    That's all Run your Project and BINGO it works!!!.



                    GITHUB CODE:

                    Visit:  https://github.com/subhamG98/view-pager-library


                    License:



                    Licensed under the Apache License, Version 2.0 (the "License");
                    you may not use this file except in compliance with the License.
                    You may obtain a copy of the License at

                       http://www.apache.org/licenses/LICENSE-2.0

                    Unless required by applicable law or agreed to in writing, software
                    distributed under the License is distributed on an "AS IS" BASIS,
                    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
                    See the License for the specific language governing permissions and


                    limitations under the License.







                    Android Library- Parse JSON into Recycler View using just one line of code!


                    This repository will help Android developers to make connection with HTTP clients and put JSON data into Recycler View in just 1 simple function call. No need to establish any Async Task or set up any Adapters for Recycler View by yourself.
                     All you need to give is the url of the JSON file and your xml layout about how to parameters should appear.
                    The repository is uploaded on Bintray and has been compiled for Maven and JCentre.


                    Click below link to see video tutorial




                     Download and use the library now:

                     Maven:
                            <dependency>
                            <groupId>com.dbconnection.subham.dblibrary</groupId>
                            <artifactId>dblibrary</artifactId>
                            <version>1.0</version>
                            <type>pom</type>
                            </dependency>


                     Gradle:

                    compile 'com.dbconnection.subham.dblibrary:dblibrary:1.0'


                    Tutorial :

                    Consider we have a JSON available at any of our servers. We now want this data should be shown in our Recycler View in Android.
                    Lets look at sample JSON. This has been hosted at my servers. You can use yours. All you need is url of that JSON document.

                    {
                     "result": [
                      {
                       "company": "Microsoft",
                       "news": "Placement session for October 2015 is soon going to start. Please stay in touch. All the very best for your future endeavours.",
                       "likes": "6",
                       "url": "http://hello45.esy.es/PhotoUpload/uploads/32.png",
                       "dp": "http://hello45.esy.es/DpUpload/uploads/2.png"
                      },
                      {
                       "company": "Dhruv",
                       "news": "Guys Ive been placed at AMAZON. Thanks to Placement Assured for their support and cooperation. Gonna miss you all. Bye!!!",
                       "likes": "7",
                       "url": "http://hello45.esy.es/PhotoUpload/uploads/34.png",
                       "dp": "http://hello45.esy.es/DpUpload/uploads/dhruv.png"
                      },
                      {
                       "company": "pa",
                       "news": "final evaluation close Pull up your socks",
                       "likes": "0",
                       "url": "http://hello45.esy.es/PhotoUpload/uploads/31.png",
                       "dp": "http://hello45.esy.es/DpUpload/uploads/01.png"
                      },
                      {
                       "company": "Sgupta",
                       "news": "check 123",
                       "likes": "6",
                       "url": "http://hello45.esy.es/PhotoUpload/uploads/31.png",
                       "dp": "http://hello45.esy.es/DpUpload/uploads/subham.png"
                      },
                      {
                       "company": "pa",
                       "news": "Placement Assured wishes you All the best for your Placement Season",
                       "likes": "98",
                       "url": "http://hello45.esy.es/DpUpload/uploads/01.png",
                       "dp": "http://hello45.esy.es/DpUpload/uploads/01.png"
                      },
                      
                     ]
                    }
                    


                    1. Open your Android Studio and start with new Project.
                    2. Go to build.Gradle file and add the following dependency:
                       compile 'com.dbconnection.subham.dblibrary:dblibrary:1.0'
                    3. Sync the project with Gradle Files.
                    4. In your MainActivity.java File use the following code:


                     public class MainActivity extends Activity {  
                       @Override  
                       protected void onCreate(Bundle savedInstanceState) {  
                         super.onCreate(savedInstanceState);  
                         View v = new MyView(this);  
                         setContentView(v);  
                         String[] tagnames={"company","news","url"}; //These are the keys of the JSON ARRay  
                         String[] tagtype={"text","text","image"}; //This is type of value, it can be text or image  
                         String arrayname="result";// This is the name of array of JSON File  
                          MyView.setinputdata("http://hello45.esy.es/PhotoUpload/getAllImages.php",arrayname,tagnames,tagtype,R.layout.list_card_view);  
                     //As you see you need to pass only URL, Name of result array,names of key in JSON key value pairs,And a layout file to see the results.Make sure while making layout files you give id to each elements as p1,p2,p3..... as specifie in tagnames.  
                       }  
                     }  
                    


                    As you can see in the above code, only 5 parameters need to be passed to the function. These are:

                    • URL: Enter the url where JSON is being returned from.
                    • tagnames: These show the keys in the key value pair of JSON. List here those keys that you wish to show in your Recycler View.
                    • tagtypes: This is for Recycler view to understand whether it should display a TextView or an ImageView. Hence corresponding to the tagnames values enter the tagntypes. Only options possible are "text" or "image". Make sure there order is same i..e as shown in above code company corresponds to text,news to text and url to image.
                    • arrayname: It is the name of the final array in JSON . For eg in JSON showed above it is "result". 
                    • Layout File: Make an XML file for the layout of how you want to display items of recycler view. I have provided you with one sample file. All you need is to set TextViews and ImageViews corresponding to no of parameters in tagname array. While making the layout File keep in mind to name the elements ids as p1,p2,p3... etc only. For eg in XML File, TextView corresponding to company should have id as p1,TextView corresponding to news should have id as p2, and Imageview corresponding to url should have id p3.
                    5. Make sure to add Internet permissions in Android XML File.
                    6. That's all Run your Project and BINGO it works!!!.

                    You can find the reference to XML File here.


                     <?xml version="1.0" encoding="utf-8"?>  
                     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
                       android:orientation="vertical" android:layout_width="match_parent"  
                       android:layout_height="wrap_content">  
                       <android.support.v7.widget.CardView  
                         android:layout_width="match_parent"  
                         android:layout_height="wrap_content">  
                         <LinearLayout  
                           android:orientation="vertical"  
                           android:layout_width="match_parent"  
                           android:layout_height="wrap_content" >  
                           <TextView  
                             android:layout_width="fill_parent"  
                             android:layout_height="wrap_content"  
                             android:id="@+id/p1"  
                             android:textColor="#ff342511"  
                             android:textSize="20dp"  
                             android:text="Paper name"  
                             android:textStyle="bold" />  
                           <TextView  
                             android:layout_width="wrap_content"  
                             android:layout_height="wrap_content"  
                             android:textStyle="bold"  
                             android:text="New Text"  
                             android:id="@+id/p2"  
                             android:textColor="#ffffb54b" />  
                           <TextView  
                             android:layout_width="wrap_content"  
                             android:layout_height="wrap_content"  
                             android:textStyle="bold"  
                             android:text="New Text"  
                             android:id="@+id/p3"  
                             android:textColor="#ff100920" />  
                         </LinearLayout>  
                       </android.support.v7.widget.CardView>  
                     </LinearLayout>  
                    



                    GITHUB CODE:

                    Visit:  https://github.com/subhamG98/Android-Parse-JSON-in-one-line-function


                    License:



                    Licensed under the Apache License, Version 2.0 (the "License");
                    you may not use this file except in compliance with the License.
                    You may obtain a copy of the License at

                       http://www.apache.org/licenses/LICENSE-2.0

                    Unless required by applicable law or agreed to in writing, software
                    distributed under the License is distributed on an "AS IS" BASIS,
                    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
                    See the License for the specific language governing permissions and
                    limitations under the License.

                    Wednesday 10 August 2016

                    Systems And Networks- Intrusion and Security

                    I’ve made an ANDROID APP using Android Studio 1.2.2 for client side and Python 2.7 for server side implementation along with Wamp’s Apache and database, and created apps for Cryptography and Steganography(Digital Signatures) including Image transfer through hotspot along with Controlling PC from android mobile and also take screenshots of PC secretly. Also I made an Android App that veils itself as a simple Calculator but can extract secretly all personal information from user’s device and display to another user in the same hotspot zone.