I am trying to integrate Leadbolt icon ads into an Android app. I followed the How-to guide: http://www.leadbolt.com/docs/Leadbolt_android_app_guide_v304.pdf . Here's the relevant code:
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!-- LeadBolt -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<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.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
The onCreate for the launcher Activity:
String leadboltIconId = Application.getInstance().getLeadboltIconId();
Log.d(TAG, "leadboltIconId: >" + leadboltIconId + "<");
AdController adController = new AdController(this, leadboltIconId, this);
adController.loadIcon();
"leadboltIconId" is filled correctly. Here is a ss of the config screen:
and the details screen:
I am using an emulator with 2.3.3 on it. It also doesn't work on my HTC Incredible with CM7 ( 2.3.3 ). There are no errors in the log. The activity implements AdListener and none of the methods are ever called.
Please change this line:
AdController adController = new AdController(this, leadboltIconId, this);
to
AdController adController = new AdController(
getApplicationContext(), leadboltIconId);
Also, please note the 3 variable is not needed when running App Icons as App icons will not trigger any event listeners. You need to use the Application Context rather than Activity for App Icons and Notifications. Activity is needed for App Ads.
I've got the same problem with the Ad Icon. I also noticed someone else posting this problem on the Leadbolt Q&A forum recently. There might be a problem with Leadbolt's side, however they fail to communicate this to us...
Related
I'm trying to dial a number and when the call connects turn ON the speaker.
I've already read lots of topics that achieve this problem, but cannot get it working.
This is what I have.
Toast.makeText(getApplicationContext(), "CALL_STATE_OFFHOOK",
Toast.LENGTH_LONG).show();
Context context = (Context)getApplicationContext();
AudioManager audioManager2 = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
audioManager2.setMode(AudioManager.MODE_IN_CALL);
audioManager2.setSpeakerphoneOn(true);
The listener is working fine. I can see the toast "CALL_STATE_OFFHOOK" when the call is established, but the rest of the code is not working.
Am I missing something ?
Thanks !
UPDATE
This are my permissions
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
UPDATE 2
Actually calling:
audioManager2.isSpeakerphoneOn()
returns false before
audioManager2.setSpeakerphoneOn(true);
and
audioManager2.isSpeakerphoneOn()
returns true after
audioManager2.setSpeakerphoneOn(true);
but the speaker really did not turn ON.
Did you set the option "AUDIO_SETTINGS" on true in your manifest?
what i am doing::
I have disabled the datapackets so i don't have a internet connection
at the moment in emulator
Now i am checking whether the internet connection is available if not
availabe i am using this code below to launch the screen so that i
can enable the datapackets
code::startActivity(new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK));
This code takes me to page::
When i click on button it shows turning wifion.... but it is not switching on no matter how long i wait
But when i close the app and go to settings manually. I can turn it on
The permissions i have used are below::
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<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_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
What is that i am doing wrong here ? how can i correct myself !
try this code.it might helps you
Intent gpsOptionsIntent = new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS);
startActivityForResult(gpsOptionsIntent,0);
if you are using wifiManager than you will need this permission.
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
Just upgraded from android 2.9 to 3.1 and now my video capture is not working. I am working on android right now.
I have the following plugins:
camera
file
filetranfer
geolocation
mediacapture
networkinformation
My manifest permissions looks like this:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_VIDEO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
From what I have been testing here is what happens:
The capture video opens the video recorder, even with the timelimit I
have set.
I record the video.
It gives me the okay or close, I choose okay.
It saves the video in my gallery (oddly as mp4 instead of 3gpp
which I thought was how it saved videos).
Then instead of going to the success with the mediafile it goes to
error and tells me data is null.
Here is my code to take the video --
var options = {duration: 15};
navigator.device.capture.captureVideo(checkLogin, mediaError, options);
The error message from LogCat--
Cordova Activity Request code = 2
Web Console An error occurred: Error: data is null
Any ideas would be great and if you need more info please ask,
Thank you
My reputation is not high enough yet to simply add a comment, so I'll post this as an answer. If you're still having trouble with this you may want to look at the answer to this question - Phonegap video capture crashes
Looks like modifying the java code for Capture fixed the problem for many people.
I have been writing an app that is targeted for Android 2.1 and works great on almost all devices.
Recently I tried to run it on Android 4.0.3 and it started to flicker (just like gmail app). The weird part is that I changed starting activity to empty one (no controls or layout elements) and it still flickered. Changing target to Google APIs 4.0.3 did not help either.
I am using Google APIs 2.1 currently. Have few external libraries protobuf and RabbitMQ and app permissions:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
no idea what else could have any impact to an empty Activity.
Has anyone experienced something similar or have any clue what could be happening?
EDIT: I began a new project and went step after step to replicate the problem. It is my class which extends Application and it is flooding the log with:
memalloc(26689): ion: Mapped buffer base:0x52172000 size:1949696 offset:0 fd:55
memalloc(26689): ion: Unmapping buffer base:0x52172000 size:1949696
it stops if I comment out line:
newConfig.locale = locale;
which is in method:
public void onConfigurationChanged(Configuration newConfig)
It might be that your activity is opened repeatedly?
Print your activity dump: adb shell dumpsys activity
check the stack to see how many instances are open
I was just wondering how to request permissions when creating an android application. I am a beginner, so please explain in simple terms :D.
So I want to make it so that my app can vibrate the phone at certain times, and the permission is called "android.permission.VIBRATE." But how do I request this? I do it in the Android Manifest file right?
Thanks for all help!
You're definately right. You need to put it in the AndroidManifest.XML
If you're using eclipse you can do it quite easily and without XML by opening up AndroidManifext.xml and use the Permissions tab at the bottom and press the "Add" button and selecting "Uses Permission" Then just select vibrate from the dropdown list.
If you want to do it in XML code you can add it before the application tag, like so:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:name="Application" >
(the rest of your manifest continues from here)
Also, please accept answers if you found them useful. With a 0% acceptance rate, people won't want to answer your questions.