Thursday 23 March 2017

android Retrofit, Retro client multipart File upload with progress bar

android Retrofit, Retroclient multipart image File upload
android Retrofit, Retroclient multipart video File upload
android Retrofit, Retroclient multipart large image video File upload
android Retrofit, Retroclient multipart File upload with progress bar



public  void uploadFileToServer() {
            ApiInterface api =
                    ApiClient.getClient().create(ApiInterface.class);
            MultipartBody.Part body = prepareFilePart("image", selectedImageUri,new File(selectedPath));
            Call<ResponseBody> resultCall = api.uploadFile(body);
            resultCall.enqueue(new Callback<ResponseBody>() {
                @Override
                public void onResponse(Call<ResponseBody> call,
                                       Response<ResponseBody> response) {
                    Log.v("Upload", "success");
                }

                @Override
                public void onFailure(Call<ResponseBody> call, Throwable t) {
                    Log.e("Upload error:", t.getMessage());
                }
            });
    }
    
    @NonNull
    private MultipartBody.Part prepareFilePart(String partName, Uri fileUri,File file) {
        RequestBody requestFile =
                RequestBody.create(
                        MediaType.parse(getContentResolver().getType(fileUri)),
                        file
                );
        return MultipartBody.Part.createFormData(partName, file.getName(), requestFile);
    }
Interface ApiInterface.java

public interface ApiInterface {

@Multipart
        @POST("uploadfile.php")
        Call<ResponseBody> uploadFile(
        @Part MultipartBody.Part file);
}

Class ApiClient.java
public class ApiClient {

    private static final String BASE_URL = "Your Post File url";
    private static Retrofit retrofit = null;


    static OkHttpClient client = new OkHttpClient.Builder()
            .followRedirects(true)
            .connectTimeout(0, TimeUnit.MILLISECONDS)
            .readTimeout(0, TimeUnit.MILLISECONDS)
            .build();

    public static Retrofit getClient() {
        if (retrofit == null) {
            retrofit = new Retrofit.Builder()
                    .baseUrl(BASE_URL)
                    .client(client)
                 .addConverterFactory(GsonConverterFactory.create())
                    .build();
        }
        return retrofit;
    }
}





android Retrofit, Retroclient multipart image File upload
android Retrofit, Retroclient multipart video File upload
android Retrofit, Retroclient multipart large image video File upload
android Retrofit, Retroclient multipart File upload with progress bar



Monday 27 February 2017

Android Augmanted Reality - AR Geolocation Based Marker Video Playback Android Source Code



Augmanted Reality is one of best futuristics task, Nowadays , AR -Augmanted Reality and VR - Virtual Reality take place in market.
Every Smartphone and desktop application takes place in AR and VR.
There are many types of Virtual Reality - Augmanted Reality  SDk and Framework available

geolocation Based Marker
Location-based Points of Interest
Radar View, POI Sorting and Stacking
Image Targets
Object Recognition
Multi Object Targets
User Defined Object Targets
Cloud Object Recognition
Text Recognition
Video Playback on Object


Download working Sample of geolocation Based Marker video Playback android Example from below path
https://drive.google.com/file/d/0B5chRybMYYiqbXBRS2FvWHBFQmc/view?usp=sharing






geolocation, Ar Geolocation Video, cloud recognize, Object Recognition, Text Recognition, Cloud Recognition, Image Targets, Video Playback, Augmanted Reality, Virtual Reality, AR Android


Android Augmanted Reality - Image target Recognition Video Playback Android Source Code

Augmanted Reality is one of best futuristics task, Nowadays , AR -Augmanted Reality and VR - Virtual Reality take place in market.

Every Smartphone and desktop application takes place in AR and VR.
There are many types of Virtual Reality - Augmanted Reality  SDk and Framework available


  • geolocation Based object target
  • Location-based Points of Interest
  • Radar View, POI Sorting and Stacking
  • Image Targets
  • Object Recognition
  • Multi Object Targets
  • User Defined Object Targets
  • Cloud Object Recognition
  • Text Recognition
  • Video Playback on Object



Download working Sample of Image target Recognition video Playback android Example from below path
https://drive.google.com/file/d/0B5chRybMYYiqb3lmUW50eS02SVE/view?usp=sharing


In this, android Vudoria Image target , object Recognition sample recognize Image object and play video on exact object position.
First change Licence Key from SampleApplicationSession.java  file, Put your key-
 Vuforia.setInitParameters(mActivity, mVuforiaFlags, "YOUR KEY HERE");


You have to provide video file path from VideoPlayback.java

mMovieName[STONES] = Environment.getExternalStorageDirectory() + "/" + "xyz1.mp4";
        mMovieName[CHIPS] = Environment.getExternalStorageDirectory() + "/" + "xyz12.mp4";
     

Enjoy Coding...







Android Augmanted Reality - Cloud Recognition Video Playback Android Source Code

Augmanted Reality is one of best futuristics task, Nowadays , AR -Augmanted Reality and VR - Virtual Reality take place in market.
Every Smartphone and desktop application takes place in AR and VR.
There are many types of Virtual Reality - Augmanted Reality  SDk and Framework available


  • geolocation Based object target
  • Location-based Points of Interest
  • Radar View, POI Sorting and Stacking
  • Image Targets
  • Object Recognition
  • Multi Object Targets
  • User Defined Object Targets
  • Cloud Object Recognition
  • Text Recognition
  • Video Playback on Object



Download working Sample of Cloud Recognition android Example from below path

https://drive.google.com/file/d/0B5chRybMYYiqZUE5a3dkM0h0TlE/view?usp=sharing


In this, android Vudoria Cloud Recognition sample recognize cloud object and play video on exact object position.
First change Licence Key from Constant.java file, Put your key- VUFORIA_LICENSE_KEY="";
Then change kAccessKey and kSecretKey from CLoudReco.java file

    private static final String kAccessKey = "9f1589a795e4f87fe55ba63b27d477beb41ba078";
    private static final String kSecretKey = "d3e2826215e32f60b698cc697d840f28cc224f11";

You have to provide video file path from CLoudReco.java

mMovieName = Environment.getExternalStorageDirectory() + "/" + "3_F31_DEK_NanoUltra_EN_23012016.mp4";

Enjoy Coding.....