Professional Documents
Culture Documents
package com.example.hitimanaben;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnabout=findViewById(R.id.btnabout);
btnmyprofile= findViewById(R.id.btnmyprofile);
btnmyprofile.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
openactivityc();
}
});
btnabout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
openactivityb();
}
});
}
private void openactivityb(){
Intent nabil= new Intent(this,activityb.class);
startActivity(nabil);
}
private void openactivityc(){
Intent muvunyi= new Intent(this,activityc.class);
startActivity(muvunyi);
}
}
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activityb);
getSupportActionBar().setTitle("About ALC");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
web1 = findViewById(R.id.web1);
web1.setWebViewClient(new WebViewClient());
web1.loadUrl("https://andela.com/alc/");
WebSettings x = web1.getSettings();
x.setJavaScriptEnabled(true);
}
@Override
public void onBackPressed() {
if( web1.canGoBack()){
web1.goBack();
}else {
super.onBackPressed();
}}
}
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Welcome to ALC 4.0"
android:textSize="30dp"
android:padding="50dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btnabout"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginTop="300dp"
android:layout_centerHorizontal="true"
android:text="ABOUT ALC"
android:background="@color/colorAccent"
android:textSize="30dp"
/>
<Button
android:id="@+id/btnmyprofile"
android:layout_width="300dp"
android:background="@color/colorAccent"
android:layout_height="wrap_content"
android:layout_marginTop="400dp"
android:gravity="center"
android:layout_centerHorizontal="true"
android:text="MY PROFILE"
android:textSize="30dp"
/>
</RelativeLayout>
<ImageView
android:id="@+id/imgben"
android:layout_width="250dp"
android:layout_height="250dp"
android:layout_marginLeft="130dp"
android:layout_marginTop="20dp"
android:background="@drawable/ben"
/>
<TextView
android:id="@+id/tv1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hitimana Benjamin"
android:layout_below="@id/imgben"
android:layout_marginLeft="130dp"
android:layout_marginTop="5dp"
android:textSize="20dp"
/>
<View
android:id="@+id/v1"
android:layout_width="wrap_content"
android:layout_height="3dp"
android:layout_below="@id/tv1"
android:background="@color/colorgrey"
/>
<TextView
android:id="@+id/tv2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Track:"
android:layout_below="@id/v1"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:textSize="20dp"
/>
<TextView
android:id="@+id/tv3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Country:"
android:layout_below="@id/tv2"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:textSize="20dp"
/>
<TextView
android:id="@+id/tv4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Email:"
android:layout_below="@id/tv3"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:textSize="20dp"
/>
<TextView
android:id="@+id/tv5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Phone Number:"
android:layout_below="@id/tv4"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:textSize="20dp"
/>
<TextView
android:id="@+id/tv6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Slack Username:"
android:layout_below="@id/tv5"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:textSize="20dp"
/>
<TextView
android:id="@+id/tva"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Android"
android:layout_marginLeft="150dp"
android:layout_marginTop="20dp"
android:layout_below="@id/v1"
android:textSize="20dp"
/>
<TextView
android:id="@+id/tvb"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Rwanda"
android:layout_marginLeft="150dp"
android:layout_marginTop="20dp"
android:layout_below="@id/tva"
android:textSize="20dp"
/>
<TextView
android:id="@+id/tvc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="bhitimana940@gmail.com"
android:layout_marginLeft="130dp"
android:layout_marginTop="20dp"
android:layout_below="@id/tvb"
android:textSize="20dp"
/>
<TextView
android:id="@+id/tvd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="+250788310515"
android:layout_marginLeft="170dp"
android:layout_marginTop="20dp"
android:layout_below="@id/tvc"
android:textSize="20dp"
/>
<TextView
android:id="@+id/tve"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="benhitimana"
android:layout_marginLeft="180dp"
android:layout_marginTop="20dp"
android:layout_below="@id/tvd"
android:textSize="20dp"
/>
</RelativeLayout>
Activity c java
package com.example.hitimanaben;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activityc);
getSupportActionBar().setTitle("My Profile");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}
activity b java
package com.example.hitimanaben;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activityc);
getSupportActionBar().setTitle("My Profile");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}
android manifest file xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hitimanaben">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@drawable/ben"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".activityc"
android:parentActivityName=".MainActivity"></activity>
<activity android:name=".activityb"
android:parentActivityName=".MainActivity"/>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</manifest>