Should I use SVG or PNG for Xamarin Forms for iOS and Android?

If we use PNG – for iOS we use @ x1 @ x2 @ x3 size per image (which in Zeplin / Sketch is just a click). Android – about 5 image sizes, so we need to manage 8 PNG images per graphic element.

while SVG – will work for iOS and Android, but there are technical limitations. For example, the SVGs are distorted during rendering. We may be able to fix the problem by sketching the individual SVG elements / layers.

I hope someone can help us find the best format for our app.

Many Thanks!

pdf – Is a randomly generated bar code generated by Android Mobile legally protected?

I make an app that allows the generation of a barcode with any number and the user can print them in A4 format as a PDF and use them on their products.

Is there a law or something else that will be known to me? Can anyone point out the bad effects of this process? Or should I warn my users to use them at their own risk?

Every help is appreciated.

android – how can I restrict a view to the middle of another view below?

I want one picture to always be perfectly centered over the bottom of another picture.

My first thought was to set the bottom restriction of the background image to, for example, 100 dpi from another view and then the lowest restriction of the foreground image from the same view to 50 dpi and the height to 100 dpi.
This way, it always appears in the middle of the lower center of the background image, but I notice that the foreground view stops responding when it's fixed in size. I would like to avoid this.

Another thought I had was limiting both the top and bottom of the foreground image to the bottom of the background image, but then the view simply fades out.
I can not find any settings that will work that way.

* I have to maintain a ratio for the foreground image.

API – Android + MySQL + PHP

I do not ask for help often, but I'm stuck here.
I need to access my remote database through an Android application.
For this I have selected a MySQL database and a PHP script.

PHP code


$ sql = "SELECT * FROM score";

if ($ rs = $ conn-> query ($ sql)) {
$ response["data"] = array ();
while ($ row = $ rs-> fetch (PDO :: FETCH_ASSOC)) {
// temporary user array
$ ligne = array ();
$ ligne["key"] = $ row["key"];
$ ligne["date"] = $ row["date"];
$ ligne["heure"] = $ row["heure"];
$ ligne["score"] = $ row["score"];
$ ligne["theme"] = $ row["theme"];

// Move a single line to the final response array
array_push ($ response["data"], $ ligne);

catch (PDOException $ e)
echo $ sql. "
". $ e-> getMessage (); $ response["success"] = 1; } // Echo the JSON response echo json_encode ($ response); $ conn = null; ?>

JAVA code

Package com.raz.appliandroid;

import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

public class NoticeActivity extends AppCompatActivity {

OkHttpClient client = new OkHttpClient ();
// public string url = "";
public string url = "http: //localhost/appliandroid/get_all_scores.php";

protected void onCreate (bundle savedInstanceState) {
final Context context = this;
super.onCreate (savedInstanceState);
setContentView (R.layout.activity_notice);

OkHttpHandler okHttpHandler = new OkHttpHandler ();
okHttpHandler.execute (url);

public class OkHttpHandler extends AsyncTask {
protected String doInBackground (String ... params) {

Request.Builder builder = new Request.Builder ();
builder.url (params[0]);
Request request = ();

To attempt {
Response: response = client.newCall (request) .execute ();
return response.body (). string ();

} catch (exception e) {
e.printStackTrace ();
return zero;

protected void onPostExecute (String s) {
super.onPostExecute (s);
Log.i ("Result API", s);

When I call an API that's available on the Web so developers can test their code and I did not create it, my Android application works well and restores JSON-style data.
In the JAVA code, it is the API "" that is included in the comment and works.

When I call my PHP script, it does not work, I always go into the "catch".

However, looking at the results of the two APIs in an Internet Explorer, the structures are similar.

With API ""

{"page": 1, "per_page": 3, "total": 12, "total_pages": 4, "data":[{"id":1,"email":"","first_name":"George","last_name":"Bluth","avatar":""},{"id":2,"email":"","first_name":"Janet","last_name":"Weaver","avatar":""},{"id":3,"email":"","first_name":"Emma","last_name":"Wong","avatar":""}]}

With my PHP API


Can you help me to solve this problem? It has been a few days since I surf the Internet and change my code in all directions, without success.

Thank you in advance.

linux – The openVPN client connects to the VPN server from the Android app, but not from the Ubuntu or iOS app

Disclaimer: I am fully aware that the school owns the network and has the right to restrict traffic at will.

My rpi3 runs an openVPN server configured with PiVPN and uses TCP port 443. By default, all configurations are different than the port and protocol. With exactly the same ovpn files, 2 Android devices (100% success rate) could successfully connect to the server in my school network (blocking VPNs), only one iPhone was tried and my own laptop on Ubuntu both failed (0 % Success rate) with the infamous failed TCP handshake. The configuration file can not be broken because it works on one client but not on the other. Android and iOS use the same app: OpenVPN Connect and on Ubuntu I used the latest 19.04 repository version (the version that was used at the time of this post) apt-get install openvpncan not check at the moment). I was trying to compile an older version of OpenVPN (I think 2.3.9?), But it was not created because of an SSL error, and I could not install the dependencies because some Ubuntu repositories are also blocked on the school network ,

My friend and I noticed that all free VPN apps in the Play Store did not connect (even scrolling to the least used apps), but several VPNs worked on iOS. So I decided to do this for my friend, and I tested it at home by using data on an iPhone (it worked). At school I let my friend try and it worked, and we tested the Tor network and blocked websites like OneDrive (I think this was inadvertently blocked by a blanket rule). Another friend tried it on his Android phone and it worked too. I thought everything was perfect, so one day I brought my laptop and tried it on Ubuntu. He did not connect (I have no logs or access to this laptop or school). I have extensively searched the error and tried everything without success. Another friend decided to try my VPN because there would be a speed advantage over free VPNs. He tried it on his iPhone and it did not work. I did not have access to their logs, but I can only assume that they, too, could not make a TCP handshake. My network is properly configured, and TCP port 443 is forwarded to my Pi, static IP, ddns, and everything. I know it works because it works on Android and iOS all the time when data is being used. I was trying to connect to the Pi with my Ubuntu laptop at home while I was on the same network by switching the client OVPN file to the private IP address, and it worked. This shows that the iOS app, the Ubuntu 19.04 installation, and the Android apps can connect on unrestricted networks. However, in a limited network, only the iOS app and the Ubuntu installation will not work.

Question: Why would there be a discrepancy between the clients used? Does anyone know the differences between the behavior of these apps?

aosp – Android kernel creation

I'm a freshman and have a general question that seems silly. I need to change my Nexus 6 kernel (Android 7.1.1). My first problem is that I do not know where to find the source code of the stock core. Also, should I download the entire AOSP and embed the results into a system image created from the Android Open Source project? or can I just add kernel?
In general, is it possible to add new tools to Android like Strace without creating the whole AOSP?

Vulkan-basic-samples can not be created in Android Studio 3.4.1 and Grable 5.1.1

Vulkan-basic-samples can not be created in Android Studio 3.4.1 and Grable 5.1.1

ERROR: The project name & # 39; API-Samples / android / & # 39; may not contain any of the following characters:[/:[/:[/:[/:<, >, ",?, *, |], Set the & # 39; & # 39; or customize the & # 39; include & # 39; statement (see ). initialization.Settings: include (java.lang.String[]) for more details).

I made changes, but it does not work.
Can someone help me to solve this?
Many Thanks