How to save image or file to server in multi-part using volley?

♠ Posted by ANDROID THIRST in ,
Uploading files or Images to the server is the main task that every developer have faced in their development process. Here I will show you the way by which you can save an image or a file to the server in multipart form data using Volley. In this example, we will save an Image to the server in multipart using Volley. Create a class named PhotoMultipartRequest. Then called this class constructor from the activity from where you want to save the image. here below I am sharing you the code of the activity from where I am calling the constructor. ...

Random password generator program in Java?

♠ Posted by ANDROID THIRST in
A simple program in Java that generates a random password combination of Character, Number, Special symbols. Here is the code snippet to generate random password in java.......... package password.generater; import java.util.Random; /** * * @author dell */ public class PasswordGenerater { /** * @param args the command line arguments */ public static void main(String[] args) { int length= 8; System.out.println(generatePswd(length)); // TODO code application logic here } static char[] generatePswd(int len){ ...

How to print following number pattern in java?

♠ Posted by ANDROID THIRST
Here is the code snippet to print this number pattern in java.......... public class Pattern1 { public static void main(String[] args) { for(int i=1;i<=5;i++){ for(int k=5;k>=i;k--){ System.out.print(k); } System.out.println(); } } } HAPPY PROGRAMMIN...

What is the difference between xml based and Java based user interface?

♠ Posted by ANDROID THIRST in
Have you ever find trouble to differentiate between android based and java based layout creation. In this article, I am going to give you a brief demonstration about how to differentiate between these two way. The basic building block of Android UI is the layout. A layout defines the visual structure for a user interface . You can arrange layout in two different ways . 1. Declaring UI element in XML :-  This is most preferable method use to create the user interface in android. We can use this method  when we want to create a simple static user interface in our android application. We used this method when the layout does not change . Suppose you are going to create UI for the login screen , for creating this we used XML because the layout does not change the login screen in future. 2. Declaring UI element in Java:- In terms of strengths of Java coding approach to layout creation , perhaps the most significant advantage that java has over XML resource...

Android resource management and activity Lifecycles

♠ Posted by ANDROID THIRST in ,
What is an Activity? An activity is a single, focused thing that the user can do. Almost all activity interact with the user, So the activity class takes care of creating a window for you in which you can place your UI. Android Process State :-  Process host applications and applications are made up of components . within Android system, the current state of the system is defined by the highest - ranking active component within the application that it hosts. A process can be in one of the following five states at any given time : Foreground Process:- These processes are assigned...

Java Program to print pattern

♠ Posted by ANDROID THIRST in
Program to create this pattern in java is :- public class Pattern1 { public static void main(String[] args) { int r=14; for(int i=1;i<=5;i++){ for(int j=1;j<=r;j++){ System.out.print("-"); } for(int k=1;k<=i;k++){ System.out.print("#"); } r=r-2; System.out.println(); } } } "HAPPY PROGRAMMING"...

How to work with button in android?

♠ Posted by ANDROID THIRST in
Buttons are the type of view that is created to be pressed . When the user clicks on the button in an android application the application is respond something. In this tutorial, we are going to create a different type of button . There are three types of button in android 1.Button with Text 2. Button with Image 3.Button with Text and Image 1. Button with Text:- Step 1. Create a project buttonWidget. Step 2. Add following code in activity_main.xml       < Button android:id="@+id/button1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="ClickMe" android:textsize="30dp" android: background="#0000aa" /> 2. Button with Image: -  Just under the Text button use ImageButton view to create an ImageButton . Put the following code just under the Text button. < ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageButton" ...