developer

How to add manifest permission to android application?

Question: ❓❓❓ I am trying to access HTTP link using HttpURLConnection in Android to download a file, but I am getting this warning in LogCat: WARN/System.err(223): java.net.SocketException: Permission denied (maybe missing INTERNET permission) I have added android.Manifest.permission to my application but its still giving the same exception. Good Answer: πŸ‘ŒπŸ‘ŒπŸ‘Œ Read more…

By admin, ago
developer

How do you change text to bold in Android?

Question: ❓❓❓ How do you change text/font settings in an Android TextView? For example, how do you make the text bold? Good Answer: πŸ‘ŒπŸ‘ŒπŸ‘Œ To do this in the layout.xml file: android:textStyle Examples: android:textStyle="bold|italic" Programmatically the method is: setTypeface(Typeface tf) Sets the typeface and style in which the text should Read more…

By admin, ago
developer

Android TextView Justify Text

Question: ❓❓❓ How do you get the text of a TextView to be Justified (with text flush on the left- and right- hand sides)? I found a possible solution here, but it does not work (even if you change vertical-center to center_vertical, etc). Good Answer: πŸ‘ŒπŸ‘ŒπŸ‘Œ I do not believe Read more…

By admin, ago
developer

google-services.json for different productFlavors

Question: ❓❓❓ I’m implementing the new Google Cloud Messaging following the guides from the Google Developers page here I’ve successfully run and test it. But my problem now is I have different productFlavors with different applicationId/packageName and different GCM Project Id. The google-services.json have to be put at the /app/google-services.json Read more…

By admin, ago
developer

Android Options Menu in Fragment

Question: ❓❓❓ I am trying to add an item to the options menu from a group of fragments. I have created a new MenuFragment class and extended this for the fragments I wish to include the menu item in. Here is the code: public class MenuFragment extends Fragment { MenuItem Read more…

By admin, ago
developer

Android Gradle plugin 0.7.0: β€œduplicate files during packaging of APK”

Question: ❓❓❓ Using Android Gradle plugin 0.7.0 with the following build.gradle: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.7.0' } } apply plugin: 'android' repositories { maven { url "https://android-rome-feed-reader.googlecode.com/svn/maven2/releases" } maven { url "http://dl.bintray.com/populov/maven" } mavenCentral() } android { compileSdkVersion 19 buildToolsVersion '18.1.1' defaultConfig { minSdkVersion 9 Read more…

By admin, ago