Kamis, 26 Juli 2018

Service In Background android studio

assalamu'alaikum.

to day i show you. how to run app in background procces

lets do it

in the firs u can start a new project and create activity.java and layout.xml
<?xml version="1.0" encoding="utf-8"?><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:orientation="vertical"    tools:context=".MenuAwal">
<Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="simpanexternal"android:onClick="strservice"/><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="bacaexternal"android:onClick="stopservice"/>
</LinearLayout>

now see in activity.java
public class Activity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);    setContentView(R.layout.layout);
    }
    public void strservice(){
       Intent intent=new Intent(this,ServiceBackground.class);       startService(intent);    }
    public void stopservice(){
       Intent intent=new Intent(this,ServiceBackground.class);       stopService(intent);    }

}


now create a new activity. java  but change the name with ServiceBackground.java
public class ServiceBackground extends Service {
    @Override    public void onCreate() {
       super.onCreate();    }
    @Nullable    @Override    public IBinder onBind(Intent intent) {
       return null;
    }
    @Override    public int onStartCommand(Intent intent, int flags, int startId) {
    Toast.makeText(this, "start service", Toast.LENGTH_SHORT).show();
    return START_STICKY;
    }
    @Nullable    @Override    public IBinder onBind(Intent intent) {
    return null;
    }
    @Override
    public void onDestroy() {
    Toast.makeText(this, "Service Destroy", Toast.LENGTH_SHORT).show();
    }
}

ok its finishing add configuration service in manifest file
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"    package="com.blogspot.programer27android.downloadmode">
<application        android:allowBackup="true"        android:icon="@mipmap/ic_launcher"        android:label="@string/app_name"        android:roundIcon="@mipmap/ic_launcher_round"        android:supportsRtl="true"        android:theme="@style/AppTheme">        <activity android:name=".Activity">            <intent-filter>                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />            </intent-filter>        </activity>        <service android:name=".ServiceBackground"            android:exported="false">        </service>    </application>
</manifest>

now you can try to run your projet..
thanks ..

enjoy your code



Pendaftaran CPNS Tahun 2018 Siap dibuka

Dokumen yang Harus Dipersiapkan untuk S1 atau tenaga profesional antara lain:
1. Fotokopi KTP
2. Fotokopi Ijazah dan Transkip Nilai yang telah dilegalisir
3. Surat keterangan akreditasi dari BAN PT.
4. Pas foto terbaru ukuran 4×6 cm sebanyak 4 lembar – latar belakang merah.
Dokumen tambahan bagi lulusan D III dan SMA/sederajat antara lain:
1. Materai Rp 6.000
2. Fotokopi KTP
3. Fotokopi ijazah/STTB
4. Fotokopi ijazah SD
5. Fotokopi ijazah SLTP
6. Fotokopi ijazah SLTA.
Jangan lupa yang tak kalah pentingnya, Nomor Induk Kependudukan (NIK) dan Kartu Keluarga sudah terdaftar di Disdukcapil.
Langkah penting yang harus Anda lakukan saat ini adalah memastikan NIK dan Kartu Keluarga Anda sudah terdaftar di Dinas Kependudukan dan Catatan Sipil daerah Anda.

mendaftar di link https://sscn.bkn.go.id/
1. melakukan login
2. mendapat bukti daftar akun

3. menyerahkan dokumen berupa pdf
4. cetak kartu peserta




diperkirakan akan dibuka pada bulan agustus 2018. dan segerakan persiapkan diri.
siapkan berkas dan siapkan kekurangannya. juga jangan lupa download kisi-kisi tes cpns

Artikel ini telah tayang di bangkapos.com dengan judul Seleksi CPNS 2018 Dimulai Agustus, Pelajari Kisi-kisi Soalnya dan Unggah Link Berikut Ini, kisi-kisi tes cpns

Editor: gery

how to update playonlinux? || bagaimana update playonlinux di linux mint

open terminal wget -q "http://deb.playonlinux.com/public.gpg" -O - | sudo apt-key add - sudo wget http://deb.playonlinux.com/pla...