Z-Stream is an HTTP library that makes networking for Android apps easier and, most importantly, faster.
For information on how to get started with Z-Stream, take a look at our Getting Started guide.
Bugs or feature requests should be submitted at our GitHub Issues section.
Z-Stream for Android is available through Google's Maven Repository. To use it:
-
Open the
build.gradle
file for your application. -
Make sure that the
repositories
section includes Google's Maven Repositorygoogle()
. For example:allprojects { repositories { google() jcenter() } }
-
Add the library to the
dependencies
section:dependencies { // ... implementation 'com.zeoflow:z-stream:<version>' // ... }
MainActivity.java
public class MainActivity extends AppCompatActivity
{
//..
@Override
protected void onCreate(@Nullable Bundle savedInstanceState)
{
//..
String url = "opensource.zeoflow.com/zstream";
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest
(Request.Method.GET, url, null, new Response.Listener<JSONObject>()
{
@Override
public void onResponse(JSONObject response)
{
textView.setText("Response: " + response.toString());
}
}, new Response.ErrorListener()
{
@Override
public void onErrorResponse(ZStreamError error)
{
// TODO: Handle error
}
});
// Access the RequestQueue through your singleton class.
MySingleton.getInstance(this).addToRequestQueue(jsonObjectRequest);
//..
}
//..
}
Copyright 2020 ZeoFlow
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.