Developing Android Apps

Subscribe to Developing Android Apps feed
News for Android developers with the who, what, where when and how of the Android community. Probably mostly the how. Here, you'll find: - News for Android developers - Thoughtful, informative articles - Insightful talks and presentations - Useful libraries - Handy tools - Open source applications for studyingDeveloping Android Apps
Updated: 12 min 34 sec ago

Would it be possible to achieve this sort of idea without a central server?

Fri, 03/16/2018 - 22:02

I've never worked with Android game development before, however I've built multiplayer systems before.

I basically want to make a game where 2 player can challenge each other to a duel, both players needing to accept, then the duel plays out and both players get the result, the players not actually doing anything during. Could I do something where if both players get an "ok" to start the duel it plays out. I suppose there are a lot of issues that arise like both of them getting different results if anything is left to a chance, and people being able to modify locally.

submitted by /u/OverRatedProgrammer
[link] [comments]
Categories: Android, Linux

Emulator 27.2.1 canary

Fri, 03/16/2018 - 21:45
Categories: Android, Linux

Possible to run a Android Studio Emulator without GPU and Google Play Store build in?

Fri, 03/16/2018 - 18:41

Hey there,

i am struggling for days with getting any android device emulated including Google Play Store App.

For hardware reasons i am not able to get OpenGL working on my server i want to run the emulated device and therefor can run devices only with Software GLES.

Now i can't find any system image for Nexus5/5x or others where Google Play Store App is included.

If its included i can't switch off GPU.

So i ask my self if and how its possible to run the emulator with GPU off + Google Play Store App.

Appreaciate any help

By the way these errors i get when trying to run the Emulator with GPU on.

