Programming Tips πŸ’‘
51.6K subscribers
67 photos
10 videos
30 files
354 links
Programming & AI:
Tips πŸ’‘
Articles πŸ“•
Resources πŸ‘Ύ
Design Patterns πŸ’Ž
Software Principles βœ…

πŸ‡³πŸ‡± Contact: @MoienTajik

🎯 Buy ads: https://telega.io/c/ProgrammingTip
Download Telegram
πŸ’™β›° What is Glide Library β›°πŸ’™

Glide is a fast and efficient Open Source Media Management and image loading framework for Android that wraps media decoding, memory and disk caching, and resource pooling into a simple and easy to use interface.

Glide supports fetching, decoding, and displaying video stills, images, and animated GIFs. Glide includes a flexible API that allows developers to plug in to almost any network stack. πŸ™†πŸ»β€β™‚οΈ

By default Glide uses a custom HttpUrlConnection based stack, but also includes utility libraries plug in to Google's Volley project or Square's OkHttp library instead. πŸ’Ž

For learn more about Glide see
https://github.com/bumptech/glide πŸ“—

#android #java #media
@ProgrammingTip
Google Gson Converter πŸ’₯

Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object. πŸ“¦

Gson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of. πŸ”₯

There are a few open-source projects that can convert Java objects to JSON. πŸ’Ž

However, most of them require that you place Java annotations in your classes; something that you can not do if you do not have access to the source-code. πŸ™†πŸ»β€β™‚οΈ

For more about Gson see :
https://github.com/google/gson

#java #android #converter
@ProgrammingTip
Material Design The Development Documentation

This site has a single list of available Material Components and samples of their usage for developer. πŸ’Ž

The v7 appcompat library is used in website - provide support of material design user interface implementations for older Android platforms. πŸ™†πŸ»β€β™‚οΈ

Note: Design Library - provides various material design components which are not part of Android SDK.

http://www.materialdoc.com/

#java #android #material
@ProgrammingTip
πŸ’š Retrofit Library πŸ’š

Retrofit turns your REST API into a Java Interface πŸ’Ž

It’s an elegant solution for organizing API Calls in a project. The request method and relative URL are added with an Annotation , which makes code clean and simple.

With annotations, you can easily add a request body, manipulate the URL or headers and add query parameters. πŸ”₯

Adding a return type to a method will make it synchronous, while adding a Callback will allow it to finish asynchronously with success or failure. πŸ”°

For learn more about Retrofit see :
https://github.com/square/retrofit
http://square.github.io/retrofit/

#java #android #library
@ProgrammingTip
Listing Content Of Directory In Java πŸ“

In order to list the contents of a directory, below program can be used. πŸ—„

This program simply receives the names of the all sub-directory and files in a folder in an Array and then that array is sequentially traversed to list all the contents. πŸ’Ž

import java.io.*;

public class ListContents {

public static void main(String[] args) {

File file =
new File("//home//user//Documents/");

String[] files = file.list();

System.out.println (
"Listing contents of " + file.getPath()
);

for(int i=0 ; i < files.length ; i++) {
System.out.println(files[i]);
}

}

}


βž–βž–βž–βž–βž–βž–βž–βž–βž–βž–βž–βž–
#java #io
@ProgrammingTip
Compare two string by equals() instead == in java πŸ’‘

Use equals() because this method internally checks == plus content equality check. β˜‘οΈ

[ CODE ]
public class Test {

public static void main(String[] args) {
String s1 = "string";
String s2 = "string";
String s3 = new String("string");
String s4 = s3;
String s5 = "str"+"ing";

System.out.println("s1==s2 :"+(s1==s2));
System.out.println("s1==s3 :"+(s1==s3));
System.out.println(
"s1.equals(s3) :"+s1.equals(s3)
);
System.out.println("s3==s4 :"+(s3==s4));
System.out.println(
"s3.equals(s4) :"+s3.equals(s4)
);
System.out.println("s1==s5 :"+(s1==s5));
System.out.println(
"s1.equals(s5) :"+s1.equals(s5)
);
}
}


