ternyata posting Struk SPBU lumayan banyak peminatnya. Itu program under Win buat cetak struk di kertas berukuran 75mm. Yang donlot dari 4shared lebih dari 3500 unduhan sejak publikasi... lumayan ya... gak tau juga pada dipake buat apa... gak usah su'uzon [halah, sok alim]
OK... ceritanya, kemaren belajar bikin aplikasi buat android, dan karya pertama adalah Kiblat by Map [buat nyari kiblat ke Mekah dari lokasi "manapun"] pake peta simbah. Trus jadi tertarik buat aplikasi android yg Struk SPBU, ukuran 57mm. Dan ini hasilnya, sementara biar mangkal di 4shared [suwer, lom ada $25 buat bikin akun GD]. Gratis, tapi ada iklannya.. kalo kalian make, jangan lupa klik iklan ya... he he he . . . mksh sebelomnya . . .
loading...
itu ss di android 3,5"
Kalo ada yg minat, ini sebagian source-nya
1. Mulai dari halaman isian data SPBU, dll
Activity.xml
Spoiler Activity.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/mm57"
android:background="#ff99cc00"
android:id="@+id/textKop"
android:gravity="center_horizontal"
android:textColor="#ffff4444"
android:textStyle="bold"
android:textSize="20sp"
android:paddingTop="5dp"
android:paddingBottom="5dp" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/textKop"
android:layout_above="@+id/btn_ok">
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12dp">
<!-- baris 1 : ID SPBU -->
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/id_spbu" />
<EditText
android:id="@+id/id_spbu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_column="2"
android:inputType="textCapCharacters" />
</TableRow>
<!-- baris 2 -->
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/header" />
<EditText
android:id="@+id/header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="text|textMultiLine|textPostalAddress"
android:hint="@string/alamat_spbu" />
</TableRow>
<!-- baris 3 -->
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/tgl_jam" />
<EditText
android:id="@+id/tgl_jam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="datetime"
android:hint="@string/dmy_hint" />
</TableRow>
<!-- baris 4 -->
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/no_nota" />
<EditText
android:id="@+id/no_nota"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number" />
</TableRow>
<!-- baris 5 -->
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/jns_bbm" />
<EditText
android:id="@+id/jns_bbm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:inputType="text" />
</TableRow>
<!-- baris 6 -->
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/harga_l" />
<EditText
android:id="@+id/harga_liter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:inputType="numberDecimal" />
</TableRow>
<!-- baris 7 -->
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/rp_beli" />
<EditText
android:id="@+id/rp_beli"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="numberDecimal"/>
</TableRow>
<!-- baris 8 -->
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/ltr_beli" />
<EditText
android:id="@+id/ltr_beli"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="numberDecimal" />
</TableRow>
<!-- baris 9 -->
<TableRow
android:layout_marginBottom="5dp">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/footer" />
<EditText
android:id="@+id/kaki"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/footer_hint"
android:inputType="text|textMultiLine" />
</TableRow>
</TableLayout>
</ScrollView>
<!-- baris 10 -->
<Button
android:id="@+id/btn_ok"
style="?android:attr/buttonStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/btn_ok"
android:textColor="#ffcc0000"
android:textStyle="bold"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/mm57"
android:background="#ff99cc00"
android:id="@+id/textKop"
android:gravity="center_horizontal"
android:textColor="#ffff4444"
android:textStyle="bold"
android:textSize="20sp"
android:paddingTop="5dp"
android:paddingBottom="5dp" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/textKop"
android:layout_above="@+id/btn_ok">
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12dp">
<!-- baris 1 : ID SPBU -->
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/id_spbu" />
<EditText
android:id="@+id/id_spbu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_column="2"
android:inputType="textCapCharacters" />
</TableRow>
<!-- baris 2 -->
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/header" />
<EditText
android:id="@+id/header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="text|textMultiLine|textPostalAddress"
android:hint="@string/alamat_spbu" />
</TableRow>
<!-- baris 3 -->
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/tgl_jam" />
<EditText
android:id="@+id/tgl_jam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="datetime"
android:hint="@string/dmy_hint" />
</TableRow>
<!-- baris 4 -->
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/no_nota" />
<EditText
android:id="@+id/no_nota"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number" />
</TableRow>
<!-- baris 5 -->
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/jns_bbm" />
<EditText
android:id="@+id/jns_bbm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:inputType="text" />
</TableRow>
<!-- baris 6 -->
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/harga_l" />
<EditText
android:id="@+id/harga_liter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:inputType="numberDecimal" />
</TableRow>
<!-- baris 7 -->
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/rp_beli" />
<EditText
android:id="@+id/rp_beli"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="numberDecimal"/>
</TableRow>
<!-- baris 8 -->
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/ltr_beli" />
<EditText
android:id="@+id/ltr_beli"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="numberDecimal" />
</TableRow>
<!-- baris 9 -->
<TableRow
android:layout_marginBottom="5dp">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/footer" />
<EditText
android:id="@+id/kaki"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/footer_hint"
android:inputType="text|textMultiLine" />
</TableRow>
</TableLayout>
</ScrollView>
<!-- baris 10 -->
<Button
android:id="@+id/btn_ok"
style="?android:attr/buttonStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/btn_ok"
android:textColor="#ffcc0000"
android:textStyle="bold"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
ini Activity.java
Spoiler Activity.java:
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.InputFilter;
import android.view.ContextMenu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Toast;
public class MainActivity extends Activity {
Button btnOK;
EditText etID_SPBU, et_header, et_tg_jam, et_noNota, et_jnsBBM;
EditText et_h_ltr, et_RpBeli, et_LtrBeli, et_footer;
AdsController app;
LinearLayout layAd;
MyUtils myU;
Boolean gPlayOK;
private InterstitialAd interstitial;
private void saveItemStruk(String item, String isi) {
SharedPreferences sharedPref = getSharedPreferences(item, MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putString(item, isi);
editor.commit();
}
private String getItemStruk(String item) {
SharedPreferences sharedPref = getSharedPreferences(item, MODE_PRIVATE);
String mySetting = sharedPref.getString(item, null);
return mySetting;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
etID_SPBU = (EditText)findViewById(R.id.id_spbu);
etID_SPBU.setFilters(new InputFilter[]{new InputFilter.AllCaps()});
et_header = (EditText)findViewById(R.id.header);
et_tg_jam = (EditText)findViewById(R.id.tgl_jam);
et_noNota = (EditText)findViewById(R.id.no_nota);
et_jnsBBM = (EditText)findViewById(R.id.jns_bbm);
et_h_ltr = (EditText)findViewById(R.id.harga_liter);
et_RpBeli = (EditText)findViewById(R.id.rp_beli);
et_LtrBeli= (EditText)findViewById(R.id.ltr_beli);
et_footer = (EditText)findViewById(R.id.kaki);
etID_SPBU.setText(getItemStruk("ID"));
et_header.setText(getItemStruk("heder"));
et_tg_jam.setText(getItemStruk("tgl"));
et_noNota.setText(getItemStruk("nota"));
et_jnsBBM.setText(getItemStruk("bbm"));
et_h_ltr.setText(getItemStruk("harga"));
et_RpBeli.setText(getItemStruk("beli"));
et_LtrBeli.setText(getItemStruk("liter"));
et_footer.setText(getItemStruk("f00ter"));
btnOK = (Button) findViewById(R.id.btn_ok);
registerForContextMenu(btnOK);
btnOK.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
openContextMenu(btnOK);
}
});
}
public void displayInterstitial() {
if (interstitial.isLoaded()) {
interstitial.show();
}
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenu.ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle("Lanjut mode cetak");
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main, menu);
}
@Override
public boolean onContextItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.struk_1:
struk_1();
break;
case R.id.struk_2:
struk_2();
break;
case R.id.struk_3:
struk_3();
break;
case R.id.help:
panduan();
break;
default:
return super.onContextItemSelected(item);
}
return true;
}
private void posting(Intent intent) {
intent.putExtra("ID", etID_SPBU.getText().toString());
intent.putExtra("header", et_header.getText().toString());
intent.putExtra("tgl_jam", et_tg_jam.getText().toString());
intent.putExtra("no_nota", et_noNota.getText().toString());
intent.putExtra("BBM", et_jnsBBM.getText().toString());
intent.putExtra("harga", et_h_ltr.getText().toString());
intent.putExtra("rp_beli", et_RpBeli.getText().toString());
intent.putExtra("ltr_beli", et_LtrBeli.getText().toString());
intent.putExtra("f00ter", et_footer.getText().toString());
}
public void struk_1() {
Intent intent = new Intent(MainActivity.this, Struk1.class);
posting(intent);
startActivity(intent);
}
public void onDestroy() {
saveItemStruk("ID",etID_SPBU.getText().toString());
saveItemStruk("heder",et_header.getText().toString());
saveItemStruk("tgl",et_tg_jam.getText().toString());
saveItemStruk("nota",et_noNota.getText().toString());
saveItemStruk("bbm",et_jnsBBM.getText().toString());
saveItemStruk("harga",et_h_ltr.getText().toString());
saveItemStruk("beli",et_RpBeli.getText().toString());
saveItemStruk("liter",et_LtrBeli.getText().toString());
saveItemStruk("f00ter",et_footer.getText().toString());
super.onDestroy();
}
}
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.InputFilter;
import android.view.ContextMenu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Toast;
public class MainActivity extends Activity {
Button btnOK;
EditText etID_SPBU, et_header, et_tg_jam, et_noNota, et_jnsBBM;
EditText et_h_ltr, et_RpBeli, et_LtrBeli, et_footer;
AdsController app;
LinearLayout layAd;
MyUtils myU;
Boolean gPlayOK;
private InterstitialAd interstitial;
private void saveItemStruk(String item, String isi) {
SharedPreferences sharedPref = getSharedPreferences(item, MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putString(item, isi);
editor.commit();
}
private String getItemStruk(String item) {
SharedPreferences sharedPref = getSharedPreferences(item, MODE_PRIVATE);
String mySetting = sharedPref.getString(item, null);
return mySetting;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
etID_SPBU = (EditText)findViewById(R.id.id_spbu);
etID_SPBU.setFilters(new InputFilter[]{new InputFilter.AllCaps()});
et_header = (EditText)findViewById(R.id.header);
et_tg_jam = (EditText)findViewById(R.id.tgl_jam);
et_noNota = (EditText)findViewById(R.id.no_nota);
et_jnsBBM = (EditText)findViewById(R.id.jns_bbm);
et_h_ltr = (EditText)findViewById(R.id.harga_liter);
et_RpBeli = (EditText)findViewById(R.id.rp_beli);
et_LtrBeli= (EditText)findViewById(R.id.ltr_beli);
et_footer = (EditText)findViewById(R.id.kaki);
etID_SPBU.setText(getItemStruk("ID"));
et_header.setText(getItemStruk("heder"));
et_tg_jam.setText(getItemStruk("tgl"));
et_noNota.setText(getItemStruk("nota"));
et_jnsBBM.setText(getItemStruk("bbm"));
et_h_ltr.setText(getItemStruk("harga"));
et_RpBeli.setText(getItemStruk("beli"));
et_LtrBeli.setText(getItemStruk("liter"));
et_footer.setText(getItemStruk("f00ter"));
btnOK = (Button) findViewById(R.id.btn_ok);
registerForContextMenu(btnOK);
btnOK.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
openContextMenu(btnOK);
}
});
}
public void displayInterstitial() {
if (interstitial.isLoaded()) {
interstitial.show();
}
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenu.ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle("Lanjut mode cetak");
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main, menu);
}
@Override
public boolean onContextItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.struk_1:
struk_1();
break;
case R.id.struk_2:
struk_2();
break;
case R.id.struk_3:
struk_3();
break;
case R.id.help:
panduan();
break;
default:
return super.onContextItemSelected(item);
}
return true;
}
private void posting(Intent intent) {
intent.putExtra("ID", etID_SPBU.getText().toString());
intent.putExtra("header", et_header.getText().toString());
intent.putExtra("tgl_jam", et_tg_jam.getText().toString());
intent.putExtra("no_nota", et_noNota.getText().toString());
intent.putExtra("BBM", et_jnsBBM.getText().toString());
intent.putExtra("harga", et_h_ltr.getText().toString());
intent.putExtra("rp_beli", et_RpBeli.getText().toString());
intent.putExtra("ltr_beli", et_LtrBeli.getText().toString());
intent.putExtra("f00ter", et_footer.getText().toString());
}
public void struk_1() {
Intent intent = new Intent(MainActivity.this, Struk1.class);
posting(intent);
startActivity(intent);
}
public void onDestroy() {
saveItemStruk("ID",etID_SPBU.getText().toString());
saveItemStruk("heder",et_header.getText().toString());
saveItemStruk("tgl",et_tg_jam.getText().toString());
saveItemStruk("nota",et_noNota.getText().toString());
saveItemStruk("bbm",et_jnsBBM.getText().toString());
saveItemStruk("harga",et_h_ltr.getText().toString());
saveItemStruk("beli",et_RpBeli.getText().toString());
saveItemStruk("liter",et_LtrBeli.getText().toString());
saveItemStruk("f00ter",et_footer.getText().toString());
super.onDestroy();
}
}
2. Halaman struk
struk1.xml
Spoiler Struk1.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:id="@+id/sv_id1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginBottom="5dp"
android:layout_above="@+id/linearLayout">
<LinearLayout
android:layout_width="57mm"
android:layout_marginLeft="3mm"
android:layout_marginRight="3mm"
android:layout_marginTop="3mm"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:id="@+id/img_kop"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:contentDescription="@string/todo"
android:src="@drawable/kop_256" />
<!-- baris 2 ; ID SPBU -->
<TextView
android:id="@+id/id_spbu1"
android:textSize="28sp"
android:textStyle="bold"
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/id_spbu" />
<TextView
android:id="@+id/header1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/alamat_spbu"
android:textSize="22sp"
android:paddingBottom="15dp"
android:text="@string/alamat_spbu"
android:gravity="center_horizontal" />
<TextView
android:id="@+id/shift1"
android:text="@string/shift"
android:textSize="22sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tgl_jam1"
android:textSize="22sp"
android:text="@string/tgl_jam"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/top_line1"
android:layout_width="wrap_content"
android:layout_height="12dp"
android:textSize="22sp"
android:text="@string/line"
android:textStyle="bold" />
<!-- sebelum garis atas -->
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="3">
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/p_pompa11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/pulau"
android:textSize="22sp" />
<TextView
android:id="@+id/p_pompa12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:textSize="22sp"
android:text="@string/pompa"
android:layout_span="2"
android:layout_weight="1" />
</TableRow>
<!-- baris 3 ; jenis BBM -->
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/jns_bbm11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/produk"
android:textSize="22sp" />
<TextView
android:id="@+id/jns_bbm12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:textSize="22sp"
android:layout_weight="1"
android:layout_span="2" />
</TableRow>
<!-- baris 3 ; harga / liter -->
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/harga_liter11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/harga_l"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:text="@string/rp"
android:textSize="22sp"
android:id="@+id/harga_liter12"
android:layout_weight="1"
android:layout_span="2" />
<TextView
android:id="@+id/harga_liter13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="3"
android:text="@string/tmp"
android:textSize="22sp"
android:paddingRight="66dp"
android:gravity="right" />
</TableRow>
<!-- baris 5 ; liter beli -->
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/ltr_beli11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/ltr_beli"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:text="@string/n1"
android:textSize="22sp"
android:id="@+id/ltr_beli12"
android:layout_span="2"
android:layout_weight="1" />
<TextView
android:id="@+id/ltr_beli13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="3"
android:text="@string/tmp"
android:textSize="22sp"
android:paddingRight="66dp"
android:gravity="right" />
</TableRow>
<!-- baris 6 ; jumlah bayar -->
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/rp_beli11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/rp_beli"
android:textSize="22sp" />
<TextView
android:id="@+id/rp_beli12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:text="@string/rp"
android:textSize="22sp"
android:layout_span="2"
android:layout_weight="1" />
<TextView
android:id="@+id/rp_beli13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="3"
android:text="@string/tmp"
android:textSize="21sp"
android:layout_weight="1"
android:paddingRight="66dp"
android:gravity="right" />
</TableRow>
<!-- baris 7 ; FOOTER -->
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="12dp"
android:layout_span="3"
android:layout_weight="1"
android:textSize="22sp"
android:text="@string/line"
android:textStyle="bold"
android:id="@+id/btm_line1"
android:layout_column="1" />
</TableRow>
<TableRow
android:paddingBottom="15dp"
android:layout_width="match_parent">
<TextView
android:id="@+id/f00ter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="22sp"
android:layout_span="3"
android:layout_weight="1"
android:text="@string/footer"
android:gravity="center_horizontal"
android:layout_column="1" />
</TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/linearLayout"
android:gravity="center_horizontal"
android:layout_alignParentBottom="true" >
<Button
android:id="@+id/btn_back"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btn_back" />
<Button
android:id="@+id/btn_simpan_jpg"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btn_jpeg" />
<Button
android:id="@+id/btn_print"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btn_print" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:id="@+id/sv_id1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginBottom="5dp"
android:layout_above="@+id/linearLayout">
<LinearLayout
android:layout_width="57mm"
android:layout_marginLeft="3mm"
android:layout_marginRight="3mm"
android:layout_marginTop="3mm"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:id="@+id/img_kop"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:contentDescription="@string/todo"
android:src="@drawable/kop_256" />
<!-- baris 2 ; ID SPBU -->
<TextView
android:id="@+id/id_spbu1"
android:textSize="28sp"
android:textStyle="bold"
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/id_spbu" />
<TextView
android:id="@+id/header1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/alamat_spbu"
android:textSize="22sp"
android:paddingBottom="15dp"
android:text="@string/alamat_spbu"
android:gravity="center_horizontal" />
<TextView
android:id="@+id/shift1"
android:text="@string/shift"
android:textSize="22sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tgl_jam1"
android:textSize="22sp"
android:text="@string/tgl_jam"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/top_line1"
android:layout_width="wrap_content"
android:layout_height="12dp"
android:textSize="22sp"
android:text="@string/line"
android:textStyle="bold" />
<!-- sebelum garis atas -->
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="3">
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/p_pompa11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/pulau"
android:textSize="22sp" />
<TextView
android:id="@+id/p_pompa12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:textSize="22sp"
android:text="@string/pompa"
android:layout_span="2"
android:layout_weight="1" />
</TableRow>
<!-- baris 3 ; jenis BBM -->
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/jns_bbm11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/produk"
android:textSize="22sp" />
<TextView
android:id="@+id/jns_bbm12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:textSize="22sp"
android:layout_weight="1"
android:layout_span="2" />
</TableRow>
<!-- baris 3 ; harga / liter -->
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/harga_liter11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/harga_l"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:text="@string/rp"
android:textSize="22sp"
android:id="@+id/harga_liter12"
android:layout_weight="1"
android:layout_span="2" />
<TextView
android:id="@+id/harga_liter13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="3"
android:text="@string/tmp"
android:textSize="22sp"
android:paddingRight="66dp"
android:gravity="right" />
</TableRow>
<!-- baris 5 ; liter beli -->
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/ltr_beli11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/ltr_beli"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:text="@string/n1"
android:textSize="22sp"
android:id="@+id/ltr_beli12"
android:layout_span="2"
android:layout_weight="1" />
<TextView
android:id="@+id/ltr_beli13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="3"
android:text="@string/tmp"
android:textSize="22sp"
android:paddingRight="66dp"
android:gravity="right" />
</TableRow>
<!-- baris 6 ; jumlah bayar -->
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/rp_beli11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="@string/rp_beli"
android:textSize="22sp" />
<TextView
android:id="@+id/rp_beli12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:text="@string/rp"
android:textSize="22sp"
android:layout_span="2"
android:layout_weight="1" />
<TextView
android:id="@+id/rp_beli13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="3"
android:text="@string/tmp"
android:textSize="21sp"
android:layout_weight="1"
android:paddingRight="66dp"
android:gravity="right" />
</TableRow>
<!-- baris 7 ; FOOTER -->
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="12dp"
android:layout_span="3"
android:layout_weight="1"
android:textSize="22sp"
android:text="@string/line"
android:textStyle="bold"
android:id="@+id/btm_line1"
android:layout_column="1" />
</TableRow>
<TableRow
android:paddingBottom="15dp"
android:layout_width="match_parent">
<TextView
android:id="@+id/f00ter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="22sp"
android:layout_span="3"
android:layout_weight="1"
android:text="@string/footer"
android:gravity="center_horizontal"
android:layout_column="1" />
</TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/linearLayout"
android:gravity="center_horizontal"
android:layout_alignParentBottom="true" >
<Button
android:id="@+id/btn_back"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btn_back" />
<Button
android:id="@+id/btn_simpan_jpg"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btn_jpeg" />
<Button
android:id="@+id/btn_print"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btn_print" />
</LinearLayout>
</RelativeLayout>
struk1.java
Spoiler Struk1.java:
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v4.print.PrintHelper;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
public class Struk1 extends Activity {
Typeface face_txt;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.struk1);
Intent intent = getIntent();
String ID = intent.getStringExtra("ID");
String header = intent.getStringExtra("header");
String tgl_jam = intent.getStringExtra("tgl_jam");
String no_nota = intent.getStringExtra("no_nota");
String BBM = intent.getStringExtra("BBM");
String harga = intent.getStringExtra("harga");
String rp_beli = intent.getStringExtra("rp_beli");
String ltr_beli = intent.getStringExtra("ltr_beli");
String f00ter = intent.getStringExtra("f00ter");
face_txt = Typeface.createFromAsset(getAssets(), "fonts/telidon_hv.ttf");
TextView tvID_SPBU1 = (TextView) findViewById(R.id.id_spbu1);
tvID_SPBU1.setTypeface(face_txt);
tvID_SPBU1.setText(ID);
TextView tvHeader1 = (TextView) findViewById(R.id.header1);
tvHeader1.setTypeface(face_txt);
tvHeader1.setText(header);
TextView tvShift1 = (TextView) findViewById(R.id.shift1);
tvShift1.setTypeface(face_txt);
tvShift1.setText("Shift: 1 No. Trans.: "+no_nota);
TextView tvTglJam1= (TextView) findViewById(R.id.tgl_jam1);
tvTglJam1.setTypeface(face_txt);
tvTglJam1.setText("Waktu: "+tgl_jam);
TextView no_pp11 = (TextView) findViewById(R.id.p_pompa11);
no_pp11.setTypeface(face_txt);
TextView no_pp12 = (TextView) findViewById(R.id.p_pompa12);
no_pp12.setTypeface(face_txt);
TextView jns_bbm0 = (TextView) findViewById(R.id.jns_bbm11);
jns_bbm0.setTypeface(face_txt);
TextView tvJnsBBM1= (TextView) findViewById(R.id.jns_bbm12);
tvJnsBBM1.setTypeface(face_txt);
tvJnsBBM1.setText(" : "+BBM);
TextView hl11 = (TextView) findViewById(R.id.harga_liter11);
hl11.setTypeface(face_txt);
TextView hl12 = (TextView) findViewById(R.id.harga_liter12);
hl12.setTypeface(face_txt);
TextView tvHLiter1= (TextView) findViewById(R.id.harga_liter13);
tvHLiter1.setTypeface(face_txt);
tvHLiter1.setText(harga);
TextView lb11 = (TextView) findViewById(R.id.ltr_beli11);
lb11.setTypeface(face_txt);
TextView lb12 = (TextView) findViewById(R.id.ltr_beli12);
lb12.setTypeface(face_txt);
TextView tvLtrBeli1= (TextView) findViewById(R.id.ltr_beli13);
tvLtrBeli1.setTypeface(face_txt);
tvLtrBeli1.setText(ltr_beli);
TextView rb11 = (TextView) findViewById(R.id.rp_beli11);
rb11.setTypeface(face_txt);
TextView rb12 = (TextView) findViewById(R.id.rp_beli12);
rb12.setTypeface(face_txt);
TextView tvRpBeli1= (TextView) findViewById(R.id.rp_beli13);
tvRpBeli1.setTypeface(face_txt);
tvRpBeli1.setText(rp_beli);
TextView tvBtmLine= (TextView) findViewById(R.id.btm_line1);
tvBtmLine.setTypeface(face_txt);
TextView tvFooter1 = (TextView) findViewById(R.id.f00ter);
tvFooter1.setTypeface(face_txt);
tvFooter1.setText(f00ter);
Button btnBack = (Button)findViewById(R.id.btn_back);
btnBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
Button btnPrint = (Button) findViewById(R.id.btn_print);
btnPrint.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
View u = findViewById(R.id.sv_id1);
ScrollView z = (ScrollView) findViewById(R.id.sv_id1);
Bitmap bitmap = takeScreenShot(u, z);
PrintHelper printHelper = new PrintHelper(Struk1.this);
printHelper.setScaleMode(PrintHelper.SCALE_MODE_FIT);
printHelper.printBitmap("Print Bitmap", bitmap);
}
});
Button btn_jpeg = (Button) findViewById(R.id.btn_simpan_jpg);
btn_jpeg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
View u = findViewById(R.id.sv_id1);
ScrollView z = (ScrollView) findViewById(R.id.sv_id1);
Bitmap bitmap = takeScreenShot(u, z);
String sss = myU.simpanBitmap(bitmap);
Toast.makeText(Struk1.this, sss, Toast.LENGTH_SHORT).show();
}
});
}
public Bitmap takeScreenShot(View u, ScrollView z) {
int totalHeight = z.getChildAt(0).getHeight();
int totalWidth = z.getChildAt(0).getWidth();
Bitmap returnedBitmap = Bitmap.createBitmap(totalWidth,totalHeight , Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(returnedBitmap);
Drawable bgDrawable = u.getBackground();
if (bgDrawable != null) bgDrawable.draw(canvas);
else canvas.drawColor(Color.WHITE);
u.draw(canvas);
return returnedBitmap;
}
public String simpanBitmap(Bitmap b){
// siapin nama file
File folder = new File(Environment.getExternalStorageDirectory() + "/StrukSPBU57mm");
if (!folder.exists()) folder.mkdir();
final Calendar c = Calendar.getInstance();
String new_Date = c.get(Calendar.DAY_OF_MONTH) + "-" + ((c.get(Calendar.MONTH)) + 1) + "-"
+ c.get(Calendar.YEAR) + " " + c.get(Calendar.HOUR) + "-"
+ c.get(Calendar.MINUTE) + "-" + c.get(Calendar.SECOND);
String path = String.format(Environment.getExternalStorageDirectory() + "/StrukSPBU57mm/%s.png", new_Date);
File f_struk = new File(path);
//Save bitmap
String string = "";
FileOutputStream fos = null;
try {
fos = new FileOutputStream(f_struk);
b.compress(Bitmap.CompressFormat.PNG, 100, fos);
fos.flush();
fos.close();
string = "disimpan: "+path;
} catch (FileNotFoundException e) {
string = "Error: FileNotFound Exception";
} catch (IOException e) {
string = "Error: IO Exception";
}
return string;
}
}
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v4.print.PrintHelper;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
public class Struk1 extends Activity {
Typeface face_txt;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.struk1);
Intent intent = getIntent();
String ID = intent.getStringExtra("ID");
String header = intent.getStringExtra("header");
String tgl_jam = intent.getStringExtra("tgl_jam");
String no_nota = intent.getStringExtra("no_nota");
String BBM = intent.getStringExtra("BBM");
String harga = intent.getStringExtra("harga");
String rp_beli = intent.getStringExtra("rp_beli");
String ltr_beli = intent.getStringExtra("ltr_beli");
String f00ter = intent.getStringExtra("f00ter");
face_txt = Typeface.createFromAsset(getAssets(), "fonts/telidon_hv.ttf");
TextView tvID_SPBU1 = (TextView) findViewById(R.id.id_spbu1);
tvID_SPBU1.setTypeface(face_txt);
tvID_SPBU1.setText(ID);
TextView tvHeader1 = (TextView) findViewById(R.id.header1);
tvHeader1.setTypeface(face_txt);
tvHeader1.setText(header);
TextView tvShift1 = (TextView) findViewById(R.id.shift1);
tvShift1.setTypeface(face_txt);
tvShift1.setText("Shift: 1 No. Trans.: "+no_nota);
TextView tvTglJam1= (TextView) findViewById(R.id.tgl_jam1);
tvTglJam1.setTypeface(face_txt);
tvTglJam1.setText("Waktu: "+tgl_jam);
TextView no_pp11 = (TextView) findViewById(R.id.p_pompa11);
no_pp11.setTypeface(face_txt);
TextView no_pp12 = (TextView) findViewById(R.id.p_pompa12);
no_pp12.setTypeface(face_txt);
TextView jns_bbm0 = (TextView) findViewById(R.id.jns_bbm11);
jns_bbm0.setTypeface(face_txt);
TextView tvJnsBBM1= (TextView) findViewById(R.id.jns_bbm12);
tvJnsBBM1.setTypeface(face_txt);
tvJnsBBM1.setText(" : "+BBM);
TextView hl11 = (TextView) findViewById(R.id.harga_liter11);
hl11.setTypeface(face_txt);
TextView hl12 = (TextView) findViewById(R.id.harga_liter12);
hl12.setTypeface(face_txt);
TextView tvHLiter1= (TextView) findViewById(R.id.harga_liter13);
tvHLiter1.setTypeface(face_txt);
tvHLiter1.setText(harga);
TextView lb11 = (TextView) findViewById(R.id.ltr_beli11);
lb11.setTypeface(face_txt);
TextView lb12 = (TextView) findViewById(R.id.ltr_beli12);
lb12.setTypeface(face_txt);
TextView tvLtrBeli1= (TextView) findViewById(R.id.ltr_beli13);
tvLtrBeli1.setTypeface(face_txt);
tvLtrBeli1.setText(ltr_beli);
TextView rb11 = (TextView) findViewById(R.id.rp_beli11);
rb11.setTypeface(face_txt);
TextView rb12 = (TextView) findViewById(R.id.rp_beli12);
rb12.setTypeface(face_txt);
TextView tvRpBeli1= (TextView) findViewById(R.id.rp_beli13);
tvRpBeli1.setTypeface(face_txt);
tvRpBeli1.setText(rp_beli);
TextView tvBtmLine= (TextView) findViewById(R.id.btm_line1);
tvBtmLine.setTypeface(face_txt);
TextView tvFooter1 = (TextView) findViewById(R.id.f00ter);
tvFooter1.setTypeface(face_txt);
tvFooter1.setText(f00ter);
Button btnBack = (Button)findViewById(R.id.btn_back);
btnBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
Button btnPrint = (Button) findViewById(R.id.btn_print);
btnPrint.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
View u = findViewById(R.id.sv_id1);
ScrollView z = (ScrollView) findViewById(R.id.sv_id1);
Bitmap bitmap = takeScreenShot(u, z);
PrintHelper printHelper = new PrintHelper(Struk1.this);
printHelper.setScaleMode(PrintHelper.SCALE_MODE_FIT);
printHelper.printBitmap("Print Bitmap", bitmap);
}
});
Button btn_jpeg = (Button) findViewById(R.id.btn_simpan_jpg);
btn_jpeg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
View u = findViewById(R.id.sv_id1);
ScrollView z = (ScrollView) findViewById(R.id.sv_id1);
Bitmap bitmap = takeScreenShot(u, z);
String sss = myU.simpanBitmap(bitmap);
Toast.makeText(Struk1.this, sss, Toast.LENGTH_SHORT).show();
}
});
}
public Bitmap takeScreenShot(View u, ScrollView z) {
int totalHeight = z.getChildAt(0).getHeight();
int totalWidth = z.getChildAt(0).getWidth();
Bitmap returnedBitmap = Bitmap.createBitmap(totalWidth,totalHeight , Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(returnedBitmap);
Drawable bgDrawable = u.getBackground();
if (bgDrawable != null) bgDrawable.draw(canvas);
else canvas.drawColor(Color.WHITE);
u.draw(canvas);
return returnedBitmap;
}
public String simpanBitmap(Bitmap b){
// siapin nama file
File folder = new File(Environment.getExternalStorageDirectory() + "/StrukSPBU57mm");
if (!folder.exists()) folder.mkdir();
final Calendar c = Calendar.getInstance();
String new_Date = c.get(Calendar.DAY_OF_MONTH) + "-" + ((c.get(Calendar.MONTH)) + 1) + "-"
+ c.get(Calendar.YEAR) + " " + c.get(Calendar.HOUR) + "-"
+ c.get(Calendar.MINUTE) + "-" + c.get(Calendar.SECOND);
String path = String.format(Environment.getExternalStorageDirectory() + "/StrukSPBU57mm/%s.png", new_Date);
File f_struk = new File(path);
//Save bitmap
String string = "";
FileOutputStream fos = null;
try {
fos = new FileOutputStream(f_struk);
b.compress(Bitmap.CompressFormat.PNG, 100, fos);
fos.flush();
fos.close();
string = "disimpan: "+path;
} catch (FileNotFoundException e) {
string = "Error: FileNotFound Exception";
} catch (IOException e) {
string = "Error: IO Exception";
}
return string;
}
}
ini Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.munengan7camp.strukspbu"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="14" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Struk1"
android:label="@string/app_name">
<intent-filter >
<action android:name="com.munengan7camp.strukspbu.Struk1"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.munengan7camp.strukspbu"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="14" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Struk1"
android:label="@string/app_name">
<intent-filter >
<action android:name="com.munengan7camp.strukspbu.Struk1"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
</manifest>
File lain : menu.xml dan strings.xml dibuat sendiri aja [kalo mau nyoba mbuat]
[update link 2 juli 2017 via mediafire]
mantap mas.
ReplyDeleteTerimakasih banyak mas, walau masih belum semprna dibagian bulannya loncat 1 bulan dan di bagian No transaksi ny gak keluar di struk. Di tunggu update tan ny.
ReplyDeleteTerimakasih banyak mas, walau masih belum semprna dibagian bulannya loncat 1 bulan dan di bagian No transaksi ny gak keluar di struk. Di tunggu update tan ny.
ReplyDeletesaya udh download tapi kok kaga muncul yah
DeleteBelum ada update ny lagi ya om?
ReplyDeleteTerimakasih banyak mas bermanfaat banget, pekerjaan saya sebagai kurir di kantor Pos, jadi minder juga kalau tiap hari minta struk ke SPBU buat laporan, belum lagi kalau billing di SPBUnya lg error, padahal belinya ga seberapa cuma jatah 2 liter/hari dari kantor. Kalau bisa minta tutorial edit yang versi windowsnya buat ukuran 57 dan cara edit jarak dari kiri kertas mas, soalnya pas total harga suka kepotong satu digit, saya pakai printer thermal QPOS Q58M.
ReplyDeleteTerima Kasih
Mas, koq aku susah ya mo donlot di 4share, udah pasang ucnews tp ga bisa donlot apk nya, gimana cara donlotnya...terima kasih
ReplyDeleteTernyata harus pasang uc browser baru bisa donlot,ada usulan dikit mas, saya sudah invite bbm nya ya, terima kasih buat mas dewo dan bapake diah....
ReplyDeletePas mencari printernya nggk ketemu" ya om..?? Saya udah instal drivernya pke smart printer.. Tpi pas mau cetak struk mencari terus printernya
ReplyDeletePdf aja dulu gan
DeleteKirim ke kompi yg ada printer nya
Trus berkarya mas
ReplyDeletemohon info, karena saat digunakan untuk garis lurus tidak bisa..dan tidak keluar kop gambar pertamina diatas..mohon saran dan masukan??
ReplyDeleteMohon untuk nomor struk dan nomer selang bisa dirubah...
ReplyDelete#majuterus
Mas minta updatenya yg versi APKnya..soalnya kepotong mas untuk harga dan liternya..
ReplyDeletelom sempet ngoprek yg ini
Deletekalo agan bisa ngoding, edit aja source-nya
Ane kurang paham gan...
DeleteBulanny kok beda saat kita ketik sama saat Kira print..??
ReplyDeleteBlm ada solusi ya mas.. mau ngedit soalny ga tau carany...
om untuk nomor selang belum bisa dirubah??
ReplyDeleteklo bisa ditambahkan nama operator dibagian bawah..!!
ditunggu update nya gan.. bulannya loncat mundur 1 bulan
ReplyDeleteMas,hari berbeda dengan tanggal, dan bulan masih selisih.tolong update yg terbaru mas
ReplyDeleteSuwun
Blm bisa cetak d hp ya gan?
ReplyDeleteMaaf semua, dah lama gak ngulik ini lg
ReplyDeleteKalo ada yg bisa, sila oprek sc nya
Update tanya om...
ReplyDeleteOm kalo bisa dikasih plat no dan km
ReplyDeleteUntuk yang lompat bulan sebelum cetak pilih format tanggal pilih yang paling bawah
ReplyDeleteDownload apk nya gimana ya
ReplyDeletegan ajarin cara edit coding nya ...
ReplyDeletegan tolong dong biyar no pompa sama no selang nya bisa di ganti"tank's
ReplyDeletesekarang kok dah ga bisa dipake
ReplyDeleteg bisa d pake hadeuuuh...
ReplyDeleteMas ko aplikasinya saat udah mau dinprint malah gak bisa yah dan tulisan nya maaf aplikasi yerhenti
ReplyDeleteBang boleh minta wa
ReplyDeleteGan... tolong tambahin kolom no pol dan odometernya dung... please..
ReplyDeleteGan.. .no wa nya donk
ReplyDeleteUpdate lg
ReplyDeletegan wa ny
ReplyDelete