I'm looking on how to make audio bars visualizer in my iOS app, considering I want to play music through Apple music (MusicKit).

With this question I've got that the main way to do that is by using Audio Queue services and FFT. But the problem is that I can't figure out how to use it with MusicKit.

Based on apple's forum topic it's not possible to get audio data from MusicKit. I'm newbie in iOS Core Audio, but maybe there's a way to get realtime data of all device's outbound sounds and analyze it? I'm also considering other streaming services (spotify, google music), in case there's no way to realize that with MusicKit.

How do I replace the following Swift code for iOS using the DispatchQueue class? This is old Swift 3 code that the newest Xcode won't convert to Swift 5.

dispatch_async(dispatch_get_main_queue()) { () -> Void in
  // code
}

It is giving me an error that says

Ambiguous use of 'dispatch_get_main_queue()'

for dispatch_get_main_queue().

The following answer seems to be the right answer, and I want to use it, but could someone tell me this is correct? Swift version

It says to use the following code:

DispatchQueue.global(qos: .background).async {

    // Background Thread

    DispatchQueue.main.async {
        // Run UI Updates
    }
}

Other than using DispatchQueue, what other alternative do I have to fix this error?

Is there anything similar to MotionLayout for iOS? I have created basic animations while scrolling, implementing ScrollViewDidScroll method, and wanted to know, maybe there is already an option to adapt something similar to MotionLayout in UIKit.

My project worked perfectly, no mistake, all right. But now I do not know what happens the next day, Android Studio marks me the tag "@string/appbar_scrolling_view_behavior" as non-existent, which previously did not throw me at all no error. Now when I try to test my application does not let me open it.

Now try to uninstall Android Studio and delete all your folders, try doing a new project, try to put the Google Material Buttons and when you open it again I got the same error. Could someone be kind to help me? I do not want to lose my whole project because of Android Studio.

The problem I get is the following. I also attach how my styles.xml file and my build.gradle file are structured, as well as an example of the structure that all the buttons have in general. I know that I can instantiate my main theme of MaterialComponents but my problem is that if I do, many of my dependencies, their styles stop working correctly.

Error in Logcat:

2019-04-20 14:43:56.820 17207-17207/com.raven.okami E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.raven.okami, PID: 17207
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.raven.okami/com.raven.okami.RavenNetwork}: android.view.InflateException: Binary XML file line #23: Binary XML file line #11: Error inflating class com.google.android.material.button.MaterialButton
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:201)
        at android.app.ActivityThread.main(ActivityThread.java:6810)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
     Caused by: android.view.InflateException: Binary XML file line #23: Binary XML file line #11: Error inflating class com.google.android.material.button.MaterialButton
     Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class com.google.android.material.button.MaterialButton
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
        at android.view.LayoutInflater.createView(LayoutInflater.java:651)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:867)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
        at android.view.LayoutInflater.parseInclude(LayoutInflater.java:999)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:519)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
        at com.raven.okami.RavenNetwork.onCreate(RavenNetwork.java:20)
        at android.app.Activity.performCreate(Activity.java:7224)
        at android.app.Activity.performCreate(Activity.java:7213)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2926)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:201)
        at android.app.ActivityThread.main(ActivityThread.java:6810)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
     Caused by: java.lang.IllegalArgumentException: This component requires that you specify a valid TextAppearance attribute. Update your app theme to inherit from Theme.MaterialComponents (or a descendant).
2019-04-20 14:43:56.821 17207-17207/com.raven.okami E/AndroidRuntime:     at com.google.android.material.internal.ThemeEnforcement.checkTextAppearance(ThemeEnforcement.java:170)
        at com.google.android.material.internal.ThemeEnforcement.obtainStyledAttributes(ThemeEnforcement.java:75)
        at com.google.android.material.button.MaterialButton.<init>(MaterialButton.java:140)
        at com.google.android.material.button.MaterialButton.<init>(MaterialButton.java:133)
            ... 31 more

File styles.xml:

