Monday, 18 May 2020

Vysor alternative App : Scrcpy

Hi Guys !!! Hope all is well
Today I am going to discus best alternative app Scrcpy for Vysor. 
As you guys know :-  Vysor lets you view and control your Android on your computer.  But It is not free or open source App. You can only use few feature in free edition App. For more detail :- https://www.vysor.io/

But As we love open source project and software for our day to day use. We need a best alternative app for Vysor. So Scrcpy is best alternative app. It is full loaded with feature and free. Not only free it is open source app. So we can download modify source code as per our requirement.



scrcpy (v1.13)
This application provides display and control of Android devices connected on USB (or over TCP/IP). It does not require any root access. It works on GNU/Linux, Windows and macOS. 
screenshot-debian-600.jpg

It focuses on:
  • lightness (native, displays only the device screen)
  • performance (30~60fps)
  • quality (1920×1080 or above)
  • low latency (35~70ms)
  • low startup time (~1 second to display the first image)
  • non-intrusiveness (nothing is left installed on the device) 
Requirements
  • The Android device requires at least API 21 (Android 5.0).
  • Make sure you enabled adb debugging on your device(s).
On some devices, you also need to enable an additional option to control it using keyboard and mouse.

Get the app
Linux 
Ubuntu (20.04/18.04/16.04/14.04):
apt install scrcpy

Windows

For Windows, for simplicity, a prebuilt archive with all the dependencies (including adb) is available: scrcpy-win64-v1.13.zip

Just download the zip and unzip it. After unzipping Open that folder in command prompt(cmd) and run only scrcpy in command prompt. It will screen cast your connected device in your window machine . Enjoy it using without any tension. 

Note :- If it not detected your connected device in Window 10 then please check Environment path variable . It should be like this 
C:\android_sdk\platform-tools\adb

Thanks
Saurabh 
Happy Coding !!!

Monday, 11 May 2020

Best Code Editor : VS Code

Hi Guys !!! Hope all is well
Today I am going to discus best code editor "VS code".  if you search on google top 5 best code editors for 2020 or 2019 or 2018, you can see VS code  editor rankings in top 3. 
VS Code 
  • VS code is a product of Microsoft and a cross-platform editor. 
  • Developers can use this powerful tool either on Windows, Linux, and mac. 
  • VS Code has powerful features that will fully support developers’ work. 
  • With the VS code, you are assured of fast system debugging and auto-completion
Key Features 
  • Cross-platform
  • Built-in Git and git commands
  • Reliable autocomplete and syntax highlighting using IntelliSense
  • Debugging code right from the editor
  • Easy to integrate with terminal
  • Extensions for customizing and extending functionalities
  • Ease of deploying projects to such platform as Microsoft Azure
  • Compatible with almost every programming language
  • Easy to use
  • Lightweight and robust as compared to other editors
  • Best part a lot of best plugin available and you can install and uninstall after use

The community support for the VS Code is incredibly passionate, and that works to everyone’s benefit. The VS Code being an open source, that community works exceptionally hard to keep VS Code competitive with the rest of the field. Written in Node.js and Electron, you can be sure the code isn’t going to become an outdated or lag behind any time soon. Their support is tremendous, and every month, they are releasing new features to keep up with the latest workflow.
Some Famous plugin 
Try this code editor and find the real power of light weight, fast code editing, compiling and  pack of powerful feature and plugin. I am sure it will suit your need. 
Some screenshot of plugin I use in my machine 



Thanks
Saurabh 
Happy Coding !!!

Saturday, 25 April 2020

Best Android libraries for App development

Hi Guys !!! Hope all is well. Current on going COVID-19 pandemic is really a big setback for everyone. 
But hope for the best. We together overcome of it.
Today I am going to put top android library name and its uses detail for android app development help.
1. For Handling images in app
we can choose any one of the below library for image handling in our app as per need.
  1. Glide library, which loads and displays images as quickly and smoothly as possible.
  2. Other popular image loading libraries include Picasso from Square
  3. Coil from Instacart and
  4. Fresco from Facebook
2. Networking Libraries
HTTP library that makes networking for Android apps easier and most importantly, faster is listed below. Top three library is Volley, okhttp and retrofit.

  1. Volley
  2. OKHTTP (HTTP + HTTP /2)
  3. RETROFIT
  4. ION (KOUSH)
  5. ANDROIDASYNC (KOUSH)
