Pages

Tuesday, 27 December 2016

Avatar Grabber Palringo, Nimbuzz & Facebook using Picasso Library for Android



################ Avatar Grabber FB Nimbuzz Palringo ################

- Download Profile Images into ImageView 
- Picasso Image Library for Loading Images 
- Pass the Target URL to default Download Manager
- Save/Write Images to External Device Storage (specified path)


Download APK


Download source from Github
Following are the classes used for downloading Avatars via Default Android's Download Manager:

package com.blogspot.dbh4ck.avatargrabberdb.Fragments;
import android.app.DownloadManager;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import com.blogspot.dbh4ck.avatargrabberdb.R;
import com.squareup.picasso.Picasso;
import java.io.File;
public class FacebookFragment extends Fragment implements View.OnClickListener{
public EditText getTarFb;
private Button btn_ok_fb, btnSave_Fb;
public ImageView imgFb;
private Bitmap bmpFb;
public FacebookFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_facebook, container, false);
getTarFb = (EditText) v.findViewById(R.id.txtUserFb);
btn_ok_fb = (Button) v.findViewById(R.id.btnokFb);
btnSave_Fb = (Button) v.findViewById(R.id.btnsaveFb);
imgFb = (ImageView) v.findViewById(R.id.imgviewFb);
btn_ok_fb.setOnClickListener(this);
btnSave_Fb.setOnClickListener(new View.OnClickListener() {
boolean success = false;
@Override
public void onClick(View view) {
File direct = new File(Environment.getExternalStorageDirectory() + "/Facebook_Avatars");
if (!direct.exists()) {
direct.mkdirs();
}
DownloadManager mgr = (DownloadManager) getActivity().getSystemService(Context.DOWNLOAD_SERVICE);
Uri downloadUri = Uri.parse("http://graph.facebook.com/"+getTarFb.getText().toString()+"/picture");
DownloadManager.Request request = new DownloadManager.Request(downloadUri);
request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI | DownloadManager.Request.NETWORK_MOBILE)
.setAllowedOverRoaming(false)
.setTitle("AvatarGrabberByDB")
.setDescription("coded by db~@nc")
.setDestinationInExternalPublicDir("/Facebook_Avatars", getTarFb.getText().toString()+".jpg");
mgr.enqueue(request);
success = true;
if(success){
Toast.makeText(getActivity(),"Imaged Saved!", Toast.LENGTH_SHORT).show();
}
else{
Toast.makeText(getActivity(),"Error!", Toast.LENGTH_SHORT).show();
}
}
});
return v;
}
@Override
public void onClick(View view) {
Picasso.with(getContext())
.load("http://graph.facebook.com/"+getTarFb.getText().toString()+"/picture")
.resize(350,350)
.into(imgFb);
}
}


package com.blogspot.dbh4ck.avatargrabberdb.Fragments;
import android.app.DownloadManager;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import com.blogspot.dbh4ck.avatargrabberdb.R;
import com.squareup.picasso.Picasso;
import java.io.File;
public class NimbuzzFragment extends Fragment implements View.OnClickListener{
public EditText getTarNimb;
private Button btn_ok_nimb, btnSave_Nimb;
public ImageView imgNimb;
private Bitmap bmpNimb;
public NimbuzzFragment() {
// Required empty public constructor
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_nimbuzz, container, false);
getTarNimb = (EditText) v.findViewById(R.id.txtUserNimb);
btn_ok_nimb = (Button) v.findViewById(R.id.btnokNimb);
btnSave_Nimb = (Button) v.findViewById(R.id.btnsaveNimb);
imgNimb = (ImageView) v.findViewById(R.id.imgviewNimb);
btn_ok_nimb.setOnClickListener(this);
btnSave_Nimb.setOnClickListener(new View.OnClickListener() {
boolean success = false;
@Override
public void onClick(View view) {
File direct = new File(Environment.getExternalStorageDirectory() + "/Nimbuzz_Avatars");
if (!direct.exists()) {
direct.mkdirs();
}
DownloadManager mgr = (DownloadManager) getActivity().getSystemService(Context.DOWNLOAD_SERVICE);
Uri downloadUri = Uri.parse("http://avatar.nimbuzz.com/getAvatar?jid="+getTarNimb.getText().toString()+"%40nimbuzz.com");
DownloadManager.Request request = new DownloadManager.Request(downloadUri);
request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI | DownloadManager.Request.NETWORK_MOBILE)
.setAllowedOverRoaming(false)
.setTitle("AvatarGrabberByDB")
.setDescription("coded by db~@nc")
.setDestinationInExternalPublicDir("/Nimbuzz_Avatars", getTarNimb.getText().toString()+".jpg");
mgr.enqueue(request);
success = true;
if(success){
Toast.makeText(getActivity(),"Imaged Saved!", Toast.LENGTH_SHORT).show();
}
else{
Toast.makeText(getActivity(),"Error!", Toast.LENGTH_SHORT).show();
}
}
});
return v;
}
@Override
public void onClick(View view) {
switch(view.getId()){
case R.id.btnokNimb:
Picasso.with(getContext())
.load("http://avatar.nimbuzz.com/getAvatar?jid="+getTarNimb.getText().toString()+"%40nimbuzz.com")
.into(imgNimb);
}
}
}


package com.blogspot.dbh4ck.avatargrabberdb.Fragments;
import android.app.DownloadManager;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import com.blogspot.dbh4ck.avatargrabberdb.R;
import com.squareup.picasso.Picasso;
import java.io.File;
public class PalringoFragment extends Fragment implements View.OnClickListener{
public EditText getTarPal;
private Button btn_ok_pal, btnSave_Pal;
public ImageView imgPal;
private Bitmap bmpPal;
public PalringoFragment() {
// Required empty public constructor
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v= inflater.inflate(R.layout.fragment_palringo, container, false);
getTarPal = (EditText) v.findViewById(R.id.txtUserPal);
btn_ok_pal = (Button) v.findViewById(R.id.btnokPal);
btnSave_Pal = (Button) v.findViewById(R.id.btnsavePal);
imgPal = (ImageView) v.findViewById(R.id.imgviewPal);
btn_ok_pal.setOnClickListener(this);
btnSave_Pal.setOnClickListener(new View.OnClickListener() {
boolean success = false;
@Override
public void onClick(View view) {
File direct = new File(Environment.getExternalStorageDirectory() + "/Palringo_Avatars");
if (!direct.exists()) {
direct.mkdirs();
}
DownloadManager mgr = (DownloadManager) getActivity().getSystemService(Context.DOWNLOAD_SERVICE);
Uri downloadUri = Uri.parse("http://www.palringo.com/showavatar.php?id="+getTarPal.getText().toString()+"&type=g");
DownloadManager.Request request = new DownloadManager.Request(downloadUri);
request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI | DownloadManager.Request.NETWORK_MOBILE)
.setAllowedOverRoaming(false)
.setTitle("AvatarGrabberByDB")
.setDescription("coded by db~@nc")
.setDestinationInExternalPublicDir("/Palringo_Avatars", getTarPal.getText().toString()+".jpg");
mgr.enqueue(request);
success = true;
if(success){
Toast.makeText(getActivity(),"Imaged Saved!", Toast.LENGTH_SHORT).show();
}
else{
Toast.makeText(getActivity(),"Error!", Toast.LENGTH_SHORT).show();
}
}
});
return v;
}
@Override
public void onClick(View v) {
Picasso.with(getContext())
.load("http://www.palringo.com/showavatar.php?id="+getTarPal.getText().toString())
.into(imgPal);
}
}


MainActivity Layout:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_layout"
android:orientation="vertical"
tools:context=".MainActivity"
android:fitsSystemWindows="true">
<!-- toolbar -->
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
<!-- tablayout to display tabs -->
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
app:tabGravity="fill"
app:tabMode="fixed"
app:tabIndicatorColor="@color/white"
app:tabSelectedTextColor="@color/white"
app:tabTextColor="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimaryDark"
android:minHeight="?attr/actionBarSize"
android:theme="@style/AppTheme.NoActionBar" />
<!-- View pager to swipe views -->
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="fill_parent"/>
</LinearLayout>


