Uzi maalumu kwa ajili ya kujifunza namna ya kutengeneza Android Apps


Babarazack

Babarazack

Member
Joined
Sep 9, 2015
Messages
39
Likes
32
Points
25
Babarazack

Babarazack

Member
Joined Sep 9, 2015
39 32 25
Jamani naomba msaada Ku unlock modem nimekosea codes mara 10 sasa inaandika 0 attempt je itawezekana kui unlock? Kama inawezekana nifanyeje?
img_20181015_205644_811-jpg.904607
 
Babarazack

Babarazack

Member
Joined
Sep 9, 2015
Messages
39
Likes
32
Points
25
Babarazack

Babarazack

Member
Joined Sep 9, 2015
39 32 25
Tatizo kubwa sikuwa najua ni code zipi nilitakiwa kuziingiza baada ya kuweka line ya mtandao mwingine na kuni command niingize sim lock
screenshot_2018-10-14-18-34-53-jpeg.904614
 
mwaminifuhalisi

mwaminifuhalisi

JF-Expert Member
Joined
Feb 26, 2017
Messages
323
Likes
290
Points
80
mwaminifuhalisi

mwaminifuhalisi

JF-Expert Member
Joined Feb 26, 2017
323 290 80
Je hii modem ulikuwa unaifungulia kwa kutumia browser? Na ni huawei?

Kama ni hivyo kwanza modem inabidi uibadili kutoka webui ili com ports zionekane kwenye device manager.

Baada ya hapo tafuta firmware ya modem yako kulingana na model number.
 
mwaminifuhalisi

mwaminifuhalisi

JF-Expert Member
Joined
Feb 26, 2017
Messages
323
Likes
290
Points
80
mwaminifuhalisi

mwaminifuhalisi

JF-Expert Member
Joined Feb 26, 2017
323 290 80
AUDIO PLAYER APP ADDITIONAL FEATURES II​
Kwenye sehemu iliyopita tuliweza kutengeneza UI(User Interface) kwa kutumia class ya ListView ambayo hupatikana tu ukidrag.

Kwenye post hii tunaenda kuandika java code kwa ajili ya kupata na ku-play audi files yoyote ambayo ipo storage ya simu yako.

Kabla ya yote kuna kimoja cha muhimu sana ambacho unapaswa kuongeza kwenye manifest file.

Kitu hicho ni kuomba ruhusa permission ya ku-access mafile ya audio yaliyo ndani ya simu yako kwa kufanya yafuatayo, bila kufanya haya audio player app yako haitoweza kuplay.

  1. kwenye android studio upande wa kushoto bonyeza sehemu iliyoandikwa app.
  2. Kisha bonyeza folder lilliloandikwa manifest.
  3. bonyeza manifest file na kisha ongeza xml code ifuatayo.
  4. Code:
    <uses-permission name="android.permission.READ_EXTERNAL_STORAGE"/>
Sasa teyari tumeshaomba ruhusa ya kutumia mafile ya audio kutoka kwenye storage kitu kinachofuata ni kuandika java code kumbuka usisahau kuandika code niliyoweka hapo juu bila hivyo app haitofanya lolote.

kutokana na urefu wa code nitaindika kwenye post inayofuata tuwe pamoja.
 
mwaminifuhalisi

mwaminifuhalisi

JF-Expert Member
Joined
Feb 26, 2017
Messages
323
Likes
290
Points
80
mwaminifuhalisi

mwaminifuhalisi

JF-Expert Member
Joined Feb 26, 2017
323 290 80
AUDIO PLAYER APP ADDITIONAL FEATURES II
Code yetu inaenda kuhusika kwenye kufanya yafuatayo, kwanza inabidi tuielekeze audio application yetu iombe permission endapo android smartphone itakuwa na restriction.

Pili tunaenda ku-declare database, ambapo hapa tutaimploy Cursor kwa sababu ndio huwa mara nyingi inatumika ku-query data kutoka kwenye storage.

kwa kutumia Cursor object tutaweza kupata index za kila columns halafu baadae itatupa string za aina ya taarifa tunayohitaji zinazohusiaba na audio,

Lakini ii uweze kuplay audio file pia utahitajika kutumia class ya MediaPlayer na bila kusahau MediaStore kwa ajili ya storage

na mambo mengine ambayo ambayo nitafafanua kwenye code.

