Friday, January 25, 2019

Different Frameworks and Libraries of Android

The main aim of frameworks is to increase productivity by reducing efforts which eventually saves lot of time for developers to resolve any other important issues in the app or game. These frameworks provides inbuilt tools for developers to work instantly on difficult and lengthy part of coding.


Some Popular Frameworks List:

  1. Corona SDK
  2. Phonegap
  3. Xamarin
  4. Sencha Touch 2
  5. Appcelerator
  6. Basic4Android
  7. JQuery Mobile
  8. Dojo Mobile
  9. Sproutcore
  10. Theappbuilder
  11. DHTMLX Touch
  12. Mo Sync SDK

Tuesday, January 22, 2019

Fixed nav-bar section

html code :
<div id="footer">    <hr>    <p>Designed by Arafat. No right reserved</p>    <a style="color: white; text-decoration: none; cursor: pointer; font-weight: bold;" href="dashboard.php">        <p> There is no God none but Allah</p>    </a>    <hr></div>

css code:

#footer {    padding: 10px;    border-top: 1px solid black;    color: #eeeeee;    background-color: #211f22;    text-align: center;    position: fixed;    left: 0;    bottom: 0;    width: 100%;}
try this for fixed footer section 

Tuesday, January 15, 2019

Android Library List

implementation 'com.github.rey5137:material:1.2.5'
// for paper library
implementation 'io.paperdb:paperdb:2.6'

Circular image

Github Repository

xml attribute :

<de.hdodenhof.circleimageview.CircleImageView
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/profile_image"
    android:layout_width="96dp"
    android:layout_height="96dp"
    android:src="@drawable/profile"
    app:civ_border_width="2dp"
    app:civ_border_color="#FF000000"/>
Dependency : implementation 'de.hdodenhof:circleimageview:2.2.0'


 Picasso

Library Link 

Dependency :
implementation 'com.squareup.picasso:picasso:2.71828'
if you get any error user this one
implementation 'com.squareup.picasso:picasso:2.5.2'

 Image cropper Library:


Library Link

Dependency :  
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.+' (this one is stable)

// android arsenal link : https://android-arsenal.com/details/1/4136
implementation 'com.cepheuen.elegant-number-button:lib:1.0.2'
// from github

Weather api Library:
dependency : 
compile 'com.loopj.android:android-async-http:1.4.9'

Link : Weather api details

Android Asynchronous Http Client

Library address 

dependency :

compile 'com.loopj.android:android-async-http:1.4.9'
 

Friday, January 11, 2019

Big O notation

Different time complexity of some common algorithms ...

1. O(1)

O(1) describes an algorithm that will always execute in the same time (or space) regardless of the size of the input data set.

bool IsFirstElementNull(IList<string> elements)
{
    return elements[0] == null;
}
 

2. O(N)

O(N) describes an algorithm whose performance will grow linearly and in direct proportion to the size of the input data set. The example below also demonstrates how Big O favours the worst-case performance scenario; a matching string could be found during any iteration of the for loop and the function would return early, but Big O notation will always assume the upper limit where the algorithm will perform the maximum number of iterations.

bool ContainsValue(IList<string> elements, string value)
{
    foreach (var element in elements)
    {
        if (element == value) return true;
    }

    return false;
}

 


3. O(N2)

O(N2) represents an algorithm whose performance is directly proportional to the square of the size of the input data set. This is common with algorithms that involve nested iterations over the data set. Deeper nested iterations will result in O(N3), O(N4) etc.

bool ContainsDuplicates(IList<string> elements)
{
    for (var outer = 0; outer < elements.Count; outer++)
    {
        for (var inner = 0; inner < elements.Count; inner++)
        {
            // Don't compare with self
            if (outer == inner) continue;

            if (elements[outer] == elements[inner]) return true;
        }
    }

    return false;
}
 

4. O(2N)

O(2N) denotes an algorithm whose growth doubles with each additon to the input data set. The growth curve of an O(2N) function is exponential - starting off very shallow, then rising meteorically. An example of an O(2N) function is the recursive calculation of Fibonacci numbers:

int Fibonacci(int number)
{
    if (number <= 1) return number;

    return Fibonacci(number - 2) + Fibonacci(number - 1);
}
 
Source : Robert Bell 
 

Paper Library For Storing Current User

Library Github link : Paper Library Link






This library use to remember current login user.

Tuesday, January 8, 2019

Make corner shape Edit text in android


create a xml file in drawable and code like that:


<?xmlversion="1.0"encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp"/>

<!--forpadding-->
<stroke
android:width="1.5dp"
android:color="#000"/>

<solid
android:color="#fff"/>

then in your edit text make the background this drawable xml file.

you can also use it in button, textView, imageView and many more widgets in android studio.

</shape>

Firebase New Dependency


For each project :

classpath 'com.google.gms:google-services:4.2.0' (in project level)

 apply plugin: 'com.google.gms.google-services' (in app level under dependency section)
implementation 'com.google.firebase:firebase-core:16.0.6'(in app level dependency section)


………………………………………..

implementation 'com.google.firebase:firebase-firestore:17.1.5'
com.google.firebase:firebase-core:16.0.6
Analytics
com.google.firebase:firebase-database:16.0.5
Realtime Database
com.google.firebase:firebase-firestore:17.1.5
Cloud Firestore
com.google.firebase:firebase-storage:16.0.5
Storage
com.crashlytics.sdk.android:crashlytics:2.9.7
Crashlytics
com.google.firebase:firebase-auth:16.1.0
Authentication
com.google.firebase:firebase-messaging:17.3.4
Cloud Messaging
com.google.firebase:firebase-config:16.1.2
Remote Config
com.google.firebase:firebase-invites:16.0.6
Invites and Dynamic Links
com.google.firebase:firebase-ads:17.1.2
AdMob
com.google.firebase:firebase-appindexing:17.1.0
App Indexing
com.google.firebase:firebase-perf:16.2.3
Performance Monitoring
com.google.firebase:firebase-functions:16.1.3
Cloud Functions for Firebase Client SDK
com.google.firebase:firebase-ml-vision:18.0.2
ML Kit (Vision)
com.google.firebase:firebase-ml-model-interpreter:16.2.4
ML Kit (Custom Model)



From <https://firebase.google.com/docs/android/setup#use_the_firebase_assistant>

Speedup Android Studio

Go to Help ->Edit Custom VM Options, and chnge this 4 setting. After that close your Android Studio. This settings are for 8gb of ram pc...