主頁 > 移動端開發 > 安卓記事本小程式開發

安卓記事本小程式開發

2020-09-14 16:58:05 移動端開發

這幾天用自己目前掌握的安卓開發知識制作了一個記事本小程式,在這里分享一下開發流程,希望可以幫到和我一樣的初學者,

開發工具為Android studio,后臺語言為java,使用的資料庫為安卓的SQLite資料庫,功能及效果圖如下:

主界面,長按可洗掉:

 

 

 

 

 點擊加號添加:

 

主頁面點擊查看,此頁面含修改和洗掉功能:

 

主要使用的技術:資料存盤使用的資料庫存盤,我之前的博客有講過安卓SQLite的基礎操作;資料的顯示用的是ListView部件,資料傳輸用的是intent技術,頁面間的跳轉也是借助intent;主頁點擊某一行,就通過intent傳遞其id到查看頁,并根據id從資料庫中讀取資料進行顯示,洗掉也是根據id進行資料庫操作,

整個專案檔案已經同步到github需要的請自取https://github.com/liuleliu/textbook

下面是主要代碼:

資料庫輔助類:

package com.example.myapplication;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class DataBaseHelp extends SQLiteOpenHelper{
    private static final String DATABASENAME ="tip1";//資料庫名稱
    private static final int DATABASEVERSION =1;//資料庫版本
    private static final String TABLENAME="tip1";//表名
    public DataBaseHelp(Context context)//定義構造
    {
    super(context,DATABASENAME,null,DATABASEVERSION);    //呼叫父類構造
    }
    public void onCreate(SQLiteDatabase db)
    {
        String sql="CREATE TABLE "+TABLENAME+"("+
                "id   INTEGER PRIMARY KEY AUTOINCREMENT,"+                   //設定自動增長列
                "name  VARCHAR(50) NOT NULL,"+
                "text  VARCHAR(50) NOT NULL)";
    db.execSQL(sql);    //執行sql陳述句
    }
    public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion)
    {
        String sql="DROP TABLE IF EXISTS "+TABLENAME;
        db.execSQL(sql);
        this.onCreate(db);//創建表

    }
}

  操作類

package com.example.myapplication;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class OperateTable {
    private static final String TABLENAME ="tip1";
    private SQLiteDatabase db=null;
    public OperateTable(SQLiteDatabase db)
    {
        this.db=db;
    }
    public void insert(String name,String text)
    {
        String sql="INSERT INTO "+TABLENAME+" (name,text) VALUES ('"+name+"','"+text+"')";
        this.db.execSQL(sql);


    }
    public void delete(String id)
    {
        String sql="DELETE FROM "+TABLENAME+" WHERE id='"+id+"'";
        this.db.execSQL(sql);


    }
    public void updata(String id,String name,String text)
    {
        String sql="UPDATE "+TABLENAME+" SET name ='"+name+"',text='"+text+"' WHERE id='"+id+"'";
        this.db.execSQL(sql);
    }
    public List<Map<String,Object>> getdata()
    {List<Map<String,Object>>list=new ArrayList<Map<String,Object>>();
        Map<String,Object> map=new HashMap<String,Object>();

        String sql="SELECT id,name,text FROM "+TABLENAME;
        Cursor result =this.db.rawQuery(sql,null);
        for(result.moveToFirst();!result.isAfterLast();result.moveToNext())
        {
            map=new HashMap<String,Object>();
            map.put("id",result.getInt(0));
            map.put("tt",result.getString(1));
            list.add(map);
        }
        return  list;}
        public tip t(String id)
        {
            tip t=new tip();

            String sql="SELECT name,text FROM "+TABLENAME+" WHERE id ='"+id+"'";
            Cursor result =this.db.rawQuery(sql,null);
            result.moveToFirst();
            t.setName(result.getString(0));
            t.setText(result.getString(1));
            return t;
        }
}

  

主頁的資料顯示以及互動涉及到了ListView的使用

資料的更新要多載onResume()函式來實作