3. HTTP inspector
An HTTP inspector for Android that allows you to dig into your application’s HTTP history.

  1. Android Studio Profiler (Network) — a native profiler of the Android Studio
  2. OkHttp Profiler — a plugin for the Android Studio/IntelliJ IDEA
  3. Facebook Stetho — a debug bridge for Android applications
  4. Charles — a proxy application for network
  5. AppSpector — a debugging tool for Android devices
  6. Chuck:- he HTTP log is displayed as a notification, which on expanding open full Chuck UI
4. Logging library
  • Timber is powerful, yet simple, logging library built on top of Android “Log” class
  • HyperLog is a utility logger library for Android on top of standard Android Log class for debugging purpose
  • Logger Simple, pretty and powerful logger for android
  • Console An Android console view, which allows you to log text using static calls, to easily debug your application, whilst avoiding memory leaks
5. Android ORM DB library
  • Room
  • OrmLite
  • SugarORM
  • Realm
Room is an official Android ORM.
Room includes out of the box support for Rx and “LiveData,” so you can decide to use it however you like. The main benefit Room offers over other ORMs is its simplicity.

6. Scanning
  1. Zxing :- Barcode image-processing Android library that is implemented in Java    support for the 1D product, 1D industrial, and 2D barcodes.
  2. ZBAR :- barcode/QR code scanner library is a very good lightweight alternative to ZXing library and very easy to use and lightweight too. The ZBAR library supports variety of bar code standards and also QR codes. My favourite library for scanning
  3. CAMView
7. Drawing
  • MPAndroidChart :- An impeccable Android chart/graph view library
  • Holo Graph library :- A new graphic library which is continuously becoming a favorite of many
  • AChartEngine
  • AFreeChart
  • AndroidCharts
  • Androidplot
8. Some other famous library
FancyToast-Android
This library makes native Android Toasts Fancy
Material Dialogs for Android
This is a library that implements animated, beautiful, and stylish material dialogs.
Cyanea
This is a theme engine for Android
IndicatorScrollView
This library adds logic to a NestedScrollView, allowing it to react dynamically with an indicator when the scroll is changed.
ProgressButton
This library provides a Button with a built-in progress bar inside. The idea is not new, but this is a fresh approach to it.
RubberPicker
This is an animated and interesting approach to SeekBars.
CircularProgressBar
This isn’t a new library, but it was refreshed in 2019. It helps you create a circular ProgressBar in the simplest possible way.
Croppy
This is yet another approach to image cropping for Android.
CalendarPicker
This library is another calendar and date picker. It can preset a selected date and is heavily customisable
CalendarView
This is a highly customizable calendar library, powered by RecyclerView.

Hope it helps.
Thanks
Saurabh
Happy Coding !!!

Monday, 16 March 2020

Python Learning


Hi Guys !!! Hope all is well.   Today  i am going to put Python example source code fom my GitHub account. Below is the topic covered. Please go and check and share your feedback or any  modification or addition in it. 

https://github.com/Saurabh-12/Python_Learning

1. StreamLit Example (support data science projects using Streamlit)

A good data scientist needs to have a fair bit of knowledge of web frameworks to get along and Web frameworks are hard to learn. It is confusing in all that HTML, CSS, and Javascript with all the hit and trials, for something seemingly simple to do.
I am showing a simple example with Streamlit to plot our data on Web(localhost).

List of file for streamLit exanple

  • app_gif.gif
  • DS_Store
  • football_data.csv
  • StreamLitExample.py

2. Some best Python Trick

I have given example of 36 important python trick to do a long logical operation in short using Standard library. “Hidden Gold”in Python’s Standard Library. Please go through each trick to see the magic of python.

3. Server side example

 - ServerExample.py
If you run above file, It create a server scocket and keep listing for any client connection and data. You can write your client program in python or Android.

4. Class and object example in Python

I have created below example file to show class and object usages in python.
  • Class_Object_Basic.py
  • Mutable_Immutable_Object_In_Python.py
  • Python_Inner_Class.py
  • Passing_Members_Of_One_Class_to_Other.py

5. Top 10 mistake in Python

Some example code to show common mistake in python.
  • Top_10_Mistake_In_Python_Program.py

6. Tuple Example

  • Tuple_And_Methods.py

7. Collections example in python

Below file contains info for each datatype and its examples
  • Python_Collections.py file

8. Famous String methods in python

some famous inbuilt strings methods in python
  • String_Inbuilt_Method_Python.py

9. Function in python

Some famous Python function feature example
  • Python_Function.py

10. Advance Feature Python

I am putting 5 advance feature example in python
  • 5_Advance_Features_Python.py

11. PriorityQueues example

Create and use PriorityQueues in python
  • PriorityQueues.py

12. LinkedList, Queue and Stack Example