10:14 PM Emulator: failed to create drawable 10:14 PM Emulator: getGLES2ExtensionString: Could not create GLES 2.x Pbuffer! 10:14 PM Emulator: Failed to obtain GLES 2.x extensions string! 10:14 PM Emulator: Could not initialize emulated framebuffer 10:14 PM Emulator: pulseaudio: pa_context_connect() failed 10:14 PM Emulator: pulseaudio: Reason: Connection refused 10:14 PM Emulator: pulseaudio: Failed to initialize PA context 10:14 PM Emulator: audio: Could not init `pa' audio driver 10:14 PM Emulator: emulator: ERROR: Missing initial data partition file: /root/.android/avd/Nexus_5X_API_25.avd/userdata.img 10:14 PM Emulator: emulator: ERROR: Could not initialize OpenglES emulation, use '-gpu off' to disable it. 10:14 PM Emulator: Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

submitted by /u/mediaonline
[link] [comments]
Categories: Android, Linux

How to get xml layout to split into 3 sections with dividers

Fri, 03/16/2018 - 18:36

Here is my current code:

<RelativeLayout xmlns:android=" android" android:layout_width="match_parent" android:layout_height="match_parent" > <!-- An invisible view aligned to the center of the parent. Allows other views to be arranged on either side --> <View android:id="@+id/centerShim" android:layout_height="match_parent" android:layout_width="0dp" android:visibility="invisible" android:layout_centerHorizontal="true"/> <RadioGroup android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_toLeftOf="@+id/centerShim" > <RadioButton android:id="@+id/radio_one" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Adjectives"/> <RadioButton android:id="@+id/radio_two" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Nouns"/> <RadioButton android:id="@+id/radio_three" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Verbs"/> <RadioButton android:id="@+id/radio_four" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Other"/> </RadioGroup> <Button android:id="@+id/btRight" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_toRightOf="@+id/centerShim" android:text="Add 'text' to the Haiku " /> </RelativeLayout>

It needs to be split up like using dividers:

It currently looks like this:

I just can't figure out how to get the layout split into 3 separate sections with the dividers like in the above image. Thanks!

submitted by /u/Choonmachine
[link] [comments]
Categories: Android, Linux

Dividing xml layout vertically and horizontally

Fri, 03/16/2018 - 17:40

I have to Split my android app layout width in Half and then I have to split my height into 3 sections: 25,25, and 50. I can not figure out the xml layout that will make my buttons only take up 25% height and 50% width. This is my current xml code. I need the radio group to the left and taking up 25% vertically and then the button to the right taking up 25% vertically. With them splitting the screen 50/50. Hopefully that makes sense. Here's my current code:

<LinearLayout xmlns:android=" " android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:weightSum="100"> <RadioGroup android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="25" > <RadioButton android:id="@+id/radio_one" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Nouns"/> <RadioButton android:id="@+id/radio_two" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Two"/> <RadioButton android:id="@+id/radio_three" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Three"/> <Button android:id="@+id/button3" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button" /> </RadioGroup> </LinearLayout>

UPDATE: I was able to make changes and I can now control the percentage of the screen that the radio group takes up. Now I'm having trouble getting the button beside it and restricting both the radiogroup and the button to split the screen 50/50.

submitted by /u/Choonmachine
[link] [comments]
Categories: Android, Linux

Compiling GNU gettext using NDK

Fri, 03/16/2018 - 15:49

Dear Android Sirs,

if anyone has successfully compiled GNU gettext library that provides libintl et al. I wouldn't mind getting examples how to do it using android NDK. Extra bonus goes to compile-script provider whose script produces a library that also works on device, preferably arm device.

I've been doing to do this for several days now, latest error message is that the library is defining memcpy function twice but the second definition is static version of the function while previous versions are not - I can't spot the differing definitions but gettext is rather popular library so someone must have done this before so please help.

submitted by /u/operatornormal
[link] [comments]
Categories: Android, Linux

Make sure you are using the most effective ads for your app

Fri, 03/16/2018 - 15:03

Ad mediation is by far the preferred choice. This is because it allows developers to automatically choose the best yielding ad networks at the moment. The ideal ad mediation platform should also let you choose who (which users) sees the ads, and where they see them. This is very useful to figure out which ad strategy works better. This is how you can do it:

submitted by /u/YvonneBriones
[link] [comments]
Categories: Android, Linux

How are API keys safe?

Fri, 03/16/2018 - 14:51

Been focussing on securing my backend apis and I was just thinking that I ship my app with plenty of api keys for different 3rd party services.

What happens if someone hijacks my api key? Revoking? Rotation of the key? Are any of these things really important.

submitted by /u/leggo_tech
[link] [comments]
Categories: Android, Linux

New changes coming to the play store listing!

Fri, 03/16/2018 - 13:49

Have you noticed the new changes made to the play store listing? The ranking list is now vertical showing also the count of thumbs up for each comment.


And this is the old version (Friend Computer):

submitted by /u/medyo
[link] [comments]
Categories: Android, Linux

Building a React Native Application - Caster.IO course is free this week

Fri, 03/16/2018 - 09:30

The entire course is free this week (they are doing this for new courses now, for their first week).

In this course, you’ll learn how to build a cross-platform React Native ToDo Application from the ground up. This course is taught by Chris Achard and he has you covered from the bottom to the top; you’ll learn how to: Use components Pass props to those components Style your components Use lists with your data Refactor common code into a shared library Utilize third-party libraries Connect to a remote API (written in Node.js - also available for download so you can run that sucker on your machine too) Implement navigation Work with images Perform platform specific code for Android and iOS … and package up that bad boy into an APK and IPA file to release on Google Play and the App Store … and much more

submitted by /u/boogermike
[link] [comments]
Categories: Android, Linux

Weekly "anything goes" thread!

Fri, 03/16/2018 - 08:41

Here's your chance to talk about whatever!

Although if you're thinking about getting feedback on an app, you should wait until tomorrow's App Feedback thread.

Remember that while you can talk about any topic, being a jerk is still not allowed.

submitted by /u/AutoModerator
[link] [comments]
Categories: Android, Linux

360|AnDev needs our help!

Fri, 03/16/2018 - 06:28
Categories: Android, Linux

Please recommend a good document scanning Android SDK

Fri, 03/16/2018 - 05:52

I am building an app which requires document scanning capabilities. So I have tried CamScanner and Scanbot SDK.

The pricing however for both these SDK is quite high. 35,000 USD for CamScanner and 12,500 EUR for Scanbot SDK.

Can anyone recommend, a document scanning SDK for Android? Paid or Open Source

submitted by /u/mayuroks
[link] [comments]
Categories: Android, Linux

Google Sign In on Android only work with one of my accounts for my app

Fri, 03/16/2018 - 05:17

I am currently making an Android game and I am using google sign in (for access to firebase, google leaderboard and achievement). I already integrated all of that and this is working fine. However I was always using my main google account but when I tried to change it to another account to have other people test it, it doesn't connect anymore.

I added the other account as a tester on the google play game service for my app. I believe I must have missed to add it somewhere but I cannot find where and I have been searching for hours.

Here's the code that should connect but doesn't:

@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case RC_SIGN_IN: GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data); if (result.isSuccess()) { GoogleSignInAccount x = result.getSignInAccount(); //x.getIdToken() is always null with the other account if (x.getIdToken() != null) firebaseConnect(x); else //I tried repeating the operation but won't work (...)

I also tried with different accounts but only my original one works. So do you have any idea of what I could have done that made this original account work and not any other? I did most of that Google Sign in parametrization long time ago so I don't remember in every details. And I am very desperate to debug that, after spending so much time trying to solve it in vain.

Thank you for any hint or help about that!

submitted by /u/Esplemea
[link] [comments]
Categories: Android, Linux

General question regarding API design in Android

Fri, 03/16/2018 - 03:13

tl;dr: What are your ways when it comes to designing APIs? Do you prefer throwing an exception when someone used it with a wrong parameter to fail fast? or to swallow and log it and go with the return default value?

public SpannableString doSomething(String originalText, String partText) { int startIndex = originalText.index(partText); int endIndex = originalText.lastIndexOf(partText) + partText.length(); // here is my question: is it better to if (startIndex < 0 || .. (possible wrong cases)) { throw new IllegalArgumentException("doSomething() consists of invalid parameters, please check. \n" + "Start Position: " + startPosition + "\n" + "End Position: " + endPosition + "\n" + "Original Text: " + originalText + "\n" + "Part Text: " + partText); } spannableString.setSpan(......); return spannableString; }


public SpannableString doSomething(String originalText, String partText) { int startIndex = originalText.index(partText); int endIndex = originalText.lastIndexOf(partText) + partText.length(); // or is it better to do this? if (startIndex >= 0 && .. (safe cases)) { spannableString.setSpan(....); } else { Log.w(TAG, "doSomething() consists of invalid parameters, please check. \n" + "Start Position: " + startPosition + "\n" + "End Position: " + endPosition + "\n" + "Original Text: " + originalText + "\n" + "Part Text: " + partText); } return spannableString; } submitted by /u/wotomas
[link] [comments]
Categories: Android, Linux