布局:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:id="@+id/linearLayout2"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/add"
        android:layout_width="59dp"
        android:layout_height="57dp"
        android:layout_marginEnd="28dp"
        android:clickable="true"
        app:backgroundTint="#2894FF"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.807"
        app:srcCompat="@android:drawable/ic_input_add" />

    <ListView
        android:id="@+id/vi"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_marginBottom="389dp"
        app:layout_constraintBottom_toTopOf="@+id/add"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.034"></ListView>

</androidx.constraintlayout.widget.ConstraintLayout>

  下面這個是每一行的布局

    <TextView
        android:id="@+id/id"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="39dp"
        android:layout_marginBottom="24dp"
        android:text="TextView"
        android:textColor="#00000000"
        app:layout_constraintBottom_toBottomOf="@+id/pic"
        app:layout_constraintStart_toStartOf="parent" />

    <ImageView
        android:id="@+id/pic"
        android:layout_width="142dp"
        android:layout_height="101dp"
        android:src="https://www.cnblogs.com/liuleliu/p/@mipmap/ic_launcher_round"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

  然后是在主類中的操作,為ListView賦值,設定互動事件(單機,長按)

package com.example.myapplication;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;

import android.content.DialogInterface;
import android.content.Intent;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;

import com.google.android.material.floatingactionbutton.FloatingActionButton;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MainActivity extends AppCompatActivity {
private OperateTable mytable =null;
private SQLiteOpenHelper helper=null;
private FloatingActionButton add=null;
private String info=null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        helper=new DataBaseHelp(this);
        helper.getWritableDatabase();
        MainActivity.this.mytable=new OperateTable(MainActivity.this.helper.getWritableDatabase());


        SimpleAdapter adapter = new SimpleAdapter(this,this.mytable.getdata(), R.layout.activity_main
                , new String[]{"id","tt"},
                new int[]{R.id.id,R.id.tt});
        ListView listView=(ListView)findViewById(R.id.vi);
        add=(FloatingActionButton)findViewById(R.id.add);
listView.setAdapter(adapter);
listView.setOnItemClickListener(new OnItemClick());//注冊單擊監聽
listView.setOnItemLongClickListener(new OnItemLongClick());//注冊長按監聽
add.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        Intent it=new Intent(MainActivity.this,add.class);
        MainActivity.this.startActivity(it);
    }
});
    }
   
    private class OnItemClick implements AdapterView.OnItemClickListener
    { public void onItemClick(AdapterView<?>arg0, View arg1, int arg2, long arg3){
        ListView list = (ListView) findViewById(R.id.vi);
        HashMap<String,Object> map=(HashMap<String,Object>)list.getItemAtPosition(arg2);

        info=map.get("id").toString();
        Intent it=new Intent(MainActivity.this,receive.class);
        it.putExtra("info",info);//傳輸資料到receive
        MainActivity.this.startActivity(it);



    }



    }
    private class OnItemLongClick implements AdapterView.OnItemLongClickListener
    {
        public boolean onItemLongClick(AdapterView<?>arg0, View arg1, int arg2, long arg3){

            ListView list = (ListView) findViewById(R.id.vi);
            HashMap<String,Object> map=(HashMap<String,Object>)list.getItemAtPosition(arg2);
            String name;
            info=map.get("id").toString();
            name=map.get("tt").toString();
            AlertDialog myAlertDialog = new AlertDialog.Builder(MainActivity.this)
                    .setTitle("確認" )
                    .setMessage("確定洗掉“"+name+"”嗎?" )
                    .setPositiveButton("是" , new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int whichButton) {
                            mytable.delete(info);
                            Toast.makeText(getApplicationContext(),"洗掉成功",Toast.LENGTH_SHORT).show();
                            onResume();
                        }
                    })
                    .setNegativeButton("否" , null)
                    .show();

            return true;


        }

    }

//每次回到主頁就會執行,用于更新資料
    public void onResume() {
        super.onResume();  // Always call the superclass method first

        SimpleAdapter adapter = new SimpleAdapter(this,MainActivity.this.mytable.getdata(), R.layout.activity_main
                , new String[]{"id","tt"},
                new int[]{R.id.id,R.id.tt});
        ListView listView=(ListView)findViewById(R.id.vi);
        add=(FloatingActionButton)findViewById(R.id.add);
        listView.setAdapter(adapter);
        listView.setOnItemClickListener(new OnItemClick());
        add.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent it=new Intent(MainActivity.this,add.class);
                MainActivity.this.startActivity(it);
            }
        });
    }

}

  

添加比較簡單,就是獲取資料并呼叫資料庫操作保存資料

布局

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:id="@+id/linearLayout3"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <EditText
        android:id="@+id/aname"
        android:layout_width="283dp"
        android:layout_height="0dp"
        android:layout_marginStart="60dp"
        android:layout_marginTop="26dp"
        android:layout_marginBottom="461dp"
        android:hint="標題"
        android:maxLines="1"
        android:maxLength="25"
        app:layout_constraintBottom_toTopOf="@+id/save"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"></EditText>

    <EditText
        android:id="@+id/atext"
        android:layout_width="335dp"
        android:layout_height="426dp"
        android:layout_marginStart="43dp"
        android:layout_marginBottom="84dp"
        android:hint="內容"
        android:minLines="5"
        android:gravity="top"
        android:background="@null"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/aname"></EditText>

    <Button
        android:id="@+id/save"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="17dp"
        android:text="保存"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="@+id/atext"
        app:layout_constraintTop_toBottomOf="@+id/aname" />

</androidx.constraintlayout.widget.ConstraintLayout>

  

活動類

package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;

import android.database.sqlite.SQLiteOpenHelper;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;


import android.widget.Toast;



public class add extends AppCompatActivity {
private  OperateTable mytable =null;
    private  SQLiteOpenHelper helper=null;

    private EditText name=null;
    private EditText text=null;
    private  Button save=null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.add);

        this.name=(EditText)super.findViewById(R.id.aname);
        this.text=(EditText)super.findViewById(R.id.atext);
        Button save=( Button) super.findViewById(R.id.save);

        helper=new DataBaseHelp(this);
        helper.getWritableDatabase();
        mytable=new OperateTable(helper.getWritableDatabase());
        save.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(name.getText().toString().equals("")){Toast.makeText(getApplicationContext(),"請輸入標題",Toast.LENGTH_SHORT).show();}
               else{ mytable.insert(name.getText().toString(),text.getText().toString());//保存資料
                Toast.makeText(getApplicationContext(),"保存成功",Toast.LENGTH_SHORT).show();
                add.this.finish();//結束當前Activity,回傳主頁面}

            }
        });

    }


}

  查看頁,接收來自主頁通過intent傳來的id,獲取相應資料并顯示

布局:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:id="@+id/linearLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <EditText
        android:id="@+id/name"
        android:layout_width="303dp"
        android:layout_height="46dp"
        android:layout_marginStart="60dp"
        android:layout_marginTop="36dp"
        android:layout_marginBottom="14dp"
        android:hint="標題"
        android:text="TextView"
        android:maxLength="25"
        app:layout_constraintBottom_toTopOf="@+id/divider"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <EditText
        android:id="@+id/text"
        android:layout_width="308dp"
        android:layout_height="400dp"
        android:layout_marginStart="52dp"
        android:layout_marginEnd="52dp"
        android:layout_marginBottom="63dp"
        android:background="@null"
        android:gravity="top"
        android:hint="內容"
        android:minLines="5"
        android:text="TextView"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/name"
        app:layout_constraintVertical_bias="1.0" />

    <View
        android:id="@+id/divider"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginStart="1dp"
        android:layout_marginTop="83dp"
        android:layout_marginEnd="1dp"
        android:layout_marginBottom="433dp"

        android:background="?android:attr/listDivider"
        app:layout_constraintBottom_toTopOf="@+id/delete"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/delete"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="29dp"
        android:layout_marginBottom="6dp"
        android:text="洗掉"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/divider" />

    <Button
        android:id="@+id/edit"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="29dp"
        android:layout_marginBottom="7dp"
        android:text="保存更改"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

  活動類