[ RESULT ]

s1==s2 :true
s1==s3 :false
s1.equals(s3) :true
s3==s4 :true
s3.equals(s4) :true
s1==s5 :true
s1.equals(s5) :true


γ€°γ€°γ€°γ€°γ€°γ€°γ€°γ€°γ€°γ€°

#java
@PorgrammingTip
Dagger 2

Dagger 2 is a dependency injection (DI) framework. It's based on the javax.inject annotations standard.

[GitHub] : http://bit.ly/2gY3BND

γ€°γ€°γ€°γ€°γ€°γ€°
#Dagger #Java #Android
@ProgrammingTip
JUnit β˜‘οΈ

JUnit is a Unit Testing framework for the Java programming language. β˜•οΈ

JUnit has been important in the development of test-driven development, and is one of a family of unit testing frameworks which is collectively known as xUnit that originated with SUnit.

https://ibb.co/f0EFR5

[Website] : http://junit.org/junit5/

γ€°γ€°γ€°γ€°γ€°
#java #junit
@ProgrammingTip
This media is not supported in your browser
VIEW IN TELEGRAM
Codota : AI Pair Programmer πŸ€–

Codota understands the world's code and provides you with the right suggestion at the right time.

Supports : Java ♨️

www.codota.com
γ€°γ€°γ€°γ€°γ€°γ€°
#Java #Tools
@ProgrammingTip
Lambda in Java 8 πŸ”₯

Lambda expressions are introduced in Java 8 and are touted to be the biggest feature of Java 8. 8️⃣

Lambda expression facilitates functional programming, and simplifies the development a lot. πŸ€·πŸ»β€β™‚οΈ

γ€°γ€°γ€°γ€°γ€°γ€°
#java #lambda
@ProgrammingTip
https://t.me/pgimg/6
Avian πŸ—‚

A lightweight virtual machine and class library designed to provide a useful subset of Java’s features, suitable for building self-contained applications. πŸ’‘

The VM is implemented from scratch and designed to be both fast and small.


Efficient

πŸ”ΈJust-In-Time (JIT) compilation for fast method execution

πŸ”ΉGenerational, copying garbage collection ensures short pause times and good spatial locality

πŸ”ΈThread-local heaps provide O(1) memory allocation with no synchronization overhead

πŸ”ΉNull pointer dereferences are handled via OS signals to avoid unecessary branches

The class library is designed to be as loosely coupled as possible, allowing tools like ProGuard to aggressively isolate the minimum code needed for an application. ⚑️

This translates to smaller downloads and faster startup. ✨

https://t.me/pgimg/135

[ Website ] : readytalk.github.io/avian

γ€°γ€°γ€°γ€°γ€°γ€°
#Java #VM #JIT
@ProgrammingTip
β€œSorry JAVA, I am done with you. I have fallen in love with Kotlin.β€β€Š- Sad Love Story πŸ’”

Google started supporting Kotlin as an official language for Android development. βœ…

On that day I decided, If Google somehow exclude JAVA then I am gonna leave Android development to continue my relation with JAVA. ❌

I was very egoistic that no any other language can took place in my heart. πŸ’™

One day, One of my friends suggest me to give at least one chance to Kotlin. Because JAVA does not value my relationship. πŸ™…πŸ»β€β™‚οΈ

Since we have been together from last 6 years sometimes I got angry and scolding on JAVA that It can not do some simple things by itself. πŸ€·πŸ»β€β™‚οΈ

Every time I need to write boilerplate code again and again, but still I was appreciating JAVA in front of everyone. 🌍


[ Article ] : kutt.it/ktjv

〰️〰️〰️〰️〰️〰️
#Kotlin #Android #Java
@ProgrammingTip