Identical Layouts for each Fragment:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:transcriptMode="normal"
android:fillViewport="true"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fragmentfacebook"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true">
<Space android:layout_width="match_parent"
android:layout_height="2dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txtview3"
android:text="Facebook Avatar Grabber"
android:typeface="serif"
android:textAlignment="center"
android:textStyle="normal|bold"
tools:textColor="@color/colorPrimary"
android:textSize="18sp" />
<Space android:layout_width="match_parent"
android:layout_height="10dp" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/txtUserFb"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Facebook ID"
android:inputType="text"
android:layout_below="@+id/txtview3"
android:textColor="@color/colorPrimaryDark" />
</android.support.design.widget.TextInputLayout>
<Button
android:layout_height="wrap_content"
android:text="OK"
android:textSize="16sp"
android:id="@+id/btnokFb"
android:layout_below="@+id/txtUserFb"
style="@style/Widget.AppCompat.Button.Colored"
android:textAllCaps="false"
android:textAlignment="center"
android:layout_width="93dp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Download"
android:textSize="16sp"
android:id="@+id/btnsaveFb"
style="@style/Widget.AppCompat.Button.Colored"
android:textAllCaps="false"
android:textAlignment="center"
tools:gravity="center_horizontal" />
<TextView android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textAlignment="center"
android:id="@+id/notefb"
android:text="Note: Image will be saved to: /sdcard/Facebook_Avatars"
android:textColor="@color/colorPrimaryDark" />
<ImageView android:layout_gravity="fill"
android:paddingLeft="16dp"
android:paddingBottom="16dp"
android:layout_width="match_parent"
android:layout_height="350dp"
android:layout_below="@+id/notefb"
android:id="@+id/imgviewFb"
android:scaleType="fitCenter" />
</LinearLayout>
</RelativeLayout>
</ScrollView>

Saturday, 3 December 2016