I have added LinkedList, Queue and stack implementation example in python
  • LinkedListNode.py
  • QueueExamplePython.py
  • StackExample.py

Thanks
Saurabh Sharma
Happy Coding !!!

Friday, 6 March 2020

PackageManagerService AOSP

Hi Guys!!! Hope All is Well .

Today We are going to analyse PackageManagerService class in Android open source project (AOSP).

  • The Package Manager service is a central service in the Android system
  • It manages all the packages in the system and is central to platform security.
  • It maintains a mapping between user/group identifiers and higher-level permission strings
we will see how permissions are managed and granted by the Package Manager
service.
Path of Package Manager service
http://androidxref.com/8.1.0_r33/xref/frameworks/base/services/core/java/com/android/server/pm/

1. Built-in permission UID mappings are stored on the filesystem at
/system/etc/ permissions/platform.xml 
the code path in AOSP is
http://androidxref.com/8.1.0_r33/xref/frameworks/base/data/etc/platform.xml
This is loaded into the Package Manager service into the following variable:
final SparseArray<HashSet<String>> mSystemPermissions =
                                                                                   new SparseArray<HashSet<String>>();

2. User application permissions
The service maintains user application permissions in the filesystem at
/data/system/packages.xml 
Fire up the emulator and drop into an adb shell. We will inspect the contents of the packages.xml file . Obtain a copy with the following command:
adb pull /data/system/packages.xml

3. Open up the file(step 2) in a text editor and search for the term "UserId"

4. The Package Manager service stores and manages all configuration data in XML files with proper Linux permissions on these files. Internally, the service makes use of XML pull parsers to read and process these files. This service is interrogated by other services, most notably the Activity Manager service, as to whether a package possesses a certain permission or not.


Saturday, 29 February 2020

Polymorphism in Python

Hi Guys!!! Hope all is well...
Polymorphism is greek word Poly + Morphos = Many +forms
In programming, polymorphism means same function name (but different signatures) being uses for different types.
For clarification, Here implementing polymorphism in Python by using common names across methods in different classes rather than by using inheritance.
As for example we had a bunch of different classes representing animals, and each animal class had a method that’d print out the sound they make.
In our main()function, we have a variable called animals,which is a list of animal objects.
The question becomes, how could I iterate through each of the different objects and print out what sound they make?

class Duck:
def quack(self):
print("a duck makes a quack sound")
class Cow:
def moo(self):
print("a cow makes a moo sound")
class Dog:
def bark(self):
print("a dog makes a woof sound")
def main():
animals = [Duck(), Cow(), Dog(), Cow(), Duck(), Dog()]
for animal in animals:
#TODO want to print out the sound each of the different animals can make
main()
One way we could do this is by adding a member variable called type that we’ll create and initialize in the constructor of each class. This variable will help us with the special case logic in our main()function. And when we run it, we’ll get the correct output.
class Duck:
def __init__(self):
self.type = "duck"
def quack(self):
print("a duck makes a quack sound")
class Cow:
def __init__(self):
self.type = "cow"
def moo(self):
print("a cow makes a moo sound")
class Dog:
def __init__(self):
self.type = "dog"
def bark(self):
print("a dog makes a woof sound")
def main():
animals = [Duck(), Cow(), Dog(), Cow(), Duck(), Dog()]
for animal in animals:
animal_type = animal.type
if animal_type == "duck":
animal.quack()
elif animal_type == "cow":
animal.moo()
elif animal_type == "dog":
animal.bark()
else:
pass


However,this code works what we try to achieve but We have to write seems a lot of extra code . For What ? To call a method in each class that does the same thing. 
And being programer = laziness, So We have to find better approach.
A better way to do this using polymorphism .
since the idea behind each method is printing out the sound each animal makes, would be to generalize the names of each method and call them the same thing, so:
class Duck:
def make_sound(self):
print("a duck makes a quack sound")
class Cow:
def make_sound(self):
print("a cow makes a moo sound")
class Dog:
def make_sound(self):
print("a dog makes a woof sound")
def main():
animals = [Duck(), Cow(), Dog(), Cow(), Duck(), Dog()]
for animal in animals:
animal.make_sound()

This is what polymorphism is because we’re taking three different objects (Duck, Cow, and Dog), and we’re treating all of them in the same way through a common interface — being the make_sound() method.

Thanks
Saurabh Sharma
Happy Coding !!!

Build a Custom Kernel Module for Android

Hi Guys!!!Hope you are doing well !!!. Today I will describe how you can write a custom kernel module(Hello world) for Android and load it a...