package com.example.myapplication;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;

import android.content.DialogInterface;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.content.Intent;
import android.widget.Toast;

public class receive extends AppCompatActivity {

    private EditText name=null;
    private EditText text=null;
    private Button delete=null;
    private Button edit=null;
    private OperateTable mytable =null;
    private SQLiteOpenHelper helper=null;
    private String info=null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.receive);

        this.name=(EditText)super.findViewById(R.id.name);
        this.text=(EditText)super.findViewById(R.id.text);
        this.delete=(Button)super.findViewById(R.id.delete);
        this.edit=(Button)super.findViewById(R.id.edit);

    Intent it=super.getIntent();
    info=it.getStringExtra("info");//獲取主頁傳遞的id

        helper=new DataBaseHelp(this);
        helper.getWritableDatabase();
      mytable=new OperateTable(helper.getWritableDatabase());
    tip t=mytable.t(info);
   name.setText(t.getName());
   text.setText(t.getText());
   delete.setOnClickListener(new View.OnClickListener() {
       @Override
       public void onClick(View v) {
           AlertDialog myAlertDialog = new AlertDialog.Builder(receive.this)
                   .setTitle("確認" )
                   .setMessage("確定洗掉“"+name.getText()+"”嗎?" )
                   .setPositiveButton("是" , new DialogInterface.OnClickListener() {
                       public void onClick(DialogInterface dialog, int whichButton) {
                           mytable.delete(info);
                           Toast.makeText(getApplicationContext(),"洗掉成功",Toast.LENGTH_SHORT).show();
                         receive.this.finish();
                       }
                   })
                   .setNegativeButton("否" , null)
                   .show();
       }
   });
   edit.setOnClickListener(new View.OnClickListener() {
       @Override
       public void onClick(View v) {
           mytable.updata(info,name.getText().toString(),text.getText().toString());
           Toast.makeText(getApplicationContext(),"修改成功",Toast.LENGTH_SHORT).show();
           receive.this.finish();
       }
   });
    }


}

  

轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/37025.html

標籤:Android

上一篇:Android專案實戰(五十九):除錯方法神器Hugo

