Downloaded .APK showing activity names at the top of the app? - android

I am having an android app developed and the developer sent me the .APK file so I can test the first version. I have successfully installed the .APK file on my Android device. However, when I run it, the app shows the name of each activity (with the app's logo) at the top, as shown in the following link http://www.quickid.net/activity.JPG (StackOverflow won't let me post images without a level 10 reputation). The left picture shows the MainActivity, and the right picture shows the startTrail activity. So, what's up with that? Is it some kind of test mode? How can I run the app as it would normally be run as if it were downloaded from the Play store, without it showing the activity names at the top? Also, when the app puts text in the notification bar, it says "Rolling text on statusbar" before showing the text.

That is the ActionBar, if the developer does not want to use it, he must change the default theme to Theme.Holo.NoActionBar or another that hides the action bar.

At the top of most activities is the activity's label. This is set in the App Manifest (AndroidManifest.xml). In <activity> you can add the attribute android:label.
By default it looks so:
<activity android:name=".Activity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
If you want to change the label, add a String value, and put this to android:label. If you want no label, add android:theme="#android:style/Theme.NoTitleBar". So it looks like this:
<activity android:name=".Activity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Related

How to sort my app widgets when adding a new one?

My app has several widgets. Each of them is declared in the Manifest file with something like this:
<receiver
android:name=".MyWidgetProvider1"
android:exported="false"
android:icon="#drawable/MyIcon1"
android:label="First widget">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/WidgetLayOut" />
</receiver>
I have 5 of them. Right now when long-pressing on the home screen the System shows the different apps with widgets. When tapping on my app, then the System expands and shows a list with the 5 available widgets that my app has. Good so far.
The problem is the widgets are sorted by the name. Can I choose how they are displayed? I would like to change the order of the list.
Changing the order in the manifest file doesn't help.

Android application is installing two launcher icons

This is not a duplicate of Android Application creating two launcher icons (I don't have multiple LAUNCHER definitions in my manifest), nor Android Application Creating Two Launcher Icons instead of One (a restart of the device does not remove the second launcher icon).
My android application is creating two launcher icons, but one of them seems to be coming from the application itself, rather than any activity. I've cropped my AndroidManifest.xml to the smallest it can be (plus clean and rebuild and reinstall), and I am still getting two icons (on both my HTC One M8 physical phone and my Nexus 5 emulator):
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".SplashActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
There is nothing else in my manifest.
...does the application itself as I've defined it create an icon somehow? Or is there some other way that I'm ending up with multiple launcher icons?
If I move the android:label and android:icon features into the .SplashActivity definition, one of the launcher icons created is replaced with the default little green robot icon.
Activities and other bits of manifest-y goodness come from a variety of sources:
the manifest in your main sourceset
the manifest in any build type or product flavor sourceset
the manifest in any library module or AAR
Gradle (e.g., minSdkVersion)
Android Studio 2.2 gave us a convenient tool to examine the real manifest that goes into our APKs, merged from all those sources. If you open the manifest in Android Studio, click over on the "Manifest Merger" sub-tab (towards the bottom of the IDE). That will show what is in the merged manifest and who is to blame for it where it came from.
If you see other activities in there besides the one in your manifest, that is the source of your launcher icon. Then, you'll need to decide:
is that activity something you really want?
if not, is the source of that activity something that you really want? (if not, nuke it)
if you want the source but not the activity, you can rig up another activity element in your manifest, with a tools:replace attribute, to override the one from the library and suppress the <intent-filter>
My problem was, that I've added the following intent-filter to multiple Activities. Configured it for one Activity fixed the issue for me.
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

Android design and output not match

I'm new in Android and want to know why my app deisgn isn't same as what i deisgn in Android studio. Here is the image link:
1.Why on the top banner will appear "INC AIO" string? Is this related to the layout?How to remove?
2.Why the login button will locating too close with the password text field, not like my design?
Hope can get help frpm here. Thanks.
This is ActionBar, u can remove it, here is answer how.
U need to show us your layout file (.xml)
In AndroidManifest.xml you need to add theme inside your activity tag... to remove action bar from top.
just add this code: android:theme="#style/Theme.AppCompat.NoActionBar"
with no action bar.
example:
<activity
android:name="com.example.MainActivity"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

Changing Orientation in Bluestacks to test Orientation Change of my App

Android Emulator 4.4 apparently has a bug which keeps it from changing rotation appropriately. Having heard that Bluestacks is faster anyway, I wanted to give it a shot, but I can't find a way to change my orientation while in my app. My app launches in the full tablet-sized screen of Bluestacks and that's that. The system tray options don't help. I want Bluestacks to look and behave like a standard android phone, with the ability to rotate.
It looks like other versions of Bluestacks have had a rotation button (and other buttons)? I find references to this, but it's not in the latest version I downloaded. Any ideas?
Using the icon on the system tray, setting it to enabled worked for me.
You also have to check if you are forcing the portrait orientation on your manifest. I had to put the tag on every Activity tag, not on the application tag. Like this:
<activity android:name="com.example.LoginActivity"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.MainActivity"
android:screenOrientation="portrait">
</activity>

Android -- How to disscociate the name of the application from the titlebar?

I added a custom title-bar to an android application and this titlebar (which is a plain png) shows up inside the main activity. The problem is that the main activity also defines the name of the application using the label tag like this:
<activity android:name=".MainActivity"
android:theme="#style/customTheme"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
And this label is also reported on the titlebar! How to dissociate the two? (Like basically, still be able to give a name to the application without affecting my custom title-bar).
Thanks!
You can change the header of any activity by using setTitle("THE TITLE"); in the java code for the page. If you want to use a string defined in the XML FILES, you can use setTitle(R.string.stringName).
My opinion is to create your own custom title bar in the top of the screen and set the no title bar option in the manifest for the activity.
android:theme="#android:style/Theme.NoTitleBar"
try changing the label of your mainactivity to something like this android:label="#string/main_header" and define the string header in the strings.xml...
hope this good help you...

Categories

Resources