1. import class zifuatazo, japo zingine zinakuwepo pindi ukitengeneza projects.
Code:
import android.Manifest;
import android.content.ContentResolver;
import android.content.pm.PackageManager;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.app.ListActivity;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import java.util.ArrayList;
Baada ni kuset muonekano wa awali pindi mtumiaji akifungua app ya audio.
Code:
public class MainActivity extends AppCompatActivity{
//container tutakayoitumia kuhifadhi data tutakazokipata kutoka kwenye audio file
    ArrayList<String> myarraylist;

//ArrayAdapter inahusika na kuchukua kutoka kwenye arrayList na kisha kuziweka kwenye ListViews
    ArrayAdapter<String> adapter;

//Listview ndio muonekano wa kwenye screen yetu, itachukua data toka ArrayAdapter na kuziweka kwenye screen ya simu.
    ListView mylistVies;

    String AudioLink;
    Cursor audioCursor;
    public static final int REQUEST_PERMISSION=1;
kama nilivyosema, tunaset muonekano wa awali wa app na pia tutaindika codes za kuomba permissions pindi tu mtumiaji akiifungua audio player tunayoitengeneza.
Code:
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

//Hapa tunacheki iwapo device haikutoa ruhusa ya ku-access storage ya simu
        if(ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE)
                != PackageManager.PERMISSION_GRANTED){

//Hapa tunachecki iwapo device inatoa uwanda wa kuomba tunachohitaji ku-access            if(ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this,Manifest.permission.READ_EXTERNAL_STORAGE))
            {
//hapa tunaomba tunachokihitaji ku-acess ambacho ni storage.
                ActivityCompat.requestPermissions(MainActivity.this,
                        new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},REQUEST_PERMISSION );
            }else{
                ActivityCompat.requestPermissions(MainActivity.this,
                        new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},REQUEST_PERMISSION );
            }
        }else{
//so iwapo kila kitu kipo sawa, inafanya majukumu yaliyoelekezwa kwenye hii method
            readAudioFiles();
        }
    }
Code:
//hii ni method ya kukuwezesha ku-play file utakalochagua toka kwenye list, classes za hapa nimeelezea mwanzoni
public void readAudioFiles(){
        mylistVies=(ListView)findViewById(R.id.listView);
        myarraylist=new ArrayList<>();
        getAudioFilesData();
        adapter=new ArrayAdapter<>(this,android.R.layout.simple_list_item_1,myarraylist);
        mylistVies.setAdapter(adapter);
        mylistVies.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                MediaPlayer media=new MediaPlayer();
                int positionn=position;
                AudioLink=mylistVies.getItemAtPosition(positionn).toString();
                Uri uri=Uri.parse(AudioLink);
                
                media.setAudioStreamType(AudioManager.STREAM_MUSIC);
                media=MediaPlayer.create(getApplicationContext(),uri);
                media.start();
                   
                
            }
        });
    }
Hii ni method ambayo ina-access taarifa za file kwa kutumia cursor na kisha baada zinahifadhiwa kwenye ArrayList
Code:
public void getAudioFilesData(){
        ContentResolver audioContentResolver=getContentResolver();
        Uri audioUri=MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
        audioCursor=audioContentResolver.query(audioUri,null,null,null,null);
        if(audioCursor!=null && audioCursor.moveToFirst()){
            int AudioTitles=audioCursor.getColumnIndex(MediaStore.Audio.Media.TITLE);
            int AudioMusician=audioCursor.getColumnIndex(MediaStore.Audio.Media.ARTIST);
            int Links=audioCursor.getColumnIndex(MediaStore.Audio.Media.DATA);
            do {
                String currenTitle=audioCursor.getString(AudioTitles);
                String currenMusician=audioCursor.getString(AudioMusician);
                AudioLink=audioCursor.getString(Links);
                myarraylist.add(currenTitle+"\n"+currenMusician+"\n"+AudioLink);

            }while (audioCursor.moveToNext());
        }

    }
Vitu vya msingi tumeshamaliza, tunataka kucheki iwapo tutapata au hatutopata permission ya ku-access audio file ituletee meseji, hivyo method ya hapa chini inaweza fanya hilo.
Code:
@Override
    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        switch (requestCode){
            case REQUEST_PERMISSION:
                if(grantResults.length>0&&grantResults[0]==PackageManager.PERMISSION_GRANTED){
                    getAudioFilesData();
                    Toast.makeText(this,"Permission",Toast.LENGTH_LONG).show();
                }else{
                    Toast.makeText(this,"not permitted",Toast.LENGTH_LONG).show();
                }
        }
    }
}
Tayari tumekamilisha audioplayer app yetu, unaweza kuongezea vitu kama icon launcher yako unayohitaji ambayo tuligusia kwenye post zilizopita.

