Coder Social home page Coder Social logo

calcultrainer's Introduction

누구나 쉬운 산수

구글플레이에 업로드된 산수학습 앱

마켓이동: 누구나 쉬운산수(+-만 연습하기)

특징

  • 흔한 kotlin식 사고방식의 소스코드
  • 인앱업데이트 API → 구글플레이에 업데이트 있는 지 채크목적

Context의 확장함수로 정의

fun Context.processUpdate(fnOk: (Boolean) -> Unit){
    val appUpdateManager = AppUpdateManagerFactory.create(this)
    val appUpdateInfoTask = appUpdateManager.appUpdateInfo

    appUpdateInfoTask.addOnSuccessListener { apInfo ->
        if (apInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE){
            fnOk(true)
        } else {
            fnOk(false)
        }
    }

}

사용

 override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_splash)

        processUpdate{
                bUpdate ->
            if(bUpdate){
                showAskUpdateDialog(this)
            } else{
                setUpUIComplte()
            }
        }

 }
  • Deeplink를 통한 웹에서 앱설치 및 실행(파라메터 전송)

AndroidManifest.xml

<activity
        android:name=".BasicCalculator"
        android:screenOrientation="portrait">

            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:host="add" android:scheme="easycal" />
            </intent-filter>

</activity>

웹에서 사용 참고링크

<html>
    <head>
    	<meta charset="UTF-8">

    	<meta property="og:url"                content="http://vintageappmaker.com/apps/easycal/appcheck.html" />
		<meta property="og:type"               content="website" />
		<meta property="og:title"              content="누구나 쉬운 산수" />
		<meta property="og:description"        content="산수공부를 위한 앱" />
		<meta property="og:image"              content="https://play-lh.googleusercontent.com/vS48CuRkPP92bF-CmaAwovmj7PTgKMjWG0b4sC4_PIcEgvopyIoaGI8GePv7TAiHaw=s180-rw" />

    	<script>
            function isAndroid(){
                var bExist = (/android/i.test(navigator.userAgent.toLowerCase()));	 
		if (bExist) {
		    return true;

		} else {
		    return false;
		}
            }

            function appLaunch(app_url){
	        if(isAndroid()){
		    location.href = app_url;
		}
	    }
		</script>
    </head>
    <body>
       	<span onclick="appLaunch('Intent://add?op1=20&op2=33#Intent;scheme=easycal;package=com.psw.calcultrainer;end')">
        	<h1>App 설치 및 실행 - click</h1>   
        	<div>Android외에는 아무반응을 하지 않습니다.</div>

        	<img src= "https://play-lh.googleusercontent.com/vS48CuRkPP92bF-CmaAwovmj7PTgKMjWG0b4sC4_PIcEgvopyIoaGI8GePv7TAiHaw=s180-rw">

        </span>
    </body>
</html>

calcultrainer's People

Contributors

vintageappmaker avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.