Axonix (Mobiclix) Error code 999999 - java

I am implementing axonix Advertisement in android. I am right adding banner ads but I failed to load with error code 999999. I am not able to find error code description anywhere. If anybody come across this error please help me.
I have added code in manifest also.
I am adding my xml code and java implementation.
XML
<com.axonix.android.sdk.AxonixMMABannerXLAdView
android:id="#+id/banner_adview"
android:layout_width="50dp"
android:layout_height="320dp"
android:layout_above="#+id/tab_replace"
android:layout_gravity="center"
android:tag="adspace" />
JAVA
AxonixMMABannerXLAdView adview_banner;
adview_banner = (AxonixMMABannerXLAdView) findViewById(R.id.banner_adview);
adview_banner.addAxonixAdViewListener(this);
adview_banner.getAd();
Also added methods that need to implemented for listening.

Related

Androidx and YouTubePlayerSupportFragment

Good day,
I'm sorry if I may come off as ignorant but i have an error and I'm not sure of the cause. I tried using the YoutubePlayerSupportFragment. My main activity extends AppCompatActivity and I'm using androidx, not the support library. My error is seen in the compiler but doesn't affect the the apps compilation at all.
the error is displayed as:
inconvertible types; cannot cast 'androidx.fragment.app.Fragment' to
'com.google.android.youtube.player.YoutubePlayerSupportFragment'
and my code samples are
YouTubePlayerSupportFragment youTubePlayerFragment = (YouTubePlayerSupportFragment) getSupportFragmentManager().findFragmentById(R.id.youtube_player);
and
<androidx.fragment.app.FragmentContainerView
android:name="com.google.android.youtube.player.YouTubePlayerSupportFragment"
android:id="#+id/youtube_player"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
As said before the app runs and the Youtube player works, but i know that the error should not be there. Am I casting incorrectly?

Problems with designing a custom view in Android studio

I'm following a guide to creating a custom view in android studio whereby I define the view's attributes in XML but a few lines are causing errors in the classes. Here in the block of code causing troube:
<applicationprogramming.task401d.CustomView
android:id="#+id/custView1"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="5dp"
custom:circleColor="#6039ff"
custom:circleLabel="Hello"
custom:labelColor="#d9d908">
</applicationprogramming.task401d.CustomView>
The three lines of code bellow
custom:circleColor="#6039ff"
custom:circleLabel="Hello"
custom:labelColor="#d9d908
are causing the following error in one of the classes:
Error:(14) No resource identifier found for attribute 'circleColor' in package 'applicationprogramming.task401d'.
When I define these attributes:
to get the text and colors specified using the names in attrs.xml
circleText = a.getString(R.styleable.CustomView_circleLabel);
circleCol = a.getInteger(R.styleable.CustomView_circleColor, 0);//0 is default
labelCol = a.getInteger(R.styleable.CustomView_labelColor, 0);
I get 'Cannot resolve Symbol 'R.
And the only way to solve this issue is to remove where i define the attributes.
Any help would be appreciated.
Thanks in advance
You need to apply custom schema to xml. Use it like below .
<applicationprogramming.task401d.CustomView
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:id="#+id/custView1"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="5dp"
custom:circleColor="#6039ff"
custom:circleLabel="Hello"
custom:labelColor="#d9d908"></applicationprogramming.task401d.CustomView>

Android In App Billing From PreferenceScreen

I have never really had to ask a question here. Almost any question I can think of has already been asked and answered. Thus the reason I have never registered.
However, I have finally run across something that I cannot find an answer for. I assume it would be fairly simple.
I am trying to implement in app billing for an android project I am working on. I typically code in C# and use Unity to build the .APK.
However, this time I have to make modifications in Eclipse to some PreferenceScreens.
I have an xml file with some string-arrays set up for a ListPreference under my PreferenceScreen. These ListPreference values are then passed to UnityPlayer for a method. That's all set up.
I am trying to figure out a way to set up in app billing to trigger on selection of one of my list preference, or preference items.
I can probably figure a lot of it out on my own, but I need help with a function to do something pulling from a string value in the list preferences. Does this make sense?
I don't expect to be spoon fed, so if I can just get help on a few lines for this I would appreciate it. Of course I won't complain if anyone wants to write up a little 20 liner function to do it for me.
Thanks in advance,
John
** edit **
Here is the xml from the preferenceScreen I need to address with android In App Billing from Java
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="wallpaper_settings"
android:title="#string/wallpaper_settings" >
<!-- Ad Placeholder -->
<CheckBoxPreference
android:defaultValue="true"
android:key="rotate"
android:summary="#string/rotateSummary"
android:title="#string/rotateTitle" />
<CheckBoxPreference
android:defaultValue="true"
android:key="doubleTap"
android:summary="#string/doubleTapSummary"
android:title="#string/doubleTapTitle" />
<CheckBoxPreference
android:defaultValue="false"
android:key="swipeEmul"
android:summary="#string/simulateSwipeSummary"
android:title="#string/simulateSwipeTitle" />
<ListPreference
android:entryValues="#array/cameraValues"
android:defaultValue="MainCamera"
android:entries="#array/whichCam"
android:summary="#string/cameraSummary"
android:dialogTitle="#string/cameraTitles"
android:title="#string/cameraTitles"
android:key="whichCam"/>
</PreferenceScreen>'
This question is very generic, on an Android application you might do this by creating an Activity, then starting that activity from your preference "onClick" method and then, once the activity starts, you load all your in app billing stuff (showing a progress dialog) and finally present the "buy" dialog. Is this what you need?

action_search cannot be resolved or is not a field

I am following developer.android to do their training. I am in the process of "Adding the Action Bar", however, i encountered a problem.
In the section "Respond to Action Buttons" here (http://developer.android.com/training/basics/actionbar/adding-buttons.html#Respond), the line "case R.id.action_search:" has error which says "action_search cannot be resolved or is not a field".
[Delete] In fact, the line "openSearch();" and "openSettings();" have red lines as well, saying "The method openSettings() is undefined for the type MainActivity". [/Delete]
(I know what is wrong here, I need to declare those two methods by myself.)
what should I do? Thx for the help first.
<item android:id="#+id/action_search"
android:icon="#drawable/ic_action_search"
android:title="#string/action_search"
android:showAsAction="ifRoom" />
Firstly, the attribute android:id="#+id/action_search has no problem.
There are two things you need to do that the tutorial seems to have taken for granted
Add an image called "ic_action_search.png" to all the res/drawable directories in your project.
Add the definition for the string resource "action_search" which is being assigned to the android:title attribute. Open the res/values/strings.xml file and add
<string name="action_search">Search</string> over there.
Secondly,
The functions openSearch() and openSettings() need to be defined in the same class by you. Something like :
public void openSearch()
{
//Do something here.
}
public void openSettings()
{
//Do something here.
}
their functionality is not important for the tutorial as they are trying to show how you can control what happens when an option on the action menu is selected.
Go Project->Clean
It worked for me
I tried it and had the same problem. I removed android:icon="#drawable/ic_action_search" (instead of adding the images because I'm lazy) and added the action_search string in the resource file to make sure the menu file wasn't referring to anything that didn't exist. After that, I tried changing android:id to android:title because I saw that it had worked for you, and this was curious. It caused an error after saving, and so I changed it back. After changing it back and saving, the original error in the MainActivity.java file disappeared, and R.id.action_search was resolved. I think the problem is just that R.java is not being updated, and you have to basically hit it with a hammer by forcing an error and fixing it, at least in my case. I don't know why using android:title worked for you. Hope this helps somehow.

android.widget.TextView.setTextAlignment(): java.lang.NoSuchMethodError

Situation:
I have a TextView that have the property
android:textAlignment="center"
I am generating another TextView dinamically, based on my TextView from XML Layout, using a clone, cloning all the basic properties to work the way above.
Problem:
To do this i need to use this method:
this.myTextView.setMyTextViewProperty(MyTextView.getMyTextViewProperty());
for example:
this.MyTextView.setText(MyTextView.getText());
Note that this.MyTextViewis a local variable and MyTextView is a private var declared on the top of the file, under class name.
I do this on all the properties of the TextView but when i hit the following line of code from the TextAlignment property...:
this.myTextView.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
I tried to set it to a Custom Aligment instead of getting from my XML TextView It gives me an error:
11-20 15:27:04.460: E/AndroidRuntime(9185): FATAL EXCEPTION: main
11-20 15:27:04.460: E/AndroidRuntime(9185): java.lang.NoSuchMethodError: android.widget.TextView.setTextAlignment
But i see on Ctrl + Space that the method exists, so i cant understand what is happening.
A second try was, to set my TextView property to the property that comes from my TextView:
this.myTextView.setTextAlignment(MyTextView.getTextAlignment());
With no success, too.
Obs: i do not want a Android XML Layout solution, i want a solution on code, because i generate the TextView dinamically on the Activity
I'm using API Level 15
Any help?
The setTextAlignment method was added in API level 17. Maybe your compiler in the IDE is above 17 and the device/emulator which you are testing is less than that. Here the link to setTextAlignment.
Added from the comments:
For API level 15 and below, you want setGravity, per this question.

Categories