<resources>

    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="android:windowAnimationStyle">@style/RavenAnimations</item>
        <item name="android:windowBackground">@drawable/raven_loading_screen</item>
        <item name="material_drawer_background">@color/colorPrimary</item>
        <item name="material_drawer_primary_text">@color/colorText</item>
        <item name="material_drawer_selected">@color/colorAccent</item>
        <item name="material_drawer_selected_text">@color/colorTextDark</item>
        <item name="material_drawer_divider">@color/colorBackground</item>
    </style>

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

    <style name="TextAppearance.App.TextInputLayout" parent="@android:style/TextAppearance">
        <item name="android:textColor">@color/colorText</item>
        <item name="android:textSize">13sp</item>
    </style>

    <style name="CheckBox" parent="Widget.AppCompat.CompoundButton.CheckBox">
        <item name="android:colorControlNormal">@color/colorAccent</item>
        <item name="android:colorControlActivated">@color/colorAccent</item>
        <item name="android:textSize">14sp</item>
    </style>

    <style name="FullScreenDialogToolbar">
        <item name="android:background">@color/colorBackground</item>
        <item name="android:theme">@style/ThemeOverlay.AppCompat.Dark</item>
    </style>

    <style name="RavenAnimations" parent="@android:style/Animation.Activity">
        <item name="android:activityOpenEnterAnimation">@anim/slide_in_right</item>
        <item name="android:activityOpenExitAnimation">@anim/slide_out_left</item>
        <item name="android:activityCloseEnterAnimation">@anim/slide_in_left</item>
        <item name="android:activityCloseExitAnimation">@anim/slide_out_right</item>
    </style>

</resources>

Btn Default:

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/my_profile_account_buy_ticket_package_1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentEnd="true"
                    android:padding="10dp"
                    android:text="@string/raven_default_btn_buy"
                    android:textColor="@color/colorTextDark"
                    android:textAppearance="@style/TextAppearance.MaterialComponents.Button"
                    style="@style/Widget.MaterialComponents.Button"
                    tools:ignore="RelativeOverlap" />

Edit Gradle File:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.raven.okami"
        minSdkVersion 23
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        abortOnError false
        ignoreWarnings true
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.google.firebase:firebase-auth:16.2.1'
    implementation 'com.google.firebase:firebase-core:16.0.8'
    implementation 'com.google.firebase:firebase-firestore:18.2.0'
    implementation 'com.google.firebase:firebase-storage:16.1.0'
    implementation 'com.firebaseui:firebase-ui-firestore:4.3.2'
    implementation 'com.github.matecode:snacky:1.1.4'
    implementation 'com.github.marcoscgdev:DialogSheet:2.0.4-pre1'
    implementation 'com.kaopiz:kprogresshud:1.2.0'
    implementation 'com.github.franmontiel:FullScreenDialog:1.0.1'
    implementation 'org.sufficientlysecure:html-textview:3.6'
    implementation 'com.github.mikepenz:materialdrawer:v7.0.0-alpha2'
    implementation 'com.github.kaushikthedeveloper:double-back-press:0.0.1'
    implementation 'com.aurelhubert:ahbottomnavigation:2.3.3'
    //noinspection GradleDependency
    implementation 'com.squareup.okhttp3:okhttp:3.12.1'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.github.rahimlis:badgedtablayout:v1.2'
    implementation 'com.github.florent37:android-slidr:1.0.3'
    implementation 'de.hdodenhof:circleimageview:3.0.0'
    implementation 'com.makeramen:roundedimageview:2.3.0'
    implementation 'id.zelory:compressor:2.1.0'
    implementation 'com.github.yalantis:ucrop:2.2.3-native'
    implementation 'com.an.deviceinfo:deviceinfo:0.1.5'
    implementation 'android.arch.paging:runtime:1.0.1'
    implementation "com.leinardi.android:speed-dial:2.0.1"
    implementation 'com.mikepenz:actionitembadge:3.3.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