下一篇:Android Intent用法總結

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 【從零開始擼一個App】Dagger2

    Dagger2是一個IOC框架,一般用于Android平臺,第一次接觸的朋友,一定會被搞得暈頭轉向。它延續了Java平臺Spring框架代碼碎片化,注解滿天飛的傳統。嘗試將各處代碼片段串聯起來,理清思緒,真不是件容易的事。更不用說還有各版本細微的差別。 與Spring不同的是,Spring是通過反射 ......

    uj5u.com 2020-09-10 06:57:59 more
  • Flutter Weekly Issue 66

    新聞 Flutter 季度調研結果分享 教程 Flutter+FaaS一體化任務編排的思考與設計 詳解Dart中如何通過注解生成代碼 GitHub 用對了嗎?Flutter 團隊分享如何管理大型開源專案 插件 flutter-bubble-tab-indicator A Flutter librar ......

    uj5u.com 2020-09-10 06:58:52 more
  • Proguard 常用規則

    介紹 Proguard 入口,如何查看輸出,如何使用 keep 設定入口以及使用實體,如何配置壓縮,混淆,校驗等規則。

    ......

    uj5u.com 2020-09-10 06:59:00 more
  • Android 開發技術周報 Issue#292

    新聞 Android即將獲得類AirDrop功能:可向附近設備快速分享檔案 谷歌為安卓檔案管理應用引入可安全隱藏資料的Safe Folder功能 Android TV新主界面將顯示電影、電視節目和應用推薦內容 泄露的Android檔案暗示了傳說中的谷歌Pixel 5a與折疊屏新機 谷歌發布Andro ......

    uj5u.com 2020-09-10 07:00:37 more
  • AutoFitTextureView Error inflating class

    報錯: Binary XML file line #0: Binary XML file line #0: Error inflating class xxx.AutoFitTextureView 解決: <com.example.testy2.AutoFitTextureView android: ......

    uj5u.com 2020-09-10 07:00:41 more
  • 根據Uri,Cursor沒有獲取到對應的屬性

    Android: 背景:呼叫攝像頭,拍攝視頻,指定保存的地址,但是回傳的Cursor檔案,只有名稱和大小的屬性,沒有其他諸如時長,連ID屬性都沒有 使用 cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Video.Media.DURATIO ......

    uj5u.com 2020-09-10 07:00:44 more
  • Android連載29-持久化技術

    一、持久化技術 我們平時所使用的APP產生的資料,在記憶體中都是瞬時的,會隨著斷電、關機等丟失資料,因此android系統采用了持久化技術,用于存盤這些“瞬時”資料 持久化技術包括:檔案存盤、SharedPreference存盤以及資料庫存盤,還有更復雜的SD卡記憶體儲。 二、檔案存盤 最基本存盤方式, ......

    uj5u.com 2020-09-10 07:00:47 more
  • Android Camera2Video整合到自己專案里

    背景: Android專案里呼叫攝像頭拍攝視頻,原本使用的 MediaStore.ACTION_VIDEO_CAPTURE, 后來因專案需要,改成了camera2 1.Camera2Video 官方demo有點問題,下載后,不能直接整合到專案 問題1.多次拍攝視頻崩潰 問題2.雙擊record按鈕, ......

    uj5u.com 2020-09-10 07:00:50 more
  • Android 開發技術周報 Issue#293

    新聞 谷歌為Android TV開發者提供多種新功能 Android 11將自動填表功能整合到鍵盤輸入建議中 谷歌宣布Android Auto即將支持更多的導航和數字停車應用 谷歌Pixel 5只有XL版本 搭載驍龍765G且將比Pixel 4更便宜 [圖]Wear OS將迎來重磅更新:應用啟動時間 ......

    uj5u.com 2020-09-10 07:01:38 more
  • 海豚星空掃碼投屏 Android 接收端 SDK 集成 六步驟

    掃碼投屏,開放網路,獨占設備,不需要額外下載軟體,微信掃碼,發現設備。支持標準DLNA協議,支持倍速播放。視頻,音頻,圖片投屏。好點意思。還支持自定義基于 DLNA 擴展的操作動作。好像要收費,沒體驗。 這里簡單記錄一下集成程序。 一 跟目錄的build.gradle添加私有mevan倉庫 mave ......

    uj5u.com 2020-09-10 07:01:43 more
