Status bar in app - Java for Android App Development

I created an app in landscape and no matter how many methods I try I can't remove the status bar. Any ideas? I can post the app if you like.

In your AndroidManifest.xml add the following in your activity tag:
Code:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
You'd then have something like this:
Code:
<activity android:name="ActivityName"
android:label="@string/activityName"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">

patedit said:
In your AndroidManifest.xml add the following in your activity tag:
Code:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
You'd then have something like this:
Code:
<activity android:name="ActivityName"
android:label="@string/activityName"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
Click to expand...
Click to collapse
This is my whole android manifest. I use a program that digitally signs my apk and it has features. One of the features is to auto add the fullscreen code and this is what it did.
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- ****
**** Generated by AppToMaret on Tue Apr 09 00:09:23 EDT 2013
**** If you wish, you can update this file to your needs.
**** If updating, it has to be done prior to clicking 'Create New .apk' button AppToMarket
**** However, please make sure that your updates WILL NOT break the functionality.
**** For example, removing permissions, could cause runtime exceptions
****
-->
<manifest android:versionCode="1"
android:installLocation="auto" android:versionName="1.2" package="com.appbuilder.u28941p382992"
xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:resizeable="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="false" />
<application android:label="Led Zeppelin Guitar Book" android:icon="@drawable/icon">
<activity android:label="@string/app_name" android:name=".AppBuilder" 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=".SplashScreen" android:screenOrientation="portrait" />
<activity android:name=".PushNotification.AppPushNotification" android:screenOrientation="portrait" />
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation" />
<activity android:name=".GPSNotification.GPSLocationMap" android:screenOrientation="portrait">
<uses-library android:name="com.google.android.maps" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name=".GPSNotification.GPSLocationText" android:screenOrientation="portrait" />
<activity android:name="com.ibuildapp.romanblack.CalculatorPlugin.CalculatorPlugin" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp.romanblack/calculator" />
</intent-filter>
</activity>
<activity android:name="com.ibuildapp.romanblack.CallPlugin.CallPlugin" android:screenOrientation="portrait" />
<activity android:name="com.ibuildapp.romanblack.ImagesPlugin.ImagesPlugin" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp.romanblack/images" />
</intent-filter>
</activity>
<activity android:name="com.ibuildapp.romanblack.ImagesPlugin.ImagesDetails" android:configChanges="orientation" />
<activity android:theme="@*android:style/Theme.Dialog" android:name="com.ibuildapp.romanblack.ImagesPlugin.ImagesBottomPanel" />
<activity android:name="com.ibuildapp.romanblack.ContactPlugin.ContactPlugin" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp.romanblack/contacts" />
</intent-filter>
</activity>
<service android:name=".PushNotification.AppPushNotificationReceiver" />
<service android:name=".GPSNotification.GPSService">
<action android:name="android.intent.action.BOOT_COMPLETED" />
</service>
<activity android:name="com.ibuildapp.romanblack.WebPlugin.WebPlugin" android:configChanges="keyboard|keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp.romanblack/web" />
</intent-filter>
</activity>
<activity android:name="com.ibuildapp.romanblack.CustomFormPlugin.CustomFormPlugin" android:configChanges="orientation">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp.romanblack/customform" />
</intent-filter>
</activity>
<activity android:label="Email" android:name="com.ibuildapp.romanblack.EmailPlugin.EmailPlugin">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp.romanblack/email" />
</intent-filter>
</activity>
<activity android:theme="@*android:style/Theme.Dialog" android:name="com.ibuildapp.romanblack.EmailPlugin.addfile" />
<activity android:theme="@*android:style/Theme.Dialog" android:name="com.ibuildapp.romanblack.EmailPlugin.dellfile" />
<activity android:theme="@*android:style/Theme.Dialog" android:name="com.ibuildapp.romanblack.EmailPlugin.filelist" />
<activity android:name="com.ibuildapp.romanblack.ECommercePlugin.ECommercePlugin" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp.romanblack/ecom" />
</intent-filter>
</activity>
<activity android:name="com.ibuildapp.romanblack.ECommercePlugin.ECommerceBuy" android:screenOrientation="portrait" />
<activity android:name="com.ibuildapp.romanblack.ECommercePlugin.ECommerceDetails" android:screenOrientation="portrait" android:configChanges="keyboardHidden" />
<activity android:theme="@*android:style/Theme.Translucent.NoTitleBar" android:name="com.paypal.android.MEP.PayPalActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name="com.ibuildapp.romanblack.MapPlugin.MapPlugin">
<uses-library android:name="com.google.android.maps" />
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp.romanblack/map" />
</intent-filter>
</activity>
<activity android:name="com.ibuildapp.romanblack.MapPlugin.MapBottomPanel" />
<activity android:name="com.ibuildapp.romanblack.MapPlugin.WebViewer" />
<activity android:name="com.ibuildapp.romanblack.MediaPlugin.MediaPlugin" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp.romanblack/media" />
</intent-filter>
</activity>
<activity android:name="com.ibuildapp.romanblack.MediaPlugin.MusicPlayer" />
<activity android:name="com.ibuildapp.romanblack.MediaPlugin.VideoPlayer" android:configChanges="orientation" />
<activity android:name="com.ibuildapp.romanblack.MediaPlugin.AudioPlayer" android:configChanges="orientation" />
<service android:name="com.ibuildapp.romanblack.MediaPlugin.BackGroundMusicService" />
<activity android:name="com.ibuildapp.romanblack.TablePlugin.TablePlugin" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp.romanblack/table" />
</intent-filter>
</activity>
<activity android:name="com.ibuildapp.romanblack.TablePlugin.TableDetails" />
<activity android:name="com.ibuildapp.romanblack.CouponPlugin.CouponPlugin">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp.romanblack/coupon" />
</intent-filter>
</activity>
<activity android:name="com.ibuildapp.romanblack.CouponPlugin.CouponDetails" />
<activity android:name="com.ibuildapp.romanblack.CameraPlugin.CameraPlugin" android:configChanges="orientation">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp.romanblack/camera" />
</intent-filter>
</activity>
<activity android:label="Facebook" android:name="com.ibuildapp.romanblack.CameraPlugin.CameraFacebookSharing" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp/picture" />
</intent-filter>
</activity>
<activity android:label="Twitter" android:name="com.ibuildapp.romanblack.CameraPlugin.CameraTwitterSharing" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp/picture" />
</intent-filter>
</activity>
<activity android:name="com.ibuildapp.romanblack.NewsPlugin.NewsPlugin" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp.romanblack/rss" />
</intent-filter>
</activity>
<activity android:name="com.ibuildapp.romanblack.NewsPlugin.FeedDetails" />
<activity android:name="com.ibuildapp.romanblack.NewsPlugin.EventsNotification" />
<activity android:name="com.ibuildapp.romanblack.NewsPlugin.EventsNotificationView" />
<activity android:name="com.ibuildapp.romanblack.TwitterPlugin.TwitterPlugin" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="ibuildapp.romanblack/twit" />
</intent-filter>
</activity>
<activity android:name="com.ibuildapp.romanblack.TwitterPlugin.Description" android:screenOrientation="portrait" />
<activity android:label="TicTacToe" android:name="com.ibuildapp.username.TicTacToe.MainActivity" />
<receiver android:name="com.google.android.c2dm.C2DMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.appbuilder.u28941p382992" />
</intent-filter>
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.appbuilder.u28941p382992" />
</intent-filter>
</receiver>
<uses-library android:name="com.google.android.maps" />
<activity android:name="com.ibuildapp.romanblack.WebPlugin.WebPlugin" android:configChanges="keyboard|keyboardHidden|orientation" />
<activity android:name="com.ibuildapp.romanblack.MediaPlugin.MediaPlugin" android:screenOrientation="portrait" />
<activity android:name="com.ibuildapp.romanblack.MediaPlugin.MusicPlayer" />
<activity android:name="com.ibuildapp.romanblack.MediaPlugin.VideoPlayer" android:configChanges="orientation" />
<activity android:name="com.ibuildapp.romanblack.MediaPlugin.AudioPlayer" android:configChanges="orientation" />
<service android:name="com.ibuildapp.romanblack.MediaPlugin.BackGroundMusicService" />
</application>
<permission android:name="com.appbuilder.u28941p382992.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.appbuilder.u28941p382992.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<supports-screens android:anyDensity="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:resizeable="true" />
</manifest>