I have an application(koa 2) which currently serves nearly 200 connections sending data every 5 seconds from Postgres DB via web-socket and sends json data on front-end requests (20 - 50 connections). There are some functionalities in application for statistic reports and that's all for today. But i was told that this application will grow and there will be 1000 web-socket connections minimum, up to 5000 or more, there should be common api for connecting third party applications, which sends their data into db, analytical module for report calculations, connection module to special ERP system, and module working with geo coordinates. Maybe in future there will be more modules with other features.

The question is can nodejs handle all of this features or we should use other languages for this project, such as Java or C#?

I am a freshman in the computer science right now. Actually, I have been learning C and other kinds of programming since I was about first grade in high school.

I am learning about the Postfix and Prefix Expressions right now.

I am using GCC and Xcode for my personal development environment. However, in school, we use Visual Studio 2017. And the result comes out different in both compilers. So I am pretty much confused how I can understand this. I have been googling this question, but haven't found any answers yet, so I am posting a question here. (If this post is inappropriate or already has an answer, then let me know.)

Let's say that we have a code in C99.

int a; 
int b;

a = 10;
b = a++ + a++;

printf("Value of a is %d\n" , a);
printf("Value of b is %d\n" , b);

I skipped preprocessor part and main function part to save some space. Also, I do know that using those expressions to evaluate 'b' is not a good way.

In GCC Environment

Value of a is 12
Value of b is 21

In Visual Studio Environment

Value of a is 12
Value of b is 20

What I have figured out and understood is that, In GCC, 'b' is evaluated like this; 10 + 11 = 21 In Visual Studio, 'b' is evaluated like this; 10 + 10 = 22;

In GCC, I think the calculation process is done like this.

  1. Got value from variable (a = 10)
  2. Added 1 to the variable (a = 11)
  3. Got value from variable (a = 11)
  4. Added 1 to the variable (a = 12)

So, it is done 10 + 11 = 21 in this case.

However, in Visual Studio, I think the calculation process is done like this.

  1. Got the value from the variable (a = 10)
  2. Got the value from the variable (a = 10)
  3. Added 1 to the variable (a = 11)
  4. Added 1 to the variable (a = 12)

So, it is done 10 + 10 = 20 in this case.

The first question is, Am I understanding this correctly?

I have learned from the textbook that, side-effect comes after the ;(semicolon). In that case, it matches the Visual Studio case. However, It does not seem to fit in the GCC case in my opinion since the side-effect came before the semicolon.

The second question is, So, does the timing when side-effect comes vary between compilers?

Since I live in Korea, where we do not use English as native language, so I might sound little strange. I hope your understanding. And also, I do not know how compiler works, so I might say something different and wrong.

Thanks for reading this long question. Have a Nice day!

I have researched through the internet on either the advantages and disadvantages that the use of formal specifications and specifically Code Contracts in C# might have. I have found various answers but I didn't manage to identify the key points on the pros and cons as I have mentioned before. Could I have some assistance on that topic and any relevant source that will help me?

I want to use Visual Studio and want to create a C++ Desktop Application with the Ribbon UI, but everywhere I look, I can't find a solution that would help me get started or I must have missed something. I learned about the Windows Ribbon Framework but Microsoft Docs doesn't exactly specify where it is or how to download it unless its part of some package I don't know about but frankly I'm at a loss; it's not obvious to me. Can anyone help me?

We want to build a URL shortening service.

Design goals :

a) Scalable

b) Highly available

I was analysing which type and specifically which database to use for the purpose.

a) Relational DB : Rejected

- Data is not relational 

- SQL DB with ACID compliance is hard to scale 

b) Graph DB : Rejected

- Data model is not inherently graphical 

c) Persistent Key-value store : An option

- Most of the DB queries would be around slug 

- It is faster to read from a key-value store due to limited 

- Analytics will be taken care of separately 

- The clustered mode will be easy to scale

d) Document Store : An option

- Scalable 