Xamarin Android (C#) Sample Xmpp Nimbuzz using Socket Connection (TcpClient)


################ Basic Requirements: ################

-  Xamarin Studio 6.1.6 (Latest)
-  SDK Tools Version: 25.2.3
-  SDK Platform Tools Version: 25.0.1
-  SDK Build Tools Version: 23.0.1
-  Android NDK
-  SDK Platform:
4.0.3 (API level 15)
4.2   (API level 17)
4.4   (API level 19)
6.0   (API level 23)
7.0   (API level 24)
-  Microsoft .NET 4.0.30319.42000
-  Xamarin.Android Version: 7.0.1.6
-  GTK# 2.12.38

################ Key Features: ################

- Xamarin Xmpp Client Sample (C#) For Android
- Socket Connection

################ Feedback: ################

- For any kind of further queries or bugs, kindly do not hesistate to write me at: dbh4ck@gmail.com
- http://dbh4ck.blogspot.in


Download Full Source Code From My Github

Download Apk


using Android.App;
using Android.Widget;
using Android.OS;
using System.Net.Sockets;
using System;
using System.Text;
using System.Threading;
using Android.Content;
using Android.Views;
namespace Nimbuzz_Xamarin_Android_Db
{
[Activity(Label = "Nimbuzz Xamarin Android By Db~@NC", MainLauncher = true, Icon = "@mipmap/icon")]
public class MainActivity : Activity
{
// Make Socket Universal throughout App (Make Use socket anywhere in any Activity of this App)
public static TcpClient client;
public static string passid;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
Button btnSignIn = FindViewById<Button>(Resource.Id.btnSignin);
btnSignIn.Click += delegate
{
login();
};
}
void login()
{
// Get UserName and PassWord From User
EditText userName = FindViewById<EditText>(Resource.Id.txtUser);
EditText userPwd = FindViewById<EditText>(Resource.Id.txtPwd);
var usrid = userName.Text;
var usrpwd = userPwd.Text;
// Initialize New TcpClient Connection
try
{
client = new TcpClient() { NoDelay = true };
client.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);
client.Client.Connect("o.nimbuzz.com", 5222);
Toast.MakeText(this, "Connecting...", ToastLength.Short).Show();
NetworkStream stream = client.GetStream();
if (client.Client.Connected)
{
client.Client.Send(Encoding.UTF8.GetBytes("<stream:stream xmlns='jabber:client' to='nimbuzz.com' version='1.0' xmlns:stream='http://etherx.jabber.org/streams' xml:lang='en' >"));
string str = Convert.ToBase64String(Encoding.UTF8.GetBytes("\0" + usrid + "\0" + usrpwd));
client.Client.Send(Encoding.UTF8.GetBytes("<auth id='sasl2' xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>" + str + "</auth>"));
}
// Start Thread On Successfull Connection
Thread rec = new Thread(new ThreadStart(dbThread));
rec.IsBackground = true;
rec.Start();
}
catch (SocketException ex) {
}
}
void dbThread()
{
try
{
while (client.Connected)
{
byte[] buffbyte = new byte[client.ReceiveBufferSize];
int i = client.Client.Receive(buffbyte);
if (i != 0)
{
if (i < buffbyte.Length)
{
byte[] buffbyte2 = new byte[i];
for (int b = 0; b < i; b++)
{
buffbyte2[b] = buffbyte[b];
}
buffbyte = buffbyte2;
}
// Handles the incoming data received from Server side
string xml = Encoding.UTF8.GetString(buffbyte);
DataArrival(xml);
// Ping Server every 60 seconds to avoiding auto-disconnect
int startin = 60 - DateTime.Now.Second;
var t = new System.Threading.Timer(o => client.Client.Send(Encoding.UTF8.GetBytes("<iq to='nimbuzz.com' type='get' id='db1_a2'><ping xmlns='urn:xmpp:ping' /></iq>")), null, startin * 1000, 60000);
}
}
}
catch (Exception ex)
{
//Toast.MakeText(this, ex.ToString(), ToastLength.Short).Show();
}
}
void DataArrival(string xml)
{
xml = xml.Replace("\"", "'");
if (xml.IndexOf("<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>", System.StringComparison.OrdinalIgnoreCase) + 1 != 0)
{
// Register Client
// Bind Resource
// Open session
client.Client.Send(Encoding.UTF8.GetBytes("<stream:stream xmlns='jabber:client' to='nimbuzz.com' version='1.0' xmlns:stream='http://etherx.jabber.org/streams' xml:lang='en' >"));
client.Client.Send(Encoding.UTF8.GetBytes("<iq type='set'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><resource>dbhere</resource></bind></iq>"));
client.Client.Send(Encoding.UTF8.GetBytes("<iq id='jcl_2' type='set'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq>"));
}
if (xml.IndexOf("<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>", System.StringComparison.OrdinalIgnoreCase) + 1 != 0)
{
//Toast.MakeText(this, "Logged in Successfully!", ToastLength.Short).Show();
client.Client.Send(Encoding.UTF8.GetBytes("<presence><status>Online Via Xamarin C# (Android)</status><priority>1</priority><show>Online</show><nick xmlns='http://jabber.org/protocol/nick'>XamarinDb</nick></presence>"));
EditText userName = FindViewById<EditText>(Resource.Id.txtUser);
passid = userName.Text;
var LoggedInt = new Intent(this, typeof(LoggedActivity));
LoggedInt.PutExtra("usrid", passid); //pass value to Logged Activity
StartActivity(LoggedInt);
}
if (xml.Contains("<failure xmlns="))
{
//Toast.MakeText(this, "Invalid Username & Password", ToastLength.Short).Show();
client.Client.Close(); // close socket
}
}
public override bool OnCreateOptionsMenu(IMenu menu)
{
base.OnCreateOptionsMenu(menu);
// Inflate the menu; this adds items to the action bar if it is present.
MenuInflater inflater = this.MenuInflater;
inflater.Inflate(Resource.Menu.menuoption, menu);
return true;
}
public override bool OnOptionsItemSelected(IMenuItem item)
{
base.OnOptionsItemSelected(item);
switch (item.ItemId) {
case Resource.Id.about:
aboutDialog();
break;
case Resource.Id.exit:
Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
break;
default:
break;
}
return true;
}
void aboutDialog()
{
/*
var myalert = new AlertDialog.Builder(this);
myalert.SetTitle("About App");
myalert.SetMessage("This is Xamarin Android App Coded in C# based on Socket Programming");
myalert.SetNeutralButton("OK", (senderAlert, args) =>
{
this.Dispose();
});
Dialog dialog = myalert.Create();
dialog.Show();
**/
Toast.MakeText(this, "Xamarin Android Coded By Db~@NC", ToastLength.Long).Show();
}
}
}
view raw MainActivity.cs hosted with ❤ by GitHub


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
namespace Nimbuzz_Xamarin_Android_Db
{
[Activity(Label = "LoggedActivity")]
public class LoggedActivity : Activity
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
// Set our view from the layout resource
SetContentView(Resource.Layout.LoggedLayout);
TextView jidlbl = FindViewById<TextView>(Resource.Id.textView5);
TextView jidUser = FindViewById<TextView>(Resource.Id.textView6);
jidUser.Text = Intent.GetStringExtra("usrid") + "@nimbuzz.com";
//MainActivity.client.Client.Send(Encoding.UTF8.GetBytes("<message to='db~@nimbuzz.com' type='chat' id='-4587545787'><body>im Online</body><active xmlns ='http://jabber.org/protocol/chatstates' /><request xmlns='urn:xmpp:receipts' /></message>"));
MainActivity.client.Client.Send(Encoding.UTF8.GetBytes("<presence to='db~@nimbuzz.com' type='subscribe' />"));
Button logout_btn = FindViewById<Button>(Resource.Id.logoutbtn);
logout_btn.Click += delegate
{
if (MainActivity.client.Client.Connected == true) {
MainActivity.client.Client.Dispose();
MainActivity.client.Client.Close();
// Throw back to MainACtivity after Logout Connection Closing
StartActivity(typeof(MainActivity));
}
};
}
public override bool OnCreateOptionsMenu(IMenu menu)
{
base.OnCreateOptionsMenu(menu);
// Inflate the menu; this adds items to the action bar if it is present.
MenuInflater inflater = this.MenuInflater;
inflater.Inflate(Resource.Menu.loggedmenuoption, menu);
return true;
}
public override bool OnOptionsItemSelected(IMenuItem item)
{
base.OnOptionsItemSelected(item);
string strinfo = "You are currently Logged as: " + Intent.GetStringExtra("usrid") + "@nimbuzz.com";
switch (item.ItemId)
{
case Resource.Id.info:
Toast.MakeText(this, strinfo , ToastLength.Long).Show();
break;
case Resource.Id.exit:
Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
break;
default:
break;
}
return true;
}
}
}


