Error while building android chrome cast video example - android

Hi I trying chrome cast device with Google's https://github.com/googlecast/CastVideos-android this sample. I have imported appcompat and mediarouter from V7 lib. I also imported google play service lib and CastCompanionLibrary-android. All libs are proper and without any error. But when I tried to build video sample it gives me some resources error in styles-castvideo.xml. It gives error for following resources
<style name="ShowcaseView">
<item name="sv_titleTextAppearance">#style/TextAppearance.ShowcaseView.Title</item>
<item name="sv_detailTextAppearance">#style/TextAppearance.ShowcaseView.Detail</item>
<item name="sv_backgroundColor">#CC000000</item>
<item name="sv_buttonText">#string/ok</item>
<item name="sv_showcaseColor">#color/yellow</item>
</style>
Am I missing something. Need some help. Thank you.

ShowcaseView should be added as library.
https://github.com/naddaf/ShowcaseView
Dependencies
CastCompanionLibrary-android: can be downloaded here at https://github.com/googlecast/CastCompanionLibrary-android
ShowcaseView (see change list 1.1 -> 1.2 for details)

Related

AppCompat giving error in style.xml

I am using eclipse for one old existing android app. app was previously using actionBarSherlock, I switch to AppCompat this project.. added AppCompat support v7 project as library . so related to AppCompat Java imports are resolved , but in style.xml it is giving problem .. for eg.
<style name="customActionBarStyle" parent="Widget.AppCompat.ActionBar">
<item name="android:background">#color/darkblue</item>
<item name="background">#color/darkblue</item>
</style>
here this parent name is not resolved.. please guide me on this.
Thanks in advance.
At first,clean your project and rebuild it. If doesn't work, remove your support v7 library and do first step again.

Xamarin.Android Material Design Theming with Appcompat

