• Breaking News

    [Android][timeline][#f39c12]

    Tuesday, June 29, 2021

    Weekly Questions Thread - June 29, 2021 Android Dev

    Weekly Questions Thread - June 29, 2021 Android Dev


    Weekly Questions Thread - June 29, 2021

    Posted: 29 Jun 2021 06:00 AM PDT

    This thread is for simple questions that don't warrant their own thread (although we suggest checking the sidebar, the wiki, our Discord, or Stack Overflow before posting). Examples of questions:

    • How do I pass data between my Activities?
    • Does anyone have a link to the source for the AOSP messaging app?
    • Is it possible to programmatically change the color of the status bar without targeting API 21?

    Large code snippets don't read well on reddit and take up a lot of space, so please don't paste them in your comments. Consider linking Gists instead.

    Have a question about the subreddit or otherwise for /r/androiddev mods? We welcome your mod mail!

    Also, please don't link to Play Store pages or ask for feedback on this thread. Save those for the App Feedback threads we host on Saturdays.

    Looking for all the Questions threads? Want an easy way to locate this week's thread? Click this link!

    submitted by /u/AutoModerator
    [link] [comments]

    Google Play developers will need to enable 2-Step Verification and meet identity requirements

    Posted: 29 Jun 2021 04:04 PM PDT

    Can anyone guide me little on how whatsapp plays Youtube videos in a floating window?

    Posted: 29 Jun 2021 04:46 AM PDT

    There's a YouTube Android Player API which has not been updated for a very long time,

    submitted by /u/AaronStoone
    [link] [comments]

    Kotlin Features Survey Edition #2

    Posted: 29 Jun 2021 02:26 PM PDT

    Threejs site won't work on android chrome?

    Posted: 29 Jun 2021 08:08 PM PDT

    I am trying to display a simple GLTF 3d model in my website. It works on desktop Mac and windows as well as on iOS in safari and Firefox. But it does not work on Android's chrome?

    Following is my code sample. It is in ReactJS

    import React from 'react'import { useCallback } from 'react';import * as THREE from "three";import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader"; const MyCanvas = ({source}) => { const canvasRef = useCallback((node) => { if(node !== null){ const scene = new THREE.Scene(); const gltfLoader = new GLTFLoader(); gltfLoader.load( source, (gltf) => { console.log("success") // gltf.scene.scale.set(0.5, 0.5, 0.5); scene.add(gltf.scene); }, () => { console.log("progress"); }, () => { console.log("error"); } ); const floor = new THREE.Mesh( new THREE.PlaneBufferGeometry(10, 10), new THREE.MeshStandardMaterial({ color: "#444444", metalness: 0, roughness: 0.5, }) ); floor.receiveShadow = true; floor.rotation.x = -Math.PI * 0.5; scene.add(floor); /** * Lights */ const ambientLight = new THREE.AmbientLight(0xffffff, 0.8); scene.add(ambientLight); const directionalLight = new THREE.DirectionalLight(0xffffff, 0.6); directionalLight.castShadow = true; directionalLight.shadow.mapSize.set(1024, 1024); directionalLight.shadow.camera.far = 15; directionalLight.shadow.camera.left = -7; directionalLight.shadow.camera.top = 7; directionalLight.shadow.camera.right = 7; directionalLight.shadow.camera.bottom = -7; directionalLight.position.set(5, 5, 5); scene.add(directionalLight); const sizes = { width: window.innerWidth - 20, height: 200, }; const camera = new THREE.PerspectiveCamera( 75, sizes.width / sizes.height, 0.1, 100 ); camera.position.set(2, 2, 2); scene.add(camera); // Controls const controls = new OrbitControls(camera, node); controls.target.set(0, 0.75, 0); controls.enableDamping = true; const renderer = new THREE.WebGLRenderer({ canvas: node, }); renderer.shadowMap.enabled = true; renderer.shadowMap.type = THREE.PCFSoftShadowMap; renderer.setSize(sizes.width, sizes.height); renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)); // renderer.render(scene, camera); const tick = () => { // Update controls controls.update(); // Render renderer.render(scene, camera); // Call tick again on the next frame window.requestAnimationFrame(tick); }; tick(); } },[]); return ( <canvas ref={canvasRef} className="webgl"></canvas> )} export default MyCanvas

    For full sample you can refer my GitHub repo https://github.com/PritishSawant/MyFirstAttemptThreejsDisplay3dmodelsGltf

    submitted by /u/BraveEvidence
    [link] [comments]

    Working samples for google's filament?

    Posted: 29 Jun 2021 07:53 PM PDT

    Does anyone have any working samples using Google's Filament library to display gltf, obj and fbx models for android. The samples repo for filament contains matcap and not actual android projects. A step by step guide would be really useful.

    submitted by /u/BraveEvidence
    [link] [comments]

    Data Binding

    Posted: 29 Jun 2021 06:52 AM PDT

    Is it okay to use dataBinding in a android project nowadays If not why so ?

    What are the problems with data Binding ?

    Is it bad to implement logic inside xml by calling viewmodel functions using Data Binding ?

    submitted by /u/tech_enthusiast_
    [link] [comments]

    hilt must use kotlin ?

    Posted: 29 Jun 2021 07:39 PM PDT

    if hilt can only use java ?

    submitted by /u/shiguiyou
    [link] [comments]

    Shared Element Transaction with AppBarLayout

    Posted: 29 Jun 2021 05:08 AM PDT

    I'm trying to copy TripAdvisor, but I've got a problem:

    https://reddit.com/link/oa6yet/video/kx5llklw27871/player

    As you can see, when the AppBarLayout is expanded, the transition is smooth as expected, however, when the AppBarLayout is not expanded the Recyclerview makes a downwards jerk which is really annoying to see.

    I've tried different things but nothing works.

    Any suggestions? 🙃

    submitted by /u/____Mattia____
    [link] [comments]

    Continue Kotlin or start React Native?

    Posted: 29 Jun 2021 02:28 PM PDT

    Hello everyone! I have a hard time deciding what to do: continue learning Kotlin or switch to React Native. So basically I started learning kotlin few months ago but didnt take it too seriously. Now I can build my own mini projects and I would like to start freelancing so I can monetize my skill. But here comes the problem. Almost everyone who needs an app wants cross platform so they need someone who uses react native. The only kotlin jobs I found are long term jobs and for experts and they do not fit me well. What I search is a way to make some money as a beginner/intermediate. So here comes the question : should I continue learning Kotlin or start React Native? And also, would it be difficult to make the change?

    submitted by /u/casiann10
    [link] [comments]

    Does google take 30% cut even if you application has a subscription model outside playstore ?

    Posted: 28 Jun 2021 11:25 PM PDT

    I am working on a self-publishing platform similar to Medium. If I include subscription model, should I pay 30% cut to google ? If I collect payments externally through my web portal, can I bypass the 30% cut ?

    submitted by /u/Consiouswierdsage
    [link] [comments]

    What does any of this mean?

    Posted: 29 Jun 2021 07:55 PM PDT

    =;server=dXMtYXV0aDIuc2Ftc3VuZ29zcC5jb20sdXMtYXV0aDIuc2Ftc3VuZ29zcC5jb20=; X-SCS-USER-AGENT: DT(53);OS(5);MASI;SV(0.2.7.4.2);CS() Content-Length: 134 Content-Type: application/json; charset=UTF-8 Host: 52.43.206.169:443 Connection: Keep-Alive User-Agent: Apache-HttpClient/4.0.1 (java 1.5)

    {"groupId":"f7fd1d9bd3b68b31b8a69111","peerId":"SAP_BCBCA07ABB14970533FF0362604AA3BE","instanceId":"39kc4o8c10","addressEnabled":true} " [17:38:24.231982][4977][DEBUG] SCA_Proxy::initSCA_SSL - HTTPS Send complete [17:38:24.492435][4977][DEBUG] SCA_Proxy::recvHttpsResponce - select() Res( 1 ) [17:38:24.492795][4977][DEBUG] SCA_Proxy::recvHttpsResponce - Responce : Res( 262 ), SSL_get_error( 0 ) [17:38:24.492890][4977][DEBUG] SCA_Proxy::recvHttpsResponce() - HTTPS Rec

    submitted by /u/Express_Bid83
    [link] [comments]

    Getting device width info for lots of devices

    Posted: 29 Jun 2021 08:31 AM PDT

    Hey folks,

    My design team and I are looking to develop an Android app and because many are so centered in iOS the Android understanding is greatly less. (I'm on of 3 out of 100 that daily drive an Android-powered device)

    To my understanding the design viewport varies a lot between devices. Samsung used to be 360 across many of their devices, but thats no longer the case as it can be 360, 411, 412, ect. I was curious if there was an easy way to check for this in a easy-to search manner.

    My go-to is to load up somewhere like PhoneArena, search devices, look at resolutions, and doing a little math from there. However I know this isn't as reliable as I know this can change depending on the device too.

    For example: Would an S20 be 360, or 411? Would the S20+ vary as well?

    Is there a database or site that has these easily listed this info? I know native screen res is pretty easy to find, but, what the viewport width is using is a lot harder.

    submitted by /u/Atnevon
    [link] [comments]

    Whatsapp image picker replica on Github

    Posted: 29 Jun 2021 08:28 AM PDT

    Providing AssistedInject supported ViewModel for Composable using Hilt

    Posted: 29 Jun 2021 07:55 AM PDT

    Beginning to work on Android game/app that grabs wearable data from Samsung health and gamifies metrics. As a new developer who just downloaded the Android dev kit from Google, what is a good place to learn on making my app? Solid documentation?

    Posted: 29 Jun 2021 10:33 AM PDT

    Yet another adapter library

    Posted: 29 Jun 2021 12:09 AM PDT

    Created this library some time ago, may be it will be usefully for someone before Compose render RecyclerView obsolete. The core idea is to use ViewBinding as holder (kind of) and register callbacks for init/bind/click with binding as a parameter. It also supports regular view holders. https://github.com/sergeshustoff/diffadapter

    submitted by /u/lllyct
    [link] [comments]

    Suggestion to handle translations

    Posted: 29 Jun 2021 09:43 AM PDT

    Hi all,

    How do you manage translations in your team, so that it's convenient for the project manager, translators and devs to add new languages and make sure translations stay up to date ?

    Do you use a particular collaborative tool ? Does it play nice with Android ?

    Thanks a lot for your advice.

    submitted by /u/thismustbetaken
    [link] [comments]

    How do you change bottom navigation bar when keyboard appears only?

    Posted: 29 Jun 2021 04:31 AM PDT

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    getActivity().getWindow().setNavigationBarColor(android.graphics.Color.parseColor("#ffffff"));
    }

    Only changes navigation bar before and after keyboard is up

    submitted by /u/Michael_Chair_6013
    [link] [comments]

    Scope Storage Myths

    Posted: 28 Jun 2021 05:19 PM PDT

    Looking for a library or cell phone verification tool

    Posted: 29 Jun 2021 05:00 AM PDT

    Looking for a library or cell phone verification tool

    Hello, I need to save the cell phone number entered by the user and I want to know if this number is valid. Something like this image, with country code, like + 1-123-456-7890

    https://preview.redd.it/bi6rj5oe27871.png?width=513&format=png&auto=webp&s=27b6f2bf6dba27e06ddab9930a5c028d69545cf6

    submitted by /u/ViggoGod
    [link] [comments]

    I want to implement Achievements features like Nike Run club app. Any suggestions or tutorial which can be followed.

    Posted: 29 Jun 2021 09:04 AM PDT

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel