Buy Google Stadia from Bangladesh

Buy Google Stadia from Bangladesh - Pre-order only

Be the first in Bangladesh as a Google Stadia UserPlay the high resolution game right from your Google chrome browser. No need to buy high configuration computer anymore. Google Stadia would be the next generation gaming platform. Stadia is a cloud gaming service operated by multinational technology company Google. According to Google, it is capable of streaming video games in 4K resolution at 60 frames per second with support for high-dynamic-range, to players via the company’s numerous data centers across the globe, if they are using a sufficiently high-quality Internet connection. It will be accessible through the company’s Google Chrome web browser. So be the first to buy Google Stadia from Bangladesh.

Google announces Stadia, a cloud-based gaming platform

According to Google, Stadia will remove the hardware limitations of PCs for the gamer and game developers can consume nearly unlimited resources to develop next generation games. It would be the “Netflix” of “Next generation gaming”

Google’s Stadia Announcement at GDC 2019 in Under 14 Minutes

Release date of Google Stadia in Bangladesh

The release date of Google Stadia has not been announced yet but Google says that in 2019 anytime soon it will be released. June can be a great time to release the Google Stadia for people to buy but it will be made available only US, Canada, UK, Europe. Bangladesh is not in the list but you don’t need to be worried about that.

We are trying to facilitate for people to buy Google Stadia from Bangladesh via our store (our store is only available for exclusive members) When it will be released in US we will try to make it available in Bangladesh too within a week. Currently we are taking booking as pre-order. If you are a crazy gamer and want to get excited and want to be the first user of Google Stadia in Bangladesh, write an email to store.support@previewtechs.com with your contact details so we can shortlisted you for the pre-booking.

Google Stadia vs. PS4 Pro vs Xbox One X

Google Stadia Price in Bangladesh

Google didn’t disclose the price and subscription fees yet. But at least we can speculate that the biggest competitor or Google Stadia is Sony’s PlayStation Now $19.99. We will announce the price when it will be available publicly in US market.

If you are interested in buying Google Stadia from Bangladesh, feel free to write an email to store.support@previewtechs.com for pre-order and getting early access of our exclusive online store. You can contact via our Facebook page (@previewtechs).

Important coverage for Google Stadia

About Google Stadia

Partnering with The Codero for complete digital payment gateway solutions

We have some great news to share with all of you. As you know we are continuously working to improve our solutions and service offering for our customers that we promised. Our entire journey depends on how we serve for our customers to develop their business rapidly with consistent improvement with our services. Today I am going to announce you a very exciting news.

 

 

Preview Technologies Limited has signed a MoU with The Codero Limited. The Codero Limited has a set of digital payment gateway solutions and specially one of their base payment gateway solutions “EasyPayWay” is now available for all of our new and existing customers who was just waiting to integrate digital payment gateway with their e-commerce website and get payment from mostly all kinds of payment system like bKash, Rocket, Credit/Debit Cards and Online Banking. This partnership is a great opportunity for Preview Technologies Limited to develop more easy, efficient and customized payment gateway solutions. Here is a solution snapshots I can’t wait to tell you.

Faster Merchant ID Create & Approval Process
All of our new and existing customer can now apply for getting a merchant account to get payment from their clients with debit/credit card, online banking and other popular payment providers.
This usually takes longer period of time to get merchant approval with lots of paperwork. But from now on, Preview Technologies Limited can process all merchant application with our partner The Codero Limited more quickly and efficiently.

Lowest Transaction Fees
We are still working to get it fixed and we will announce the transactions fees and registration pricing later but due to this partnership agreement we can now guarantee the lowest transaction and processing fees for our customers.

All Bangladeshi Popular Payment Method Supported
EasyPayWay, a solutions provided by The Codero Limited has a wide range of popular payment methods including bKash, Rocket, QCash, MCash, DBBL Nexus, Visa, MasterCard, JCB, City Bank, Payza, IFIC Mobile Banking, Discover, FastCash, etc.

 

Dedicated Dashboard With Extended Reporting
EasyPayWay will provide a dedicated dashboard to all of our customers where you can explore all kinds of payment and transaction related activity including, managing transaction, refund processing, withdraw request to bank, etc.

Extensive API Integration & Customization
EasyPayWay will provide a wide range of integration and customization features such as plugins, libraries, SDKs for all of our customers for better integration with existing system that we develop. Though, Preview Technologies Limited will help all of it’s customers to integrate payment gateway with their system that you shouldn’t worry about.

So ultimately, I couldn’t wait to share this extremely exciting news with you. On behalf of Preview Technologies Limited I can ensure a great flexible, efficient, reliable payment gateway solutions for all of our new and existing customers. Also besides expressing this news with all of you, I want to personally thanks to Mr. Riad and Mr. Rana from The Codero Limited team to make this happen and on behalf of our entire Preview Technologies family we hope for a greater future for both of our business in every way we can perform together.

Cheers!

Get OAuth 2.0 access token using Retrofit 2.x

Retrofit is an awesome and easy to use library. You can use Retrofit for any Android or Java application which need to interact with our OAuth2.0 server to get access token.

You just need to build the retrofit properly to get it done. It doesn’t require any advance knowledge. Let’s see how it can be done easily.

To get the access token using Retrofit we need to do –

Add Retrofit in your project via Maven or Gradle. Complete installation guide can be found here.

Now let’s create the Retrofit builder. And before doing that we need to create a service interface.

//AccessTokenServiceInterface.java
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

public interface AccessTokenServiceInterface {

    @POST("/oauth/v1/access_token")
    @FormUrlEncoded
    Call<TokenResponse> getToken(@Field("client_id") String client_id, @Field("client_secret") String client_secret, @Field("scope") String scope, @Field("grant_type") String grant_type);
}

And now the builder.

//Http.java
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

import java.io.IOException;

