java – Modifying the resource image of Progress Bar-ThrowExceptions

Exception or error: I want to create a progress bar for Android. I have four images for my square shaped progress bar. I am using the android defined progress bar: <ProgressBar android:layout_width=”wrap_content” android:layout_height=”wrap_content” style=”@android:style/Widget.ProgressBar.Small” android:layout_marginRight=”5dp” /> But if I want to make a square instead of the circle how can I do it? How do …

java – How do I use FragmentPagerAdapter to have tabs with different content?-ThrowExceptions

Exception or error: I want to have different tabs, where you can swipe through like in the android market. Each tab should use one fragment and use one method for it. This is my FragmentPagerAdapter class: public class SectionsPagerAdapter extends FragmentPagerAdapter { public SectionsPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int position) { Fragment …

java – Cannot read packageName from AndroidManifest.xml-ThrowExceptions

Exception or error: I have errors in my android manifest file: Error:Cannot read packageName from C:\Users\brandon\AndroidStudioProjects\MineDodge2\app\src\main\AndroidManifest.x‌​ml Error:The markup in the document preceding the root element must be well-formed. I tried to look on this website but the answers aren’t working for me. <?xml version=”1.0″ encoding=”utf-8″?> < manifest xmlns:android=”http://schemas.android.com/apk/res/android” package=”com.example.brandon.MineDodge” > <application android:allowBackup=”true” android:icon=”@mipmap/redjet” android:label=”@string/app_name” android:theme=”@style/AppTheme” …

java – Chat App for Android using a XMPP Server and Google Cloud Messaging (or the newer Firebase Cloud Messaging) for Push Notifications-ThrowExceptions

Exception or error: I’m developing a Chat App for Android. I have been reading for weeks about XMPP and Google Cloud Messaging (and Firebase Cloud Messaging) and I am still very confused. Currently, I already setup an XMPP server locally (Ejabberd) and successfully connected my Android App to it using the Smack library. To my …

java – Samsung Galaxy S8 full screen mode-ThrowExceptions

Exception or error: Latest Samsung’s smartphone has interesting feature called full screen (or in marketing terms infinity display). In this mode app covers also part of display where home/back buttons are. Usual apps don’t cover this area, leaving it black. But Samsung’s native ones cover this area. Question: how to achieve this effect? I mean …

java – Initialize int to 0 or not?-ThrowExceptions

Exception or error: In the android source code I see they define four variables as protected int mPaddingRight = 0; protected int mPaddingLeft = 0; protected int mPaddingTop; protected int mPaddingBottom; In Java, what is the difference in initializing a variable to 0 or not? I don’t understand that in some compilers I cannot do …

java – What is Type & TypeToken?-ThrowExceptions

Exception or error: I have the following method in my project public void execute(final int apiId, final ResponseHandler handler, final Type type) and the type is determined using TypeToken as follows final Type serviceErrorType = new TypeToken<>() { }.getType(); I went through this link here but couldn’t understand completely about Type and TypeToken Can anyone …