Kama utakwama niulize, na kama hujaelewa baadhi ya sehemu unaweza fanya hivyo. vinginevyo tayari una basics ideas ya jinsi ya kuunda audio app, na unaweza ukasoma zaidi na kutengeneza complex audio app.

Application itakayofuata chatting application mfano wa whatsapp, iwapo utazama zaidi ya nitakachokitoa hapa utakuwa na uwezo wa kuunda whatsapp yako mwenyewe japo tunachoelekezana hapa sio complex kihivyo ila walau tunapata mwangaza jinsi vitu vinavyofanyika.

Tuonane Wakati ujao Mungu akijaalia.
 
University_Promo

University_Promo

Senior Member
Joined
Sep 29, 2018
Messages
189
Likes
160
Points
60
University_Promo

University_Promo

Senior Member
Joined Sep 29, 2018
189 160 60
AUDIO PLAYER APP ADDITIONAL FEATURES II
Code yetu inaenda kuhusika kwenye kufanya yafuatayo, kwanza inabidi tuielekeze audio application yetu iombe permission endapo android smartphone itakuwa na restriction.

Pili tunaenda ku-declare database, ambapo hapa tutaimploy Cursor kwa sababu ndio huwa mara nyingi inatumika ku-query data kutoka kwenye storage.

kwa kutumia Cursor object tutaweza kupata index za kila columns halafu baadae itatupa string za aina ya taarifa tunayohitaji zinazohusiaba na audio,

Lakini ii uweze kuplay audio file pia utahitajika kutumia class ya MediaPlayer na bila kusahau MediaStore kwa ajili ya storage

na mambo mengine ambayo ambayo nitafafanua kwenye code.

1. import class zifuatazo, japo zingine zinakuwepo pindi ukitengeneza projects.
Code:
import android.Manifest;
import android.content.ContentResolver;
import android.content.pm.PackageManager;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.app.ListActivity;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import java.util.ArrayList;
Baada ni kuset muonekano wa awali pindi mtumiaji akifungua app ya audio.
Code:
public class MainActivity extends AppCompatActivity{
//container tutakayoitumia kuhifadhi data tutakazokipata kutoka kwenye audio file
    ArrayList<String> myarraylist;

//ArrayAdapter inahusika na kuchukua kutoka kwenye arrayList na kisha kuziweka kwenye ListViews
    ArrayAdapter<String> adapter;

//Listview ndio muonekano wa kwenye screen yetu, itachukua data toka ArrayAdapter na kuziweka kwenye screen ya simu.
    ListView mylistVies;

    String AudioLink;
    Cursor audioCursor;
    public static final int REQUEST_PERMISSION=1;
kama nilivyosema, tunaset muonekano wa awali wa app na pia tutaindika codes za kuomba permissions pindi tu mtumiaji akiifungua audio player tunayoitengeneza.
Code:
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

//Hapa tunacheki iwapo device haikutoa ruhusa ya ku-access storage ya simu
        if(ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE)
                != PackageManager.PERMISSION_GRANTED){

//Hapa tunachecki iwapo device inatoa uwanda wa kuomba tunachohitaji ku-access            if(ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this,Manifest.permission.READ_EXTERNAL_STORAGE))
            {
//hapa tunaomba tunachokihitaji ku-acess ambacho ni storage.
                ActivityCompat.requestPermissions(MainActivity.this,
                        new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},REQUEST_PERMISSION );
            }else{
                ActivityCompat.requestPermissions(MainActivity.this,
                        new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},REQUEST_PERMISSION );
            }
        }else{
//so iwapo kila kitu kipo sawa, inafanya majukumu yaliyoelekezwa kwenye hii method
            readAudioFiles();
        }
    }