public class Http {
    public static void main(String[] args) {
        Retrofit retrofit = new Retrofit.Builder()
                .addConverterFactory(GsonConverterFactory.create())
                .baseUrl("https://myaccount.previewtechs.com")
                .build();

        AccessTokenServiceInterface service = retrofit.create(AccessTokenServiceInterface.class);

        //grant types = client_credentials
        Call<TokenResponse> call = service.getToken("OAUTH CLIENT ID", "OAUTH CLIENT SECRET", "basic email", "client_credentials");
        try {
            Response<TokenResponse> response = call.execute();
            System.out.println(response.body().getAccessToken());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

And also we need to map the JSON response from our OAuth 2.0 server. So we need a model to map that. Let’s create TokenResponse.java model class

//TokenResponse.java
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class TokenResponse {

    @SerializedName("token_type")
    @Expose
    private String tokenType;
    @SerializedName("expires_in")
    @Expose
    private Integer expiresIn;
    @SerializedName("access_token")
    @Expose
    private String accessToken;

    public String getTokenType() {
        return tokenType;
    }

    public void setTokenType(String tokenType) {
        this.tokenType = tokenType;
    }

    public Integer getExpiresIn() {
        return expiresIn;
    }

    public void setExpiresIn(Integer expiresIn) {
        this.expiresIn = expiresIn;
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

}

Now run Http.main and you will get your access token.

That’s it. Now run the Http.main and you will get the access token easily. Download these scripts from our PreviewTechnologies/access-token-retrofit GitHub repository.

This article also available on our support portal.

cURL vs “file_get_contents()” in Google App Engine – Performance analysis

We all know that to do any kinds of external HTTP request from your PHP application (deployed in Google App Engine a.k.a GAE) we have three options basically. PHP native cURL extension, “cURL Lite” provided by Google and the native http:// and https:// PHP stream handlers.

cURL requires a valid billing profile and only you can enable it in your Google Cloud paid project. And that’s why Google’s custom cURL Lite actually use Google’s urlfetch service that you can use in your application free version.

But recent days, our engineering team was just wondering which can be little bit faster among cURL or cURL Lite or PHP native PHP HTTP handler, in this sense little bit faster meaning we also count even 50ms latency. That’s why I was running some test with a single script hosted on Google App Engine (PHP Standard Runtime environment). We had lots of PHP microservice apps hosted on Google App Engine and all services at a certain time needs to talk each other via HTTP external request. But sometimes, we were aware that latency is killing some communication.

So we just built 2 files basically in PHP. One is using cURL to post some foobar json data to an external URL (postb.in) and another one was using the native http:// and https:// PHP stream handlers. Let’s see what was our experimental scripts look like.

<?php

/**
 * Using CURL
 */

$data = array("foo" => "bar");
$data_string = json_encode($data);

$ch = curl_init('http://postb.in/xxxxxx');
//$ch = curl_init('/post.php');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Content-Type: application/json',
        'Content-Length: ' . strlen($data_string)
    )
);

$result = curl_exec($ch);
<?php

/**
 * php_http_stream.php
 *
 * using cURL lite. It use google's urlfetch service
 */

$url = 'http://postb.in/xxxxxx';
$data = array("foo" => "bar");
$data_string = json_encode($data);

$contentLength = strlen($data_string);

$headers = "accept: */*\r\n" .
    "Content-Type: application/json\r\n" .
    "Content-Length: $contentLength\r\n";

$context = [
    'http' => [
        'method' => 'POST',
        'header' => $headers,
        'content' => $data_string,
    ]
];
$context = stream_context_create($context);
$result = file_get_contents($url, false, $context);

And here is the trace report of those two call.

@0 ms
/php_http_stream.php
Summary
Name			RPCs	Total Duration (ms)
/curl_lite.php		1	450
/urlfetch.Fetch		1	333
Details
Timestamp		xxxx-xx-xx (xx:xx:xx.xxx)
Traced time 		333 ms
Untraced time 		117 ms

http/response/size	25
@0 ms
/curl.php
Summary
Name				RPCs	Total Duration (ms)
/curl.php			1	753
/remote_socket.Close		4	4
/remote_socket.Connect		10	157
/remote_socket.CreateSocket	4	10
/remote_socket.GetSocketOptions	1	1
/remote_socket.Poll		10	469
/remote_socket.Receive		2	2
/remote_socket.Send		2	2
/remote_socket.SetSocketOptions	1	1
Details
Timestamp	2017-xx-xx (xx:xx:xx.xxx)
Traced time 	646 ms
Untraced time 	107 ms

http/response/size		25

So what does it mean to you? It means a lot for me. Obviously cURL Lite is saving me couple milliseconds. And also I don’t need to be afraid of my “socket operation” quota that was used in cURL.

So in this, what should I say? file_get_contents() is more optimized? Of course, I am just talking how it’s performing for little external URL call with Google’s urlfetch service.

So if your application needs to interact with external service with less configuration and options, then I would prefer to use native PHP HTTP stream handler and make all external http call with file_get_contents() function. file_get_contents() use urlfetch service and you don’t need to enable cURL extension in your application.

Static vs Non-static methods in PHP. what is faster?

As you know there are two types of methods in PHP classes: static and non-static. To be called a non-static method needs an instance of its class, and static method can be called without instantiating of the class. 

In the meantime there are two very common questions:

  • When to use non-static methods and when to use static methods?
  • Is there any performance difference between static and non-static methods?

These are very common dilemmas among PHP developers. Most of developers guess that static methods must work faster because there is no object instance with all its properties involved to the call. Sounds logical. Is that actually true?

As I already mentioned above, and as you already know, the main difference between static and non-static methods is that static methods do not need an instance of the class to be called in the code. It means that for static methods there is no need to create object and keep in the memory. So, at least we can save some memory which can also affect the performance

Some experiments

To test the performance of static and nonstatic methods let’s create two similar classes. The only difference will be how we call methods in the class.

 

Static class

<?php
set_time_limit(0);
Class Static0 {

	public static $counter = 0;
	
	public static function incrByTwo()
	{
		self::$counter = self::$counter + 2;
	}
}

Class Static1 extends Static0 {

	public static function incrByOne()
	{
		self::$counter = self::$counter + 1;
	}
	
	public static function incrByTwo()
	{
		parent::incrByTwo();
	}
}

$time_start = microtime(true);
for($i=0;$i<100000;$i++) {
	Static1::incrByOne();
	Static1::incrByTwo();
}

echo Static0::$counter ;
$time_end = microtime(true);
$time1 = $time_end - $time_start;
?>
Total execution time is <?php echo $time1;?>
Used memory: <?php echo memory_get_usage();?>

NonStatic class

<?php
set_time_limit(0);

Class Static0 {

	public $counter = 0;

	public function incrByTwo()
	{
		$this->counter = $this->counter + 2;
	}
}

Class Static1 extends Static0 {
	
	public function incrByOne()
	{
		$this->counter = $this->counter + 1;
	}
	
	public function incrByTwo()
	{
		parent::incrByTwo();
	}
}

$time_start = microtime(true);
$obj = new Static1();
for($i=0;$i<100000;$i++) {
	$obj->incrByOne();
	$obj->incrByTwo();
}

echo $obj->counter ;

$time_end = microtime(true);
$time1 = $time_end - $time_start;
?>

Total execution time is <?php echo $time1;?>
Used memory: <?php echo memory_get_usage();?>

Okay, now we know that static methods are indeed generally faster than non-static methods. And the difference in memory consumption doesn’t look significant at all…

So, use static methods everywhere now?

Not really. Short answer to this question would be: you don’t need an object and don’t need a non-static method if the method doesn’t interact with properties or methods in the class and its parents/children.

Yes, static methods look  faster. In the meantime, a lot of developers believe (and they have good reasons) that using static methods and properties break a lot of the power available to Object-Oriented code. They also mention that Unit testing is impossible using static methods.