Try to add
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
at
<application android:label="Led Zeppelin Guitar Book" android:icon="@drawable/icon">
:fingers-crossed:

Ndaoud360 said:
Led Zeppelin Guitar Book
Click to expand...
Click to collapse
Cool.

nikwen said:
Cool.
Click to expand...
Click to collapse
Yea pretty much got a series going where I make guitar books for a bunch of bands. It has tabs for every single song done by the band with some video lessons and biographies of every band member. I have about 5 on play store right now but there paid Not much just $1.10.

mariozawa said:
Try to add
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
at
<application android:label="Led Zeppelin Guitar Book" android:icon="@drawable/icon">
:fingers-crossed:
Click to expand...
Click to collapse
It did not work.

Just checked you code and saw that there are two supports-screens tags.
(Although it will not solve your problem.)
---------- Post added at 08:17 PM ---------- Previous post was at 08:15 PM ----------
Ndaoud360 said:
It did not work.
Click to expand...
Click to collapse
EDIT: Not confirmed. Works now. I put it in the manifes tag. It needs to be in the application tag.
However, it results in GB design.
If it still does not work for you, try doing it in the Java code: http://www.vogella.com/blog/2011/02/28/android-hidding-the-status-and-title-bar/

There's another way of doing this. In your onCreate, before you load your content xml
// turn off the window's title bar
requestWindowFeature(Window.FEATURE_NO_TITLE);
//this makes sure you actually use the whole window now that the title bar is gone
getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
setContentView(R.layout.main);

nikwen said:
Just checked you code and saw that there are two supports-screens tags.
(Although it will not solve your problem.)
---------- Post added at 08:17 PM ---------- Previous post was at 08:15 PM ----------
EDIT: Not confirmed. Works now. I put it in the manifes tag.
However, it results in GB design.
If it still does not work for you, try doing it in the Java code: http://www.vogella.com/blog/2011/02/28/android-hidding-the-status-and-title-bar/
Click to expand...
Click to collapse
What is the manifest tag?

Ndaoud360 said:
What is the manifest tag?
Click to expand...
Click to collapse
It is the first tag after <xml ... >.
However, it needs to be in the application tag to work.
---------- Post added at 12:14 AM ---------- Previous post was at 12:10 AM ----------
Are you talking about the Paypal Activity? Remove the * between the @ and android:style.
---------- Post added at 12:17 AM ---------- Previous post was at 12:14 AM ----------
Adding the line to the application tag will not do anything. The style attribute of the activity overrides the theme. So try removing the * as said above.

nikwen said:
It is the first tag after <xml ... >.
However, it needs to be in the application tag to work.
---------- Post added at 12:14 AM ---------- Previous post was at 12:10 AM ----------
Are you talking about the Paypal Activity? Remove the * between the @ and android:style.
---------- Post added at 12:17 AM ---------- Previous post was at 12:14 AM ----------
Adding the line to the application tag will not do anything. The style attribute of the activity overrides the theme. So try removing the * as said above.
Click to expand...
Click to collapse
Removing * did not work

Ndaoud360 said:
Removing * did not work
Click to expand...
Click to collapse
Then try to replace that line by the one given in the second post. That way it will be just for this one Activity.
If you want it to work for all Activities, remove that one line and add it to the application tag.

nikwen said:
Then try to replace that line by the one given in the second post. That way it will be just for this one Activity.
If you want it to work for all Activities, remove that one line and add it to the application tag.
Click to expand...
Click to collapse
Nope did not work.

Ndaoud360 said:
Nope did not work.
Click to expand...
Click to collapse
Strange.
Do you want it to be just for the Paypal Activity?
---------- Post added at 05:31 PM ---------- Previous post was at 05:12 PM ----------
You say that you want your app to run in landscape mode.
However, I cannot find the part in the manifest where you declare that.
Add the following to every activity which should run in landscape mode:
Code:
android:screenOrientation="landscape"

nikwen said:
Strange.
Do you want it to be just for the Paypal Activity?
---------- Post added at 05:31 PM ---------- Previous post was at 05:12 PM ----------
You say that you want your app to run in landscape mode.
However, I cannot find the part in the manifest where you declare that.
Add the following to every activity which should run in landscape mode:
Code:
android:screenOrientation="landscape"
Click to expand...
Click to collapse
Well yea it's a bit strange what I did. At the time I did not know how to make the main menu of the app go into landscape so I just rotated all the images and it appears as if it is landscape but the phone see's it as portrait. So the status bar is located as if it's portrait.

Ndaoud360 said:
Well yea it's a bit strange what I did. At the time I did not know how to make the main menu of the app go into landscape so I just rotated all the images and it appears as if it is landscape but the phone see's it as portrait. So the status bar is located as if it's portrait.
Click to expand...
Click to collapse
And for which Activity do you want to remove the status bar?

nikwen said:
And for which Activity do you want to remove the status bar?
Click to expand...
Click to collapse
Well the whole app pretty much.

And the manifest you posted. Is it the one after your program adding the fullscreen code? Because there is no fullscreen code.
Maybe you could try running it without this programm, built by Eclipse.
If you do so, try this:
mariozawa said:
Try to add
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
at
<application android:label="Led Zeppelin Guitar Book" android:icon="@drawable/icon">
:fingers-crossed:
Click to expand...
Click to collapse
Maybe your signing program removes the code.

nikwen said:
And the manifest you posted. Is it the one after your program adding the fullscreen code? Because there is no fullscreen code.
Maybe you could try running it without this programm, built by Eclipse.
If you do so, try this:
Maybe your signing program removes the code.
Click to expand...
Click to collapse
Actually the program adds this
<activity android:theme="@*android:style/Theme.Translucent.NoTitleBar" android:name="com.paypal.android.MEP.PayPalActivity" android:configChanges="keyboardHidden|orientation" />

Related

Android RSS Feeder Help

Hi, im building an RSS Reader and am having a little trouble if anyone could help me out.
im trying to open my app when a subscribe rss link in a browser is pressed, but at the moment it is displaying my app in the browser instead of launching the app!!
can anyone help with is issue?
below is my manifest, thanks
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.RSS_Viewer"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:name=".Globals"
android:icon="@drawable/rssicon"
android:label="@string/app_name" android:logo="@drawable/rssicon">
<activity
android:name=".RSS_ViewerActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="itpc" />
<data android:scheme="pcast" />
<data android:scheme="feed" />
<data android:scheme="feeds" />
<data android:scheme="rss" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/xml" android:scheme="http" />
<data android:mimeType="application/rss+xml" android:scheme="http" />
<data android:mimeType="application/atom+xml" android:scheme="http" />
<data android:mimeType="text/xml" android:scheme="https" />
<data android:mimeType="application/rss+xml" android:scheme="https" />
<data android:mimeType="application/atom+xml" android:scheme="https" />
</intent-filter>
</activity>
<activity android:name="RSSFeedActivity"></activity>
<activity android:name="com.CertificateAuthentication.Authenticator"></activity>
</application>
</manifest>

i need a little help with this

hey,
i'm trying to make an app in android studio and get some errors in my androidmanifest.xml when using inspect code.
This is my first app and i'm sure i missed something essential...pls help
My xml file looks like this:
<manifest xmlns:android="...."
android:versionCode="1"
android:versionName="1.0"
package="com.standby.custom">
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="18"/>
<supports-screens
android:anyDensity="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:resizeable="true"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.BROADCAST_STICKY"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<uses-permission android:name="android.permission.GET_TASKS"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<application
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity" android:launchMode="singleInstance" android:hardwareAccelerated="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".DeviceStateReceiver" />
<service android:name="com.standby.custom.services.ReceiverRegisterService" />
<receiver android:name=".PackageChangeReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_REPLACED" />
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package" androidath="com.standby.custom" />
</intent-filter>
</receiver>
<receiver android:name=".BootUpReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
</manifest>
and i get this error messages:
Cannot resolve symbol '.MainActivity' (at line 34)
Cannot resolve symbol '.DeviceStateReceiver' (at line 40)
Cannot resolve symbol 'com.standby.custom.services.ReceiverRegisterService' (at line 41)
Cannot resolve symbol '.PackageChangeReceiver' (at line 42)
Cannot resolve symbol '.BootUpReceiver' (at line 50)
Does anyone know what I missed?
Tks
First of all, please use
Code:
tags for your code.
Is this the right package all of your classes can be found in?
[CODE]package="com.standby.custom"
Try to enter the full package name for all android:name attributes. Like this:
Code:
android:name="my.package.name.MainActivity"
(replace my.package.name by the package MainActivity is in.)

[Q] How to insert admob in app help me

hi guys
could you help me to put the banner in my app.
I also followed the guides but I still can not insert
You might even see me lines of code please
thanks
what problem are you getting????
Atleast tell the problem or provide the code where you are facing problem.
Simple:
1) Install Google AdMob Ads SDK (you can use Android SDK Manager for that)
2) Add GoogleAdMobAdsSdk.jar to your project (Project Properties>>Java Build Path>>Add External JARs…)
3) In the Manifest add ACCESS_NETWORK_STATE and INTERNET permissions, and also an activity inside application tag, like that:
Code:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:debuggable="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name=".BillingSampleActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:name="com.google.ads.AdActivity" />
</application>
4) Get Publisher ID from AdMob
5) Add banner to your layout
Code:
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="your_admob_publisher_id"
ads:loadAdOnCreate="true" />
Thats it!
GRYMALA said:
Simple:
1) Install Google AdMob Ads SDK (you can use Android SDK Manager for that)
2) Add GoogleAdMobAdsSdk.jar to your project (Project Properties>>Java Build Path>>Add External JARs…)
3) In the Manifest add ACCESS_NETWORK_STATE and INTERNET permissions, and also an activity inside application tag, like that:
Code:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:debuggable="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name=".BillingSampleActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:name="com.google.ads.AdActivity" />
</application>
4) Get Publisher ID from AdMob
5) Add banner to your layout
Code:
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="your_admob_publisher_id"
ads:loadAdOnCreate="true" />
Thats it!
Click to expand...
Click to collapse
Nice answer! Thanks for this.

android how to remove black frame of a deleted image in the sd card folder after dele

I am trying to delete an image file from sdcard.The following code works fine with the emulator but when I'm testing it on my Nexus phone there is a black frame exists in the folder for each deleted image.So, after following posts in relation to similar issue my code looks like below. I've just started learning android programming and got stuck at this point.I'll really appreciate your help
String sdcard_path=Environment.getExternalStorageDirectory().getAbsolutePath()+"/Expense_image";
File cacheFile =new File (sdcard_path,imageLocation);
if(cacheFile.exists()){
boolean deleted=cacheFile.delete();
Log.i("Deletion check","deleted:"+deleted);
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory())));
Manifest.xml
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<activity
android:name=".deleteRecord"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.refat.myexpensev1.DELETERECORD" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MEDIA_MOUNTED" />
<data android:scheme="file" />
</intent-filter>
</activity>

custom fm radio for lineage and miui

Hello everybody. I am android developer and i want to modify fm radio for agm m7 (lineage). I have decompiled app,but when i try to run fm radio and play some fm wave,i get a message,what this function is unavailable now. I have it in /system/app and in /system/priv-app with permissions 644 and 777,i.e i tryed to do it as a system app. Also in /system/priv-app i have text link on libfmjni.so My phone is rooted. As i understood from debug,native method openDev and probably some other methods from native lib return false. In manifest i have:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="2" android:versionName="2.0" package="com.android.fmradio" platformBuildVersionCode="27" platformBuildVersionName="8.1.0">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="26" android:usesCleartextTraffic="false"/>
<uses-permission android:name="android.permission.ACCESS_BROADCAST_RADIO"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_ROUTING"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application android:label="@string/app_name" android:icon="@Mipmap/ic_launcher" android:hardwareAccelerated="true">
<activity android:theme="@style/AppTheme" android:label="@string/app_name" android:name="com.android.fmradio.FmMainActivity" android:launchMode="standard" android:screenOrientation="portrait" android:windowSoftInputMode="adjustPan" android:usesCleartextTraffic="false">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:theme="@style/LightTheme" android:label="@string/station_title" android:name="com.android.fmradio.FmFavoriteActivity" android:launchMode="singleTask" android:configChanges="screenSize" android:windowSoftInputMode="stateAlwaysHidden"/>
<service android:name="com.android.fmradio.FmService" android:exported="false">
<intent-filter>
<action android:name="com.android.fmradio.IFmRadioService"/>
</intent-filter>
</service>
<provider android:name="com.android.fmradio.FmProvider" android:exported="false" android:authorities="com.android.fmradio"/>
<activity android:theme="@style/LightTheme" android:label="@string/record_title" android:name="com.android.fmradio.FmRecordActivity" android:launchMode="singleTask" android:configChanges="screenSize|keyboardHidden|mnc|mcc"/>
<activity android:label="@string/app_name" android:name="com.android.fmradio.FmEmActivity" android:clearTaskOnLaunch="true" android:launchMode="singleTask" android:configChanges="screenSize|orientation|keyboardHidden|mnc|mcc">
<intent-filter>
<action android:name="com.mediatek.fmradio.FmRadioEmActivity"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<receiver android:name="com.android.fmradio.FMMediaButtonIntentReceiver">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON"/>
</intent-filter>
</receiver>
</application>
</manifest>
May be it connected with differents signatures of custom firmware and my app? If true,whether it possible sign firmware with other signature,if i haven't source code of firmware for agm m7? May be this problem not connected with signatures?
Also maybe someone have decompiled fm radio for xiaomi redmi note 9 s,because i want to change one thing in this app.

Categories

Resources