- Queries from various fields of a document are supported 

- Data is not nested 

Based on the mentioned points, persistent Key-value store should be the best option for the same.

Can someone please help me out, if I missed anything in the consideration or if I may be wrong here. It would be of help.

If a persistent key-value store is best available option, then what is the correct way to select amongst the available options (REDIS, Couchbase, Aerospike, etc)

I make a todo app and try to put item from textview to listview with my custom adapter. I only get an error in my log no code errors

java.lang.ClassCastException: com.izildo.android.todoapp.MainActivity$1 cannot be cast to android.content.Context at com.izildo.android.todoapp.ItemAdapter.(ItemAdapter.java:24) at com.izildo.android.todoapp.MainActivity$1.onClick(MainActivity.java:45)

this are the two places where I get a error from in the log

temAdd.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            itemsList.add(new Items(itemT));

            itemAdapter = new ItemAdapter(this, itemsList);
            listView.setAdapter(itemAdapter);

            showToast("oke");
        }
    });

 public ItemAdapter(@NonNull View.OnClickListener context, @SuppressLint("SupportAnnotationUsage") @LayoutRes ArrayList<Items> list){
    super((Context) context, 0, list);
    mContext = (Context) context;
    itemsList = list;
}

I think it has something to do with this object I make.

 itemText = findViewById(R.id.item_text);
    final String itemT = itemText.getText().toString();

I am doing research for developing a software platform and I have created some class diagrams for the platform. My supervisor adviced me to use UML profiles as well to describe the platform in a more detailed way. However, after googling i still do not really get the difference between the Class diagrams and UML profiling. At the moment I do not think you can connect them. Can anybody help me with my question?

an overview of the IELTS test#+380981738653

sample questions

sample answers

tips and advice to succeed

preparation options+237654759239 https://ieltswithoutexamindia.page.tl/

I want to take print out from thermal printer by using BLE command from iOS App. For that, I have used Printer library from COCOAPODS. I am using cashino ptp-ii printer to take print out from. In my code when I start printing data(Image) on button click, printer just starts printing blank pages and doesn't stop printing and I've to manually turn it off to stop it. Below is my code that I've used to print:

  let image = UIImage(named: "demo")!

    if pm.canPrint {

        if let data = UIImageJPEGRepresentation(image, 1.0) {

            var receipt = Receipt(
                data
            )

            receipt.feedLinesOnTail = 2
            receipt.feedPointsPerLine = 60
            pm.print(receipt)
        }

    } else {

        performSegue(withIdentifier: "ShowSelectPrintVC", sender: nil)
    }

If user make In-App Purchase in iOS application, could him make refund in application after this? Does Apple Pay allows it?

I have to show and hide a div on triple click on body of my website in mobile devices the below code that I wrote in JavaScript is work fine in android devices but it doesn't work in IOS. so would you please help me to resolve it?

the code is :

window.onload = function() {

  document.querySelector('body').addEventListener('click', function(evt) {

    evt.preventDefault();
    if (evt.detail === 3) {
      document.getElementById('mmu').style.height = '100px';
    }

    if (evt.detail === 1) {
      document.getElementById('mmu').style.height = '0px';
    }

  });

}
#mmu {
  width: 100px;
  height: 0px;
  position: fixed;
  left: 0;
  cursor: pointer;
  top: 0;
  background: red;
}

body {
  height: 1000px;
  background: #eee;
  width: 100%;
  cursor: pointer;
}
<div id="mmu"></div>

I Have a one problem, In ARView Display Shadow on object but did not display on surface, I have attached tray code? It is working Display shadow on object but do not display on surface. Show Image