最新发布
  • 歡迎頁輪播影片

    如圖,引導開始,球從上落下,同時淡入文字,然后文字開始輪播,最后一頁時停止,點擊進入首頁。 在來看看效果圖。 重力球先不講,主要歡迎輪播簡單實作 首先新建一個類 TextTranslationXGuideView,用于影片展示 文本是類似的,最后會有個圖片箭頭影片,布局很簡單,就是一個 TextVi ......

    uj5u.com 2023-04-20 08:40:31 more
  • 【FAQ】關于華為推送服務因營銷訊息頻次管控導致服務通訊類訊息

    一. 問題描述 使用華為推送服務下發IM訊息時,下發訊息請求成功且code碼為80000000,但是手機總是收不到訊息; 在華為推送自助分析(Beta)平臺查看發現,訊息發送觸發了頻控。 二. 問題原因及背景 2023年1月05日起,華為推送服務對咨詢營銷類訊息做了單個設備每日推送數量上限管理,具體 ......

    uj5u.com 2023-04-20 08:40:11 more
  • 歡迎頁輪播影片

    如圖,引導開始,球從上落下,同時淡入文字,然后文字開始輪播,最后一頁時停止,點擊進入首頁。 在來看看效果圖。 重力球先不講,主要歡迎輪播簡單實作 首先新建一個類 TextTranslationXGuideView,用于影片展示 文本是類似的,最后會有個圖片箭頭影片,布局很簡單,就是一個 TextVi ......

    uj5u.com 2023-04-20 08:39:36 more
  • 【FAQ】關于華為推送服務因營銷訊息頻次管控導致服務通訊類訊息

    一. 問題描述 使用華為推送服務下發IM訊息時,下發訊息請求成功且code碼為80000000,但是手機總是收不到訊息; 在華為推送自助分析(Beta)平臺查看發現,訊息發送觸發了頻控。 二. 問題原因及背景 2023年1月05日起,華為推送服務對咨詢營銷類訊息做了單個設備每日推送數量上限管理,具體 ......

    uj5u.com 2023-04-20 08:39:13 more
  • iOS從UI記憶體地址到讀取成員變數(oc/swift)

    開發除錯時,我們發現bug時常首先是從UI顯示發現例外,下一步才會去定位UI相關連的資料的。XCode有給我們提供一系列debug工具,但是很多人可能還沒有形成一套穩定的除錯流程,因此本文嘗試解決這個問題,順便提出一個暴論:UI顯示例外問題只需要兩個步驟就能完成定位作業的80%: 定位例外 UI 組 ......

    uj5u.com 2023-04-19 09:16:23 more
  • FIDE重磅更新!性能飛躍!體驗有禮!

    FIDE 開發者工具重構升級啦!實作500%性能提升,誠邀體驗! 一直以來不少開發者朋友在社區反饋,在使用 FIDE 工具的程序中,時常會遇到諸如加載不及時、代碼預覽/渲染性能不如意的情況,十分影響開發體驗。 作為技術團隊,我們深知一件趁手的開發工具對開發者的重要性,因此,在2023年開年,FinC ......

    uj5u.com 2023-04-19 09:16:15 more
  • 游戲內嵌社區服務開放,助力開發者提升玩家互動與留存

    華為 HMS Core 游戲內嵌社區服務提供快速訪問華為游戲中心論壇能力,支持玩家直接在游戲內瀏覽帖子和交流互動,助力開發者擴展內容生產和觸達的場景。 一、為什么要游戲內嵌社區? 二、游戲內嵌社區的典型使用場景 1、游戲內打開論壇 您可以在游戲內繪制論壇入口,為玩家提供沉浸式發帖、瀏覽、點贊、回帖、 ......

    uj5u.com 2023-04-19 09:15:46 more
  • iOS從UI記憶體地址到讀取成員變數(oc/swift)

    開發除錯時,我們發現bug時常首先是從UI顯示發現例外,下一步才會去定位UI相關連的資料的。XCode有給我們提供一系列debug工具,但是很多人可能還沒有形成一套穩定的除錯流程,因此本文嘗試解決這個問題,順便提出一個暴論:UI顯示例外問題只需要兩個步驟就能完成定位作業的80%: 定位例外 UI 組 ......

    uj5u.com 2023-04-19 09:14:53 more
  • FIDE重磅更新!性能飛躍!體驗有禮!

    FIDE 開發者工具重構升級啦!實作500%性能提升,誠邀體驗! 一直以來不少開發者朋友在社區反饋,在使用 FIDE 工具的程序中,時常會遇到諸如加載不及時、代碼預覽/渲染性能不如意的情況,十分影響開發體驗。 作為技術團隊,我們深知一件趁手的開發工具對開發者的重要性,因此,在2023年開年,FinC ......

    uj5u.com 2023-04-19 09:14:08 more
  • 游戲內嵌社區服務開放,助力開發者提升玩家互動與留存

    華為 HMS Core 游戲內嵌社區服務提供快速訪問華為游戲中心論壇能力,支持玩家直接在游戲內瀏覽帖子和交流互動,助力開發者擴展內容生產和觸達的場景。 一、為什么要游戲內嵌社區? 二、游戲內嵌社區的典型使用場景 1、游戲內打開論壇 您可以在游戲內繪制論壇入口,為玩家提供沉浸式發帖、瀏覽、點贊、回帖、 ......

    uj5u.com 2023-04-19 09:08:34 more