<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:transcriptMode="normal"
android:fillViewport="true">
<RelativeLayout xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="561.5dp"
android:orientation="vertical"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="0.0dp">
<TextView
android:textSize="20dp"
android:textColor="#fb0564"
android:id="@+id/lbldb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="46dp"
android:text="@string/hello_db"
android:textAlignment="center"
android:gravity="center_horizontal" />
<TextView
android:textSize="20sp"
android:textColor="#fce907ed"
android:id="@+id/textView2"
android:layout_width="345.5dp"
android:layout_height="wrap_content"
android:text="@string/login"
android:layout_marginTop="16dp"
android:layout_below="@+id/lbldb"
android:textAlignment="center"
android:gravity="left" />
<Space
android:layout_width="338.0dp"
android:layout_height="10dp" />
<EditText
android:id="@+id/txtUser"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Your Username"
android:inputType="text"
android:layout_below="@+id/textView2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="22dp"
android:textColor="@color/colorPrimaryDark" />
<Space
android:layout_width="match_parent"
android:layout_height="20dp" />
<EditText
android:id="@+id/txtPwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Your Password"
android:inputType="textPassword"
android:layout_below="@+id/txtUser"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="21dp"
android:textColor="@color/colorPrimaryDark" />
<ProgressBar
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/progressBar"
android:layout_above="@+id/btnSignin"
android:layout_centerHorizontal="false"
android:indeterminate="false"
android:visibility="invisible"
android:layout_gravity="center" />
<Button
android:textColor="#0b42f6"
android:id="@+id/btnSignin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/btn_login"
android:layout_marginBottom="44dp"
android:layout_above="@+id/textViewDbLink"
android:layout_centerHorizontal="true" />
<TextView
android:textColor="#fc4108"
android:autoLink="web"
android:id="@+id/textViewDbLink"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/lbl_dbh4ck"
android:textAlignment="center"
android:layout_marginBottom="14dp"
android:layout_above="@+id/textViewDbEmail"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:gravity="center_horizontal" />
<TextView
android:textColor="#198104"
android:id="@+id/textViewDbEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/lbl_dbmail"
android:layout_marginBottom="20dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:textAlignment="center"
android:gravity="center_horizontal" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
view raw Main.axml hosted with ❤ by GitHub


<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:transcriptMode="normal"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="1dp">
<!-- TODO: Update blank fragment layout -->
<TextView
android:id="@+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="44dp"
android:text="@string/botid"
android:textStyle="normal|bold"
android:textSize="18sp"
android:textAlignment="center"
android:textColor="@color/colorPrimaryDark"
android:gravity="center_horizontal" />
<TextView
android:text="TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:id="@+id/textView6"
android:textSize="20sp"
android:textColor="@color/colorPrimaryDark"
android:textStyle="normal|bold"
android:fontFamily="monospace"
android:layout_below="@+id/textView5"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textAlignment="center"
android:gravity="center_horizontal" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/logout"
android:id="@+id/logoutbtn"
android:textSize="20sp"
android:textColor="#ff1ca6f4"
android:textAllCaps="false"
android:gravity="center"
android:typeface="serif"
android:textStyle="bold"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
</RelativeLayout>
</ScrollView>