I am facing some bug with custom material theme with AppCompat
I already set the the target to android 5.0
I already download the android support repository through the android sdk manager
and I add the AppCompat packege already
I will provide you some screenschot so you might help me figure out what's going wrong with it. Thank you in advance
Error Log
here is my style xml for the color
<?xml version="1.0" encoding="UTF-8" ?>
</style>
<style name="Theme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">#9E9E9E</item>
<item name="colorPrimaryDark">#616161</item>
<item name="colorAccent">#FF5252</item>
<item name="colorControlHighLight">#F5F5F5</item>
</style>
You are most likely running into an issue with the Support library Caches. We wrote a troubleshooting document on this topic that should help you resolve this:
https://developer.xamarin.com/guides/android/troubleshooting/resolving-library-installation-errors/
(Gist - https://gist.github.com/JonDouglas/f6291eacd4da5f6aa4cd)
Goto C:\Users\Geeksan\AppData\Local\Xamarin folder & Delete all folders corresponding to Android packages. Also delete zip files from the zips folder.
Then from your solution, add the required packages from nuget again & build the solution. The build process will take some time to download the zip files & unpack them. So wait for build to complete. Do not cancel the build process.

Use Theme.AppCompat in a xamarin.android app

I'm trying to make an Android app through Xamarin. I work on Windows 10 with VS2015.
I have to implement a side bar menu. After some research I found a solution to do it : use a DrawerLayout and others tools. That's why I use Theme.AppCompat in my application.
But when I'm trying to make a style which herits from Theme.Appcompat.light.NoActionBar, I got compile issue. The message is :
Error retrieving parent for item: No resource found that matches the given name '#android:style/Theme.AppCompat.Light.NoActionBar'.
I've added Xamarin.Android.Support.v4 and Xamarin.Android.Support.v7.AppCompat references to my project as bellow :
Project References
Edit: I also tried to add them by xamarin Component and nuget package manager.
But nothing compile.
Here is the code which produce this error:
<resources>
<style name="DailyCoin.HomeTheme" parent="#android:style/Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#219653</item>
<item name="drawerArrowStyle">#style/MyDrawerArrowStyle</item>
</style>
<style name="MyDrawerArrowStyle" parent="#android:style/Widget.AppCompat.DrawerArrowToggle">
<item name="color">#F5F5F5</item>
<item name="spinBars">true</item>
</style>
</resources>
minSdkVersion is 17 and compile using version is 23
Ok, I found the solution.
My problem was that xamarin was corrupted and the component adding module had some troubles when i added components. So i removed all references/components i've added to my projet, reinstalled xamarin.
Just for people impatient like me:
Then i had a new issue : "Unzipping failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r28.zip" because when generated the solution, it took a lot of time and i stoped this.
The solution was to delete all zips in "%localappdata%/xamarin/zips" and wait for the generation.
Thank for your help !
Julien
Did you try this?
parent="Theme.AppCompat.Light.NoActionBar"
Check this out (its working for me): Navigation Drawer using material design
Leave out #android:style/ so just:
parent="Theme.AppCompat.Light.NoActionBar"

error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:textColorPrimary">#color/colorTextPrimary</item>
<item name="android:textColorSecondary">#color/colorTextSecondary</item>
</style>
This is the styles.xml file. The following code results in this error - i have put all the necessary libraries and jar files and i have also tried changing the syntax little bit and many stuff but I am not able to solve the problem. It is very important. Please help me. Thank you.
I have tried the following :
You need to reference this AppCompat library in your Android project.
Import the library into Eclipse.
Right click on your Android project.
Select properties.
Click 'add...' at the bottom to add a library.
Select the support library
Clean and rebuild your project.
It still doesn't work.
Edit now :
I have installed android sdk 5.0 (API 21) but it still doesn't work. The line with the error is
There were 3 other errors before installing android sdk 5.0 (API 21) in this file (styles.xml) but now they are gone. Please help me to remove the remaining error.
If you are using material in the manifest, you will get this error if your min version isn't API 21

Android material design in Eclipse

Is there any way to create an app with Material design in Eclipse? Hamburger to arrow animation, full screen height navigation drawer...
Yes you can create an app with material design using eclipse.
Please follow each steps below carefully without any error.
Steps:
Create a new Android Project with Target SDK version 21. If your project already exists then just change the Target SDK version.
Add Appcompat v7 lib to your workspace and add this lib to build path of your project. You can find this lib at sdk\extras\android\support\v7.
Set Project build target to version 21.
There should be only 2 values folder in res folder.
values
values-v21
values/styles.xml should be as below.
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
....
// Your style here
</style>
values-v21/style.xml should be as below.
<style name="AppBaseTheme" parent="#android:style/Theme.Material.Light.DarkActionBar">
....
// Your style here
</style>
You can find different style attributes here https://developer.android.com/training/material/theme.html
After following above steps, your app will be ready with material design theme.
Now your second question regarding navigation drawer you can use following link for simple and step by step implementation.
Part 1 http://www.android4devs.com/2014/12/how-to-make-material-design-navigation-drawer.html4
Part 2 http://www.android4devs.com/2015/01/recycler-view-handling-onitemtouch-for.html
This implementation uses recycler view. For that you need to add recycler view lib (location - sdk\extras\android\support\v7) to your project and add it to build path.
You can develop apps with Material Design in Eclipse by using the libraries provided by google. You need to follow the below steps to do that.
Properties> Android> Add...>appcompat_v7
Add...> Android Design Support Library(You can import it from android-sdk\extras\android\support\)
Add...> RecycleViewLibrary & CardViewLibrary libraries for RecycleView and cardView, better material look and feel. (You can import it from android-sdk\extras\android\support\v7\)
Add/Edit values\styles.xml
<style name="MyMaterialTheme.Base" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
</style>
Change theme in AndroidManifest.xml file. android:theme="#style/MyMaterialTheme"
extend your Activity by AppCompatActivity.
Hope you can develop Material Designed apps in Eclipse throgh these steps.
Important: Support for the Android Developer Tools (ADT) in Eclipse is ending. You should migrate your app development projects to Android Studio as soon as possible.

Categories

Resources