Memo : Flutter x Dart [2015-2016]
  • Introduction
  • hello
    • helloworld
    • build flutter
    • build as standalone android app(old)
      • draw text
      • draw image
      • set icon
    • build as standalone apk(now)
    • build as ios app
    • build as linux app
    • build as mac app
    • build mojo
    • build as chromeapp
  • rendering
    • draw_rect
    • anime_rect
    • anime_rect(use animation.dart)
    • draw_image
    • rotate_image
    • draw_image_from_assets
    • sound_test(rendering & service)
    • touch_test
    • multitouch_test
    • [@]demo::mini game(spacewar!)
    • draw_text
    • draw_path
    • draw_vertexs
    • draw_vertexs_with_image
    • [@]demo:3d anime
    • input text from ime(RenderObject)
  • widget
    • text
    • network image
    • assets image
    • raw image
    • container
    • row
    • col
    • flexible
    • navigator
    • stateful component
    • scaffold
    • scaffold x drawer
    • scrollable viewport
    • scrollable list
    • input text from ime(EditableText)
  • dart:io
    • HttpClient Post & Get
    • NetworkInterface
    • TCP Socket
    • UDP Socket
    • File Path(dart:io & service)
    • File Create & Permission
  • dart:ui
    • draw rect
    • pointer event
  • mojo for flutter
    • get and post request
    • sensor test
    • [@]demo:gravity sensor
  • 2d physics for scratch
    • collision without rotation
    • [@]democollision without friction
    • [b]
  • 2d physics for newton
  • mojo for native
    • build mojo
  • 48 hour trial
    • create iron heart
    • tiny tetris
Powered by GitBook
On this page
  • build standalone android app
  • ex: release Google play result
  • ex: mino
  • Detail: Prepare to create APK
  • Ex: For Release
  • Detail: remove debug certification
  • Ex: If Add Icon

Was this helpful?

  1. hello

build as standalone apk(now)

Previousset iconNextbuild as ios app

Last updated 5 years ago

Was this helpful?

build standalone android app

2015/11/29

input command ,then create apk in build folder.

flutter apk

ex: release Google play result

  • https://play.google.com/store/apps/details?id=info.kyorohiro.umiuni2d.demo.mino&hl=ja

  • http://kyorohiro.github.io/umiuni2d/mino2/web/main.html

ex: mino

https://github.com/kyorohiro/doc_2dgame/tree/master/demo/mino

> brew install android-sdk
> emacs ~/.bash_profile
> export ANDROID_HOME=/usr/local/opt/android-sdk
> source ~/.bash_profile
> git clone https://github.com/kyorohiro/doc_2dgame.git
> cd demo/mino
> pub get
> pub upgrade
> flutter apk

Detail: Prepare to create APK

1 create apk folder

mkdir apk

2 create AndroidManifest.xml in apk folder

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2015 The Chromium Authors. All rights reserved.
     Use of this source code is governed by a BSD-style license that can be
     found in the LICENSE file.
 -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="info.kyorohiro.umiuni2d.demo.mino" android:versionCode="1" android:versionName="0.0.1">

    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />
    <uses-permission android:name="android.permission.INTERNET"/>

    <application android:name="org.domokit.sky.shell.SkyApplication" android:label="Wonder Minon">
        <activity android:name="org.domokit.sky.shell.SkyActivity"
                  android:launchMode="singleTask"
                  android:theme="@android:style/Theme.Black.NoTitleBar"
                  android:configChanges="orientation|keyboardHidden|keyboard|screenSize"
                  android:hardwareAccelerated="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>
 </manifest>

2-1 mod into your package name

"info.kyorohiro.umiuni2d.demo.mino"

2-2 mod into your app label

"Wonder Minon"

Ex: For Release

1. sign cert

http://developer.android.com/intl/ja/tools/publishing/app-signing.html

1-1 create keystore

keytool -genkey -v -keystore my-release-key.keystore -alias umiuni2d -keyalg RSA -keysize 2048 -validity 10000

1-2 sign

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk umiuni2d

Detail: remove debug certification

cd build
mkdir w
cp app.apk ./w
cd w
unzip app.apk 
rm app.apk 
rm -rf META-INF/
zip ../app_unsigned.apk -r .

Ex: If Add Icon

(1)

> flutter apk
> cd build
> java -jar apktool_2.0.2.jar d app.apk
> cd app
> emacs AndroidManifest.xml

(2) add "android:icon="@mipmap/ic_launcher"" in AndroidManirest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="1" android:versionName="0.0.1" package="info.kyorohiro.umiuni2d.demo.mino" platformBuildVersionCode="22" platformBuildVersionName="5.1.1-1819727"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:icon="@mipmap/ic_launcher"  android:label="Wonder Minon" android:name="org.domokit.sky.shell.SkyApplication">
        <activity android:theme="@android:style/Theme.Black.NoTitleBar" android:name="org.domokit.sky.shell.SkyActivity" android:launchMode="singleTask" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:hardwareAccelerated="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

(3) add resource file

./AndroidManifest.xml
...
...
..
./res/mipmap-hdpi
./res/mipmap-hdpi/ic_launcher.png
./res/mipmap-mdpi/.DS_Store
./res/mipmap-mdpi/ic_launcher.png
./res/mipmap-xhdpi/ic_launcher.png
./res/mipmap-xxhdpi/ic_launcher.png
./res/mipmap-xxxhdpi/ic_launcher.png
..

(4) build

cd ../
java -jar apktool_2.0.2.jar b app

(5) cert

> cd app
> cd dist
> jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore app.apk umiuni2d
> zipalign -v 4 app.apk app_zip.apk