Code:
//hii ni method ya kukuwezesha ku-play file utakalochagua toka kwenye list, classes za hapa nimeelezea mwanzoni
public void readAudioFiles(){
        mylistVies=(ListView)findViewById(R.id.listView);
        myarraylist=new ArrayList<>();
        getAudioFilesData();
        adapter=new ArrayAdapter<>(this,android.R.layout.simple_list_item_1,myarraylist);
        mylistVies.setAdapter(adapter);
        mylistVies.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                MediaPlayer media=new MediaPlayer();
                int positionn=position;
                AudioLink=mylistVies.getItemAtPosition(positionn).toString();
                Uri uri=Uri.parse(AudioLink);
                
                media.setAudioStreamType(AudioManager.STREAM_MUSIC);
                media=MediaPlayer.create(getApplicationContext(),uri);
                media.start();
                   
                
            }
        });
    }
Hii ni method ambayo ina-access taarifa za file kwa kutumia cursor na kisha baada zinahifadhiwa kwenye ArrayList
Code:
public void getAudioFilesData(){
        ContentResolver audioContentResolver=getContentResolver();
        Uri audioUri=MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
        audioCursor=audioContentResolver.query(audioUri,null,null,null,null);
        if(audioCursor!=null && audioCursor.moveToFirst()){
            int AudioTitles=audioCursor.getColumnIndex(MediaStore.Audio.Media.TITLE);
            int AudioMusician=audioCursor.getColumnIndex(MediaStore.Audio.Media.ARTIST);
            int Links=audioCursor.getColumnIndex(MediaStore.Audio.Media.DATA);
            do {
                String currenTitle=audioCursor.getString(AudioTitles);
                String currenMusician=audioCursor.getString(AudioMusician);
                AudioLink=audioCursor.getString(Links);
                myarraylist.add(currenTitle+"\n"+currenMusician+"\n"+AudioLink);

            }while (audioCursor.moveToNext());
        }

    }
Vitu vya msingi tumeshamaliza, tunataka kucheki iwapo tutapata au hatutopata permission ya ku-access audio file ituletee meseji, hivyo method ya hapa chini inaweza fanya hilo.
Code:
@Override
    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        switch (requestCode){
            case REQUEST_PERMISSION:
                if(grantResults.length>0&&grantResults[0]==PackageManager.PERMISSION_GRANTED){
                    getAudioFilesData();
                    Toast.makeText(this,"Permission",Toast.LENGTH_LONG).show();
                }else{
                    Toast.makeText(this,"not permitted",Toast.LENGTH_LONG).show();
                }
        }
    }
}
Tayari tumekamilisha audioplayer app yetu, unaweza kuongezea vitu kama icon launcher yako unayohitaji ambayo tuligusia kwenye post zilizopita.

Kama utakwama niulize, na kama hujaelewa baadhi ya sehemu unaweza fanya hivyo. vinginevyo tayari una basics ideas ya jinsi ya kuunda audio app, na unaweza ukasoma zaidi na kutengeneza complex audio app.

Application itakayofuata chatting application mfano wa whatsapp, iwapo utazama zaidi ya nitakachokitoa hapa utakuwa na uwezo wa kuunda whatsapp yako mwenyewe japo tunachoelekezana hapa sio complex kihivyo ila walau tunapata mwangaza jinsi vitu vinavyofanyika.

Tuonane Wakati ujao Mungu akijaalia.
Mkuu tunasubiri chatting application kama ya WhatsApp.
 
kansinsi

kansinsi

Member
Joined
Sep 24, 2013
Messages
72
Likes
8
Points
15
kansinsi

kansinsi

Member
Joined Sep 24, 2013
72 8 15
Mkuu Mimi naomba Msaada WA kujua app ipi nzuri tofauti na mobdro ambayo inaonyesha ligi zote za Africa
 
Eck fulani

Eck fulani

JF-Expert Member
Joined
Oct 14, 2014
Messages
443
Likes
516
Points
180
Age
26
Eck fulani

Eck fulani

JF-Expert Member
Joined Oct 14, 2014
443 516 180
ROOT ANDROID 6.0 BILA PC

OI WADAU LEO NIMEWALETEA NJIA RAHISI HII HAPA YA NAMNA YA KUROOT SIMU SUMBUFU NAMAANISHA Android 6.0+

Uzuri wa hii trick hata asiye na PC anaweza ilimradi simu iwe na charge ya kutosha

Sasa fungua link hiyo kuna kila maelekezo

Tech zone: Jinsi ya kuroot android 6.0,6.0.1 version bila PC
.
 

Forum statistics

Threads 1,237,088
Members 475,401
Posts 29,277,870