Code : var light2 = SCNLight() [enter image description here][1]var lightNodeb2 = SCNNode() light2.castsShadow = true light2.automaticallyAdjustsShadowProjection = true light2.maximumShadowDistance = 40.0 light2.orthographicScale = 1 light2.type = .directional light2.shadowMapSize = CGSize(width: 2048, height: 2048) light2.shadowMode = .forward light2.shadowSampleCount = 128 light2.shadowRadius = 3 light2.shadowBias = 32 light2.zNear=1; light2.zFar=1000; lightNodeb2.light = light2 lightNodeb2.position = SCNVector3(x: -1, y: 10, z: 1) lightNodeb2.rotation = SCNVector4Make(2, 0, 0, -Float.pi / 3) self.sceneView.scene.rootNode.addChildNode(lightNodeb2)

I have first encountered this strange behaviour in my main app which is currently in development. In order to debug the issue i created a test app. The test app has only one activity MainActivity which extends Activity. The theme for this activity is AppTheme.NoActionBar declared in styles.xml

    <style name="AppTheme">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <style name="AppTheme.NoActionBar" parent="AppTheme.Base">
        <item name="android:windowTranslucentStatus">true</item>
        <item name="android:windowTranslucentNavigation">true</item>
    </style>

    <style name="AppTheme.Base" parent="Theme.MaterialComponents.Light.NoActionBar">
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
    </style>

With this the output looks like this Image 1 Image 1.

Then i have added another styles.xml(v23) and changed the statusbar color and set "android:windowLightStatusBar" to true

   <style name="AppTheme.NoActionBar" parent="AppTheme.Base">
        <item name="android:statusBarColor">@android:color/transparent</item>
        <item name="android:windowLightStatusBar">true</item>
        <item name="android:windowTranslucentNavigation">true</item>
   </style>

With this i got this result . Image 2 image 2

Then i removed

<item name="android:windowTranslucentNavigation">true</item>

from styles.xml(v23) and the result confused me. It looked like this:

Image 3 image 3, Please notice the padding at the top

I am unable to understand how the padding gets added at the top of the status bar

I know the question will confuse a lot of you reading this. But how can adding a attribute

<item name="android:windowTranslucentNavigation">true</item>

which has nothing to do with status bar is effecting it.

The layout code

<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#D61010"
    tools:context=".MainActivity">

    <androidx.appcompat.widget.Toolbar
        android:layout_width="match_parent"
        android:layout_height="56dp"
        android:background="#FFFFFF"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:title="Home" />

    <ImageView
        android:layout_width="195dp"
        android:layout_height="195dp"
        android:background="@drawable/shadow"
        android:src="@mipmap/ic_launcher"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:ignore="contentDescription" />

</androidx.constraintlayout.widget.ConstraintLayout>

How the padding is getting added to the top when i remove this line "android:windowTranslucentNavigation"=true

My test device is running on android Pie

I am getting some data using Intent from A activity to B activity. And I show the text in B activity. But When I go to C Activity and I want to come back to B activity, the text that I have show there, vanished. So I need to save the data at B Activity When I come back from C Activity to B Activity.

I'm trying to open SignIn Configuration in andrroid but i can't open it. Whenever i try to that error eccur , i don't know what is the reason that. When i use Log , it print "success". I could not solve that problem, please help. Look at my code

/// class Login : public class LoginActivity extends AppCompatActivity {

    private EditText loginEmail, loginPass;
    private FirebaseAuth mAuth;
    private DatabaseReference mDatabase;
    private Button loginBtn;
    private SignInButton sButton;
    static ProgressDialog mProgress;
    private GoogleApiClient mGoogleApiClient;
    private static final int RC_SIGN_IN= 1;
    private FirebaseAuth.AuthStateListener mAuthListener;
    private static final String TAG ="LOGINACTIVITY :";


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        mProgress = new ProgressDialog(this);
        sButton=(SignInButton)findViewById(R.id.google_button);
        loginBtn =(Button)findViewById(R.id.loginBtn);
        loginEmail =(EditText)findViewById(R.id.login_email);
        loginPass  =(EditText)findViewById(R.id.login_password);
        mAuth = FirebaseAuth.getInstance();
        mDatabase = FirebaseDatabase.getInstance().getReference().child("Users");
        mDatabase.keepSynced(true);
        mAuthListener = new FirebaseAuth.AuthStateListener() {
            @Override
            public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
                if (mAuth.getCurrentUser()==null){
                    Intent loginIntent = new Intent(LoginActivity.this, RegisterActivity.class);
                    loginIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
                    startActivity(loginIntent);
                }
            }
        };

        loginBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //Toast.makeText(LoginActivity.this, "PROCESSING....", Toast.LENGTH_LONG).show();
                String email = loginEmail.getText().toString().trim();
                String password = loginPass.getText().toString().trim();

                if (!TextUtils.isEmpty(email) && !TextUtils.isEmpty(password)){
                    mProgress.setMessage("Check login....");
                    mProgress.show();
                    mAuth.signInWithEmailAndPassword(email,password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
                      @Override
                        public void onComplete(@NonNull Task<AuthResult> task) {

                     if (task.isSuccessful()){
                             mProgress.dismiss();
                             checkUserExistence();
                          }else{
                            mProgress.dismiss();
                            Toast.makeText(LoginActivity.this, "Couldn't login, User not found", Toast.LENGTH_SHORT).show();
                        }
                        }
                    });
                }else {
                     Toast.makeText(LoginActivity.this, "Complete all fields", Toast.LENGTH_SHORT).show();
                }
            }
        });

        // Configure Google Sign In
        GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                .requestIdToken(getString(R.string.default_web_client_id))
                .requestEmail()
                .build();
        mGoogleApiClient = new GoogleApiClient.Builder(getApplicationContext()).enableAutoManage(this, new GoogleApiClient.OnConnectionFailedListener() {
            @Override
            public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
                Toast.makeText(LoginActivity.this, "get error", Toast.LENGTH_LONG).show();
            }
        }).addApi(Auth.GOOGLE_SIGN_IN_API,gso).build();


        sButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                signIn();
            }
        });
    }


    @Override
    protected void onStart() {
        super.onStart();
        //  checkUserExistence();
       // mAuth.addAuthStateListener(mAuthListener);
    }

    private void signIn(){
        Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
        startActivityForResult(signInIntent, RC_SIGN_IN);
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
         //Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);
        if(requestCode == RC_SIGN_IN){
         // mProgress.setMessage("Starting sighn in....");
         //  mProgress.show();
            Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
            try {
                // Google Sign In was successful, authenticate with Firebase
                Log.w(TAG, "Google sign in Successful");
                 GoogleSignInAccount account = task.getResult(ApiException.class);
                firebaseAuthWithGoogle(account);
            }catch (ApiException e) {
             //Google Sign In failed, update UI appropriately
              Log.w(TAG, "Google sign in failed", e);
           //     mProgress.dismiss();
             // ...
            }
        }
 }


private void firebaseAuthWithGoogle(GoogleSignInAccount account) {
    AuthCredential credential = GoogleAuthProvider.getCredential(account.getIdToken(), null);
    mAuth.signInWithCredential(credential)
            .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    Log.d(TAG, "signInWithCredential:success" + task.isSuccessful());
                    if (!task.isSuccessful()) {
                        // Sign in success, update UI with the signed-in user's information
                      Toast.makeText(LoginActivity.this, "Aut field", Toast.LENGTH_LONG).show();
                      Log.d(TAG, "signInWithCredential:success");
                    }
                 }
             });
        }


    public void checkUserExistence(){
        final String user_id = mAuth.getCurrentUser().getUid();
         mDatabase.addValueEventListener(new ValueEventListener(){
          @Override
            public void onDataChange(DataSnapshot dataSnapshot){
                if (dataSnapshot.hasChild(user_id)){
                    Intent intent = new Intent(LoginActivity.this, SutepActivity.class);
                    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                    startActivity(intent);
                    //startActivity(new Intent(LoginActivity.this, MainActivity.class));
                }else {
                     //Toast.makeText(LoginActivity.this, "User not registered!", Toast.LENGTH_SHORT).show();
                    Intent intent = new Intent(LoginActivity.this, SutepActivity.class);
                    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                    startActivity(intent);
                }
            }
            @Override
            public void onCancelled(DatabaseError databaseError) {

            }
        });
    }
}



// gradl : 

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
        maven { url "https://jitpack.io" }
        mavenCentral()
        mavenLocal()
    }

    dependencies {


     // classpath 'com.android.tools.build:gradle:2.3.3'
      //  classpath 'com.google.gms:google-services:4.2.0'
        classpath 'com.android.tools.build:gradle:2.3.3'

        classpath 'com.google.gms:google-services:4.2.0'

        // classpath 'com.google.gms:google-services:3.0.0'
       //classpath 'com.google.gms:google-services:4.0.1'
   //     classpath 'com.google.gms:google-services:3.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}



allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
        maven { url "https://jitpack.io" }
        mavenCentral()
        mavenLocal()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

// 
apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
     buildToolsVersion "28.0.3"

    dexOptions {
        //javaMaxHeapSize "2048M"

        preDexLibraries = false
        javaMaxHeapSize "2g"
       // javaMaxHeapSize "2g"
    }

    configurations.all {
        resolutionStrategy.force 'com.android.support:multidex:1.0.3'
    }


    defaultConfig {
        applicationId "com.ahmed.ekene.blogzone"
        // Enabling multidex support.
        multiDexEnabled true
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}



dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    //compile 'com.android.support:multidex:1.0.3'
    compile 'com.android.support:appcompat-v7:28+'
    compile 'com.android.support:design:28.0.0'
    compile 'com.android.support:cardview-v7:28.0.0-alpha1'
    compile 'com.android.support:recyclerview-v7:28.0.0-alpha1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.theartofdev.edmodo:android-image-cropper:2.5.+'
    compile 'com.firebaseui:firebase-ui-database:0.4.4'
    compile 'com.google.firebase:firebase-core:16.0.8'
    // compile 'com.google.firebase:firebase-database:10.0.1'



    /// instance
    compile 'com.google.firebase:firebase-database:16.1.0'
    compile 'com.google.firebase:firebase-storage:16.1.0'
    //compile 'com.google.firebase:firebase-core:9.6.1'
    compile 'com.google.firebase:firebase-auth:16.2.1'
    compile 'com.google.android.gms:play-services-auth:16.0.1'
    //implementation 'com.squareup.picasso:picasso:2.71828'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
    testCompile 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'

I want to play/stream audio from url one after other automatically.

here what i have done:

final String audioUrl[] = {"https://www.googleapis.com/storage/v1/b/ezconnectpoc/o/NV.wav?alt=media", "https://www.googleapis.com/storage/v1/b/ezconnectpoc/o/cqo.wav?alt=media"};

backtobackButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
                try {

                    mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
                    mediaPlayer.setDataSource(audioUrl[currentTrack]);
                    mediaPlayer.prepareAsync();


                    mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                        @Override
                        public void onPrepared(MediaPlayer mp) {
                            mediaPlayer.start();

                        }
                    });

                    mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
                        @Override
                        public void onCompletion(MediaPlayer mp) {
                            try {

                                Log.d("Current track",currentTrack+"");
                                Log.d("audioUrl.length",audioUrl.length+"");
                                if (currentTrack < audioUrl.length) {
                                    currentTrack++;
                                    mediaPlayer.setDataSource(audioUrl[currentTrack]);
                                    mediaPlayer.setOnCompletionListener(this);
                                    mediaPlayer.start();
                                }


                                mediaPlayer.stop();
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                        }
                    });


                } catch (Exception e) {
                    e.printStackTrace();

                    // make something
                }
            }
    });

but here first audio url gets played when i click on backtoback named button but failed to play second audio from url.

i have tried a lot to make the modal class but i got stuck in this point. please help me out how i should create the Modal Class for this Api

link: https://raw.githubusercontent.com/iranjith4/radius-intern-mobile/master/users.json