You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 19, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: _drafts/2019-05-10-intersection-observer.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,7 @@ export { lazyLoadImages }
128
128
129
129
There's still one thing that I didn't discuss yet. How can we support this type of lazy loading for the browser that doesn't still have implemented the `IntersectionObserver` API? The answer is the [Interserction Observer Polyfill](https://github.com/w3c/IntersectionObserver/tree/master/polyfill). I installed as a dependency of my project.
tags: [android, pwa, java, mobile application development, web development, javascript]
8
8
comments: true
9
9
seo:
@@ -57,12 +57,12 @@ The declaration of the TWA inside the Android app manifest must include some imp
57
57
58
58
{% include blog-lazy-image.html description="pwa app twa declaration" src="/assets/images/posts/pwa-app-04-twa-activity-declaration.png" %}
59
59
60
-
Now I need to establish the link between our PWA website and our PWA app. This is a two way operation because I need to:
60
+
Now I had to establish the link between our PWA website and our PWA app. This is a two way operation because I had to:
61
61
62
62
* establish an association from app to the website
63
63
* establish an association from the website to the app
64
64
65
-
This associations will remove automatically the url address bar from the TWA activity. In this way the Android app will full screen as a standard one (and as a PWA in standalone mode :smirk:).
65
+
This associations removes automatically the url address bar from the TWA activity. In this way the Android app will be full screen as a standard one (and as a PWA in standalone mode :smirk:).
66
66
Let's start from the first association, from the app to the web site. To do this I created a new string resource inside the `strings.xml` file. This new string resouce contains the Digital AssetLink statement that you can see below.
67
67
68
68
```xml
@@ -81,7 +81,7 @@ Let's start from the first association, from the app to the web site. To do this
81
81
82
82
{% include blog-lazy-image.html description="pwa app Digital AssetLink statement" src="/assets/images/posts/pwa-app-05-associate-app-to-web-1.png" %}
83
83
84
-
I can link this string resource statement inside the Android app manifest by adding a new `meta-data` tag as child of the `application` tag (NOT inside the TWA declaration).
84
+
Then I linked this string resource statement inside the Android app manifest by adding a new `meta-data` tag as a child of the `application` tag (NOT inside the TWA declaration).
85
85
86
86
{% include blog-lazy-image.html description="pwa app Digital AssetLink statement manifest" src="/assets/images/posts/pwa-app-05-associate-app-to-web-2.png" %}
87
87
@@ -94,14 +94,27 @@ It is possible to test that the association from app to the website has been com
After this setup if I run the app from Android Studio the address bar is gone:relieved:.
98
-
Now I need to finish the development by establishing an association from the website to the app. ..........
97
+
After this debug setup the app is launched withoutthe address bar :relieved:.
98
+
Now I need to finish the development by establishing an association from the website to the app. To do that I needed 2 information about my app:
99
99
100
+
* the package name
101
+
* SHA-256 Fingerprint
100
102
103
+
The first one was easy to get. I just needed to open the Android manifest file and get it. The second piece of information I needed is inside the keystore that contains the release signing key used to publish the app on the Google Play store. So the first operation I did was to generate a new release signing key. You can find the [standard procedure to get one in this page](https://developer.android.com/studio/publish/app-signing#generate-key). The key created was contained inside a keystore file. So in order to be able to extract the SHA-256 fingerprint from the keystore that contains my release signing key I used [keytool](https://docs.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html'keytool'). You can find the exact command I used below. The value for the SHA-256 fingerprint is printed under the Certificate fingerprints section.
With both pieces of information at hand I was able to generate a web `assetlink.json` statement using the [assetlinks generator](https://developers.google.com/digital-asset-links/tools/generator). The `assetlink.json` generated must be served from the PWA domain from the URL `<your PWA domain>/.well-known/assetlinks.json`.
106
110
107
111
{% include blog-lazy-image.html description="pwa app Digital AssetLink generator" src="/assets/images/posts/pwa-app-07-assetlink-generator.png" %}
112
+
113
+
After publishing the `assetlink.json` to my PWA domain my app was ready to be published to the store. So I followed the standard procedure [to upload an app to the Google Play Store](https://developer.android.com/studio/publish/upload-bundle).
114
+
If the two ways association fails, it is possible to check for error messages using the the Android Debug Bridge, by launching from the terminal the following command with the test device connected (or the emulator running).
0 commit comments