Send multipart file via RestTemplate

i have some problem about send image file (multipart) using android via Spring restTemplate. here is my controller on server : @RequestMapping(value = “/uploadPhoto/{id}”, method = RequestMethod.POST) @ResponseBody public ResponseEntity<String> uploadPhoto(@RequestParam(“file”) MultipartFile srcFile, @PathVariable(“id”) Integer id) { /// do something return RestUtil.getJsonSHttptatus(HttpStatus.NOT_ACCEPTABLE); } and this is rest request in my android activity private void doUpload(){ […]

Use xamarin to build a cross-platform library usable in native apps

I want to build an iOS native apps and an Android native apps. I want to keep the code that manage the views purely native, ie. write Java code for Android and Objective-C code for iOS. I would like to know if it is possible to build a library in C#, using Xamarin (or another […]

How facebook app implements draggable floating Button

I´m trying to get some information about how I could implement such a Button like Facebook does in the new version of the app. Actually I am not sure if this button comes from Facebook or from Facebook messenge app but it was the easiest way to have an example of what I would like […]

Does PhoneGap / Apache Cordova propose an API for encrypted SQLite database

I would like to know if it’s possible when using PhoneGap/ Apache Cordova to create/access and encrypted SQLite database. I read I can encrypt before storing/ decrypt after but that’s not what I am looking for. I am rather looking for a PhoneGap plugin or API using something like: http://sqlite-crypt.com/ Looking for something like this […]

Opening Camera in Portrait mode using Intent

I am able to open the device’s Camera from my Activity using an Intent as follows: Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); Uri fileUri = getOutputMediaFileUri(); cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); cameraIntent.putExtra(“android.intent.extras.CAMERA_FACING”, 1); startActivityForResult(cameraIntent, CAMERA_REQUEST); My problem is my Activity is set to Landscape mode, so when the camera is opened, it is also opened in Landscape mode – […]

Dealing with duplicate entries in AndroidStudio: java.util.zip.ZipException

EDIT: Solution from Error: java.util.zip.ZipException: duplicate entry doesn’t work here, because I don’t have problem with support-v4 module I’m trying to build an Android project which uses SpongyCastle, but unfortunately it requires javax.naming package from jndi library. I added jndi and even javaEE to make it work, but gradle still has problem with running a […]

How to send and receive Voice Stream using RTP

I am new in SIP call using RTP, now I am trying to send and receive voice streams using RTP for sip call. I am done with connecting two emulators and able to send INVITE and INVITE-ACK using jain sip. After I got an Ack I want to start RTP for media streaming, I use […]

how can define shortcuts to specific actions in the app?

If your app targets Android 7.1 (API level 25) or higher, how can define shortcuts to specific actions in the app. Shortcuts let users quickly start common or recommended tasks within your app.

Android Permission Denial if other app in not installed first

I am trying to read the content from a cursor like so: cursor = context.getContentResolver().query(TASKS_URI, null, null, new String[]{“-1”, “true”}, null); Where the TASKS_URI is: private final static Uri TASKS_URI = Uri.parse(“content://org.dayup.gtask.data/tasks”); So all i am trying to do is to get a cursor from another app. In my manifest.xml i define my permission as: […]

Calling finish() doesn't finish the activity

I want to finish my activity when it pauses for specific reasons. Up till recently my code was working perfectly but recently the finish() method stopped doing its job for some reason. Also, when the finish() method is called, I get the following LogCatmessage: 12-31 18:01:23.445: W/ActivityManager(481): Duplicate finish request for ActivityRecord{42465370 u11 “myapplicationpackage”} Could […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.