Connect with us
DAPA Banner

Crypto World

Prototyping Mobile Applications in Startups

Published

on

Prototyping Mobile Applications in Startups

Prototyping Mobile Applications in Startups


Developing an application that may work in every device on the market is the dream of all developers. Maybe Progressive Web Applications are the closest approach to achieving that purpose. In the 

Advertisement


Safe Teamwork


 project, we use this type of application to ensure we can reach out to a wider variety of users with a different kind of device. In this post, we are going to talk about how this technology works and how we use it in our project.

Advertisement



Introduction to PWA

Advertisement





Native applications have many advantages because of native integration with the device where they are running. However, this is time-consuming and there are lots of devices in the market, so the company will need a developer/developers in each technology to raise the costs. One solution could be to just focus on a few platforms, such as the web and android. But most web applications can benefit from two concepts, Responsive Design and Progressive Web Applications (PWA), that enable them to reach out to more platforms.



Advertisement

Responsive web design is the capability of web applications to adjust their graphic components to almost any screen size. As fonts and images are resizable nowadays, this approach has huge potential. Here is what Safe Teamwork looks like in responsive design:



Advertisement

A responsive design is not just about how we create a flexible layout for different screen sizes, it is also about user experience:

Several elements are hidden in this device. It displays the three main buttons differently, as well as the layout of the current screen.

Advertisement

This device shows all the elements because the current layout allows this. As the application was designed to be responsive from the start, you can just see the minimal elements in order to interact with all functionalities on it.

Advertisement

These topics are called 


User Interface


Advertisement

 and 


User eXperience


Advertisement

 design (UI/UX design), and we have just scratched the surface of them.

Advertisement

Once we have sketched up the responsive part, we need to bring the application to all of the devices through PWA. There are three main components to create a PWA:

  • Secure connection (HTTPS)

  • Manifest file

    Advertisement

  • Service worker

All information on PWAs is sent through trusted connections. This is done not only to create this type of application but also to establish that your web application is a trusted site.

Advertisement

The 

Advertisement


manifest file


 is a JSON file that configures the PWA metadata, such as the name and short name of the application, icons, background color, orientation, start URL, and other information. For instance, you can check this information for our Safe Teamwork application at: 

Advertisement


https://app.safeteamwork.com/manifest.json


, and depending on the device, you might see something like this:

Advertisement



As you can see, we can install our application on the device’s home screen without an app store like Play Store or App Store. Once the app is installed, you can click the home-screen icon, and the splash screen will be displayed. In this splash, the name, background color, and icon metadata from the manifest are used.

Advertisement

The third element of a PWA is the service worker, which is where the magic happens. A service worker is a separate thread from a web browser that depends on it, but also adds some functionalities like offline experience. Think of it as an independent web browser window that only loads our web application. This service is a type of 


web worker

Advertisement


 that web browsers can create. We can configure this service worker via a JavaScript script (sw.js) where we describe its life cycle:


Advertisement




  • First of all, we need to configure the installation event. This event runs once when we are installing our PWA. The main purpose of this is to tell the browser what files are going to be offline:



Advertisement
  • Secondly, we need to activate the service worker, i.e. tell the browser what is going to be the behavior when there is another legacy service worker or the cache needs to be cleaned up:

  • Thirdly, we need to configure the behavior when the application is offline, i.e. if the application is installed, the service worker verifies that some requests have been made before and can respond quickly or else it goes to the network:

  • Finally, we need to add these events to the browser:

In Safe Teamwork, the primary reason for using PWA is distribution rather than the offline experience. This means that we do not synchronize any information from the installed application. We have just added some pages to the cache to manage any basic HTTP errors, such as 404 or 500, and one page to indicate when the user is offline; there is no need to add any more. We use PWA for easy distribution and to engage our users. The second reason to use it is the web push notification, which we will deal with right now.

Advertisement

Web push notifications

Advertisement



A service worker is a service that runs in the browser, and the JavaScript (sw.js) file is loaded as a regular resource of the application so we can interact with it without having to install the PWA, i.e. it does not run the install, activate, and fetch events. We can explore this service in the browser through chrome://serviceworker-internals/ internal page:



Advertisement

Service workers can use several 


Web APIs


Advertisement

 and push notifications are one of them. So, in the JavaScript script (sw.js) we have:

The event parameter contains information about the notification’s title and message. The icon helps to identify who has sent the message and also the URL that redirects the user when it’s clicked on it.

Advertisement

Then we describe the behavior when the notification is clicked:





Advertisement


Finally, we register these events:

We use the 

Advertisement


WebPush


 library with Voluntary Application Server Identification (

Advertisement


VAPID


) to secure the communication between the user-agent (desktop or mobile) and our application server.

Advertisement

Unfortunately, this type of notification is not supported by 


Advertisement

iOS devices yet


. If you decide to use web push notifications, we recommend that you view 


Advertisement

web browser compatibility


 first.

Advertisement

Conclusion



Advertisement

Although PWA has many advantages, it has some disadvantages too. We have already seen some of them:



Advertisement

Limitations:

  • PWA is a web browser service that has limitations when it is used to interact with the device’s hardware, like mobiles.

  • Until now, web push notifications have not worked on iOS devices.

    Advertisement

Advantages:

Advertisement

Advertisement

Building Progressive Web Application (


PWA

Advertisement


) requires tools that validate if everything is OK. One of them is 


Lighthouse

Advertisement


, which allows us to audit not only the performance and accessibility of the entire web application, but also 


progressive web app aspects

Advertisement


, such as the responsiveness, accessibility of any browser (at least those that support PWA), whether the application provides offline pages, and so on.

Advertisement

Thank you for reading!

Advertisement

Also, if you are curious about Safe Teamwork, check out the app here! 


http://bit.ly/3u1posx

Advertisement



Source link

Continue Reading
Click to comment

You must be logged in to post a comment Login

Leave a Reply

Crypto World

Grayscale Says Bitcoin’s Quantum Problem is Mostly a Social One

Published

on

Grayscale Says Bitcoin’s Quantum Problem is Mostly a Social One

The challenge to solving the quantum threat to Bitcoin could be more social than technical, according to Grayscale’s head of research, especially if the community fails to come to an agreement on certain contentious issues.

Google released a paper that shook the crypto industry on March 30, suggesting that a quantum computer could potentially crack the cryptography protecting Bitcoin (BTC) using far fewer resources than previously thought.

Grayscale head of research Zach Pandl, however, suggested the problem for Bitcoin doesn’t come from its technical solution, as “bitcoin has lower risk than other cryptocurrencies” because it uses a UTXO model and proof-of-work consensus, does not have native smart contracts and certain address types are not quantum vulnerable.

Instead, the challenge would be for the community to reach a decision on the way forward, said Pandl. 

Advertisement

The Bitcoin community has been fiercely debating what to do about old dormant coins, particularly the roughly 1.7 million BTC locked in early P2PK addresses, including Satoshi’s estimated 1 million BTC stash, currently worth about $68 billion. 

The Bitcoin community has three options 

The Bitcoin community needs to decide what to do about coins where the private key has been lost or is otherwise inaccessible, wrote Pandl. 

They have three main options: burning the coins, deliberately slowing their release by limiting the rate of spending from vulnerable addresses or doing nothing. 

“All are conceptually doable, but the challenge is reaching a decision, and the Bitcoin community has a history of contentious debates over protocol changes, including last year’s dispute around image data stored in blocks.”

Pandl was referring to a big fracas that erupted in 2023 over the use of blockspace for Bitcoin Ordinals, technology that enables inscribing data such as text and images to a satoshi, the smallest unit of Bitcoin. 

Advertisement

Two years later, the debate may have quietened down, but the two sides continue to hold opposing views.

Related: Researchers say quantum computers could, in theory, be ready by 2030

About 1.7 million BTC is vulnerable to the quantum threat. Source: Grayscale

No threat now but time to get started

Pandl cautioned that it was “time to get started” and that blockchains need to adopt post-quantum cryptography, echoing the sentiment from Google. 

Both Solana and the XRP Ledger are already experimenting with post-quantum cryptography, wrote Pandl. Meanwhile, the Ethereum Foundation released its post-quantum roadmap in February.

Pandl concluded that investors “should not fret” for now, but it is time to accelerate efforts to prepare for our post-quantum future. 

Advertisement

“In our view, there is no security threat to public blockchains from quantum computers today.”

Magazine: Nobody knows if quantum secure cryptography will even work