Android Bootstrap not displaying icons in button - android

I implemented Android Bootstrap library:
https://github.com/Bearded-Hen/Android-Bootstrap
Everything works fine, but icons in buttons are not displayed.
I add font-awesome file into asset folder, but still without successful result.
How can be this solved?
Thanks for any help.

Try what it worked for me, make sure that "android-support-v4.jar" file in libs folder (assuming that you're working in eclipse) is the same copy in AndroidBootstrap library project and your project.
This might only partially solve your problem, you might have problems with the icon not displaying when you change orientation (landscape/portrait) and there might be better solution, but this is my quick fix:
in OnResume add:
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE){
bbYourButton1.setLeftIcon("fa-heart");
bbYourButton2.setRightIcon("fa-twitter");
}

If there is a problem loading the font, you should get the reason in the log cat, as we can see in com / beardedhen / androidbootstrap / BootstrapButton.java at line 343
Log.e("BootstrapButton", "Could not get typeface because " + e.getMessage());
So, go to the logcat and see if you can understand what happened.
Anyways, the better start point is to import the AndroidBootstrapTest project and see if everything works.

Just copy fontawesome-webfont.ttf into assets folder of your project.

Related

KivyMD, can't see icons in android but works on linux

I'm just created .apk file with buildozer.But as i said in topic, can't see any icon on device.Everything works and looks fine in Linux. But in device,all icons are blank. This is my buildozer.init requirements: (my ndk,sdk,minapi,ndk_api values are default)
requirements = python3,kivy==1.11.1,https://github.com/kivymd/KivyMD/archive/master.zip
If i use kivymd==0.104.1, i can see icons in android but can't use some commands like : MDTab.get_tab_list() , MDTab.switch_tab() (I asked that problem before in here.So i have to use master branch version because i need to switch MDTabs after some button clicks.But now,i can't see any icon.Is that bug or can someone help me ? Thank you..
(Last note: Im removing .buildozer file before change requirements versions.)
Set correct dependencies in buildozer.spec- https://github.com/kivymd/KivyMD/commit/df73810cc725e4575c93bc4cbbb72f67ff568dc1

Android - Libgdx - Couldnt Load File

I have used google, read all Questions here on StackExchange but still couldnt solve my Problem.
So Im following a tutorial from kilobolt(Zombie Bird).
The desktop-version of the game is running without problems, but if I want to run it on an android emulator I get this error message:
"Couldn't load file: data/logo.png"
The line where I get the error looks like this:
logoTexture = new Texture(Gdx.files.internal("data/logo.png"));
My Android Path looks like this:
-Android
-Assets
-Data
-logo.png
I assume this is the correct path.
I have tried cleaning the project, I used Gradle > Refresh All, I restarted Eclipse.
Nothing worked.
Im a little bit confused cause if I move the file outside of Data but in the Assets Folder and change the path to this:
logoTexture = new Texture(Gdx.files.internal("logo.png"));
It works.
Can someone explain me why I cant use the Data Folder inside of Assets?
What emulator are you using to run it? For me, the same code works properly on an actual Android device, so I'd assume it is an Emulator error. Possibly has to do with the / as the seperator character. This is just a wild guess, but does
logoTexture = new Texture(Gdx.files.internal("data" + File.separator + "logo.png"));
fix it, or break it?
maybe it's caused by the difference of OpenGl ES 1 and OpenGl ES 2...
Using OpenGl ES 1 the picture size has the power of two. Bear with me - I'm new to libgdx.. :)

Android Add PinIt Button using Pinterest Jar NoClassDefFoundError

I am trying to add the Pinit button to my Android App. I have downloaded the SDK and copied the pinit-sdk-1.0.Jar into my Project/libs folder. I'm even able to make the necessary PinItButton import to my code. But for whatever reason, my XML isn't finding the Button widget, and so I tried to add it just using Java with this code:
LinearLayout ll = (LinearLayout)findViewById(R.id.pinterest_layout);
PinItButton pinit = new PinItButton(this);
ll.addView(pinit);
I know this is the correct way to add something using code because I tested it by adding a generic Button first. I run my project then, and it crashes on the line where I set up the PinItButton. This is the error that my logcat spat back at me:
07-22 01:19:52.160: E/AndroidRuntime(32367): java.lang.NoClassDefFoundError: com.pinterest.pinit.PinItButton
I believe that I'm understand what it is telling me, but what else should I be attempting then to create the PinIt button? Any help would be great. Thank you!
It was #Kai who helped me figure out my problem. I needed to check my libraries. I did that by going to project --> Properties --> Java Build Path --> Order and Export tab, then checking the library and clicking OK. My problem was then solved!

getting Eclipse to see recently added Drawables (png artwork)

I'm having trouble getting Eclipse to see that I've just put a new image into my project when referencing that image using R.drawable.this_text
So I drag my png into myProject/res/drawable-hdpi in Eclipse's Project Explorer. The name of the image is this_text and it's a png!
So I go into my application and I want to put this on the screen; So here's the code for that...
private void setTitle()
{
ImageView title = new ImageView(this); //this extends activity
title.setBackgroundResource(R.drawable.this_text);
...
}
This I have done before and each time I do it I experience the same thing:
if i just dragged my this_text.png into the Project Explorer in eclipse, the word "this_text" will be underlined in red, and not allow me to compile or proceed. I try to F5 (refresh) the project. I try refreshing the image foldr, the src, the actual java...etc! I try closing and opening eclipse but nothing really works. So I quit for afew minutes and work elsewhere in my application, and eventually this error goes away!
Well I'm impatient today-- And I'd rather know how to solve this incase I need to do any quick programming! So does anyone know what to do?
I'm using eclipse Version: Indigo Service Release 1.
Thanks- Ethan
R files for android are generated. Rather than refreshing you should be able to CLEAN the project which should fix your issue. You could even just delete the error from the problems list which would allow for compilation to start and for the generated R file to be created. Or you could make a change to an xml which would also allow for the file to be regened. As always make sure you are up to date on your tool chain.

Android/PhoneGap debugging: app not updated

I'm trying to use PhoneGap with Android. In the Sample that I run the main app opens an html file:
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
Now if I change something in the html page, Android always shows the previous content.
Is it possible that the output files (resources in that case) are not updated?
Also if I change the name of the html file in /assets/newName.html and into .loadUrl nothing changes.
Thank you, F.
I'm determined to find a proper answer to this, at the moment changes in the assets dir do not trigger a rebuild.
At the moment I'm slapping a new line in the Activity.java code to force a rebild/deploy..
Will update once I've looked for a real solution.
I see this sometimes when I add a data file to a project in eclipse.
If you think you pkg isnt being updated (re-built) then just rebuild it manually. If your using eclipse just do project->clean and select the project you want to clean. it'll rebuild automatically and include anything that was missed out.
OK Guys found.
The tutorial in the wiki.phonegap.com is obsolete.
Samples instead are updated!
Many thanks.

Categories

Resources