Commit 2ffe21f5 authored by Dharmakeerthi's avatar Dharmakeerthi

Upload function interfaces

parent 2a084f66
package com.appsnipp.education;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.List;
public class Maintainces extends AppCompatActivity {
TextView textTargetUri;
static ImageView targetImage;
TextView textOwnername;
TextView BrandDe;
TextView Modelde;
TextView ManufacturDateDe;
TextView EngineTypeDe;
TextView vDe;
String test1;
public static Bitmap bitmap;
public static Bitmap bitmap1;
Uri targetUri;
public static int checking2;
public static int checking1;
public String temp1="";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maintainces);
ImageButton buttonLoadImage = (ImageButton) findViewById(R.id.imageButton);
//textTargetUri = (TextView)findViewById(R.id.targeturi);
targetImage = (ImageView)findViewById(R.id.vehiclechange);
//targetImage2 = (ImageView)findViewById(R.id.targetimage2);
try{
FileInputStream fin = openFileInput("myfile");
int c;
String temp="";
while((c=fin.read())!=-1){
temp=temp+Character.toString((char) c);
textOwnername = (TextView) findViewById(R.id.owner);
textOwnername.setText(temp);
}
System.out.println(temp);
}catch (Exception e){
e.printStackTrace();
}
try{
FileInputStream fin = openFileInput("myfile1");
int p;
while((p=fin.read())!=-1){
temp1=temp1+Character.toString((char) p);
// textOwnername = (TextView) findViewById(R.id.owner);
// textOwnername.setText(temp);
}
List<String> details = Arrays.asList(temp1.split("/"));
BrandDe = (TextView) findViewById(R.id.BrandDe);
Modelde = (TextView) findViewById(R.id.ModelDe);
ManufacturDateDe=(TextView) findViewById(R.id.makeyearDE);
EngineTypeDe=(TextView) findViewById(R.id.EngineTypeDe);
vDe=(TextView) findViewById(R.id.VDe);
vDe.setText(details.get(0));
BrandDe.setText(details.get(1));
Modelde.setText(details.get(2));
ManufacturDateDe.setText(details.get(3));
EngineTypeDe.setText(details.get(4));
}catch (Exception e){
vDe.setText("Enter your Details");
BrandDe.setText("Enter your Details");
Modelde.setText("Enter your Details");
ManufacturDateDe.setText("Enter your Details");
EngineTypeDe.setText("Enter your Details");
e.printStackTrace();
}
RelativeLayout relativeclic1 =(RelativeLayout)findViewById(R.id.BackToHome);
relativeclic1.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
startActivityForResult(new Intent(Maintainces.this,MainActivity.class), 0);
}
});
RelativeLayout relativeclic2 =(RelativeLayout)findViewById(R.id.BackToUpComing);
relativeclic2.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v1){
startActivityForResult(new Intent(Maintainces.this, UpComing.class), 0);
}
});
buttonLoadImage.setOnClickListener(new Button.OnClickListener(){
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent intent = new Intent(Intent.ACTION_PICK,
android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, 0);
}});
if (bitmap1 != null) {
targetImage.setImageBitmap(bitmap1);
}
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK){
targetUri = data.getData();
try {
bitmap = BitmapFactory.decodeStream(getContentResolver().openInputStream(targetUri));
targetImage.setImageBitmap(bitmap);
bitmap1=bitmap;
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
tools:context=".Changers_in_one">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/finalback">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<include layout="@layout/oil_filter" android:id="@+id/layoutoilfilter" />
<include layout="@layout/engine_oil" android:id="@+id/layoutengineoil" />
<include layout="@layout/washer_plug" android:id="@+id/layoutwasher_plug" />
<include layout="@layout/dust_filter" android:id="@+id/layoutdust_filter" />
<include layout="@layout/wheel_align" android:id="@+id/layoutwheel_align" />
<include layout="@layout/air_clean_filter" android:id="@+id/layoutair_clean_filter" />
<include layout="@layout/fuel_filter" android:id="@+id/layoutfuel_filter" />
<include layout="@layout/spark_plug" android:id="@+id/layoutspark_plug" />
<include layout="@layout/brake_fluid" android:id="@+id/layoutbrake_fluid" />
<include layout="@layout/break_oil" android:id="@+id/layoutbreak_oil" />
<include layout="@layout/transmission_fluid" android:id="@+id/layouttransmission_fluid" />
<include layout="@layout/break_pads" android:id="@+id/layoutbreak_pads" />
<include layout="@layout/clutch" android:id="@+id/layoutclutch" />
<include layout="@layout/coolant" android:id="@+id/layoutcoolant" />
</LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
tools:context=".Changers_in_two">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/finalback">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<include layout="@layout/oil_filter" android:id="@+id/layoutoilfilter" />
<include layout="@layout/engine_oil" android:id="@+id/layoutengineoil" />
<include layout="@layout/washer_plug" android:id="@+id/layoutwasher_plug" />
<include layout="@layout/dust_filter" android:id="@+id/layoutdust_filter" />
<include layout="@layout/wheel_align" android:id="@+id/layoutwheel_align" />
<include layout="@layout/air_clean_filter" android:id="@+id/layoutair_clean_filter" />
<include layout="@layout/fuel_filter" android:id="@+id/layoutfuel_filter" />
<include layout="@layout/spark_plug" android:id="@+id/layoutspark_plug" />
<include layout="@layout/brake_fluid" android:id="@+id/layoutbrake_fluid" />
<include layout="@layout/break_oil" android:id="@+id/layoutbreak_oil" />
<include layout="@layout/transmission_fluid" android:id="@+id/layouttransmission_fluid" />
<include layout="@layout/break_pads" android:id="@+id/layoutbreak_pads" />
<include layout="@layout/clutch" android:id="@+id/layoutclutch" />
<include layout="@layout/coolant" android:id="@+id/layoutcoolant" />
</LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
tools:context=".Prediction">
<ScrollView
android:id="@+id/scrollView2"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RelativeLayout
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/headerLayout"
android:layout_width="315dp"
android:layout_height="395dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="24dp"
android:layout_marginTop="69dp"
android:layout_marginEnd="32dp"
android:background="@drawable/reports_header_bk"
android:paddingLeft="20dp"
android:paddingTop="6dp"
android:paddingRight="20dp"
android:paddingBottom="20dp">
<TextView
android:id="@+id/salesHeaderTextView"
style="@style/reportContentText"
android:layout_width="335dp"
android:layout_height="67dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="0dp"
android:layout_marginTop="45dp"
android:layout_marginEnd="0dp"
android:gravity="center"
android:text="@string/total_mileage"
android:textSize="40sp" />
<TextView
android:id="@+id/f89"
style="@style/viewParent.headerText"
android:layout_width="335dp"
android:layout_height="wrap_content"
android:layout_below="@+id/salesHeaderTextView"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="0dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="0dp"
android:layout_marginBottom="70dp"
android:gravity="center"
android:text="@string/_15_290_km"
android:textColor="@color/whiteTextColor" />
<TextView
android:id="@+id/textView2"
android:layout_width="67dp"
android:layout_height="51dp"
android:layout_alignStart="@+id/progress_bar"
android:layout_alignBottom="@+id/progress_bar"
android:layout_marginStart="45dp"
android:layout_marginBottom="60dp"
android:gravity="center"
android:text="60%"
android:textSize="30dp" />
<ProgressBar
android:id="@+id/progress_bar"
style="@style/CircularDeterminateProgressBar"
android:layout_width="172dp"
android:layout_height="192dp"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="67dp"
android:layout_marginTop="-64dp"
android:layout_marginBottom="34dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:progress="60" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="120dp">
<include
android:id="@+id/includepredictedSugestions"
layout="@layout/predict_suggesstions"
android:layout_width="359dp"
android:layout_height="99dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="22dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="30dp"
android:layout_marginBottom="1dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="120dp">
<include
android:id="@+id/includepredicted_mileage"
layout="@layout/predict_mileage"
android:layout_width="359dp"
android:layout_height="97dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="22dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="30dp"
android:layout_marginBottom="3dp" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
<!-- <LinearLayout-->
<!-- android:id="@+id/cardLayout"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="320dp"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="@+id/headerLayout">-->
<!-- <android.support.v7.widget.CardView-->
<!-- style="@style/reportsCardStyle"-->
<!-- app:cardBackgroundColor="@color/whiteTextColor"-->
<!-- app:cardCornerRadius="16dp">-->
<!-- <LinearLayout-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_gravity="center"-->
<!-- android:orientation="vertical">-->
<!-- <TextView-->
<!-- android:id="@+id/this_month"-->
<!-- style="@style/reportContentText"-->
<!-- android:text="@string/this_month"-->
<!-- android:textColor="#79D0A3" />-->
<!-- <TextView-->
<!-- android:id="@+id/valuethismonth"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="@string/km"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="27sp"-->
<!-- android:textStyle="bold" />-->
<!-- </LinearLayout>-->
<!-- </android.support.v7.widget.CardView>-->
<!-- <android.support.v7.widget.CardView-->
<!-- style="@style/reportsCardStyle"-->
<!-- app:cardBackgroundColor="@color/whiteTextColor"-->
<!-- app:cardCornerRadius="16dp">-->
<!-- <LinearLayout-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_gravity="center"-->
<!-- android:orientation="vertical">-->
<!-- <TextView-->
<!-- style="@style/reportContentText"-->
<!-- android:text="@string/thisweekkm"-->
<!-- android:textColor="#79D0A3" />-->
<!-- <TextView-->
<!-- android:id="@+id/valuethisWeek"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="@string/km"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="27sp"-->
<!-- android:textStyle="bold" />-->
<!-- </LinearLayout>-->
<!-- </android.support.v7.widget.CardView>-->
<!-- </LinearLayout>-->
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment