appcelerator titanium - how do i make button text lowercase? - appcelerator

I know that for whatever reason google decided to make all button text capitalised in lollipop.
How do I set it in my appcelerator app that all my button text is not uppercase, but just however I typed it?

All you need is to define a android values under
/app/platform/android/res/values.xml
<resources>
<style name="Theme.myTheme" parent="#style/Theme.AppCompat.NoActionBar">
<item name="android:buttonStyle">#style/customButton</item>
</style>
<style name="customButton" parent="Widget.AppCompat.Button">
<item name="android:textAllCaps">false</item>
</style>
Add android theme to manifest (Theme.myTheme):
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<supports-screens android:anyDensity="false"
android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera"/>
<uses-feature android:name="android.hardware.camera.autofocus"/>
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23"/>
<application android:debuggable="true"
android:icon="#drawable/appicon"
android:largeHeap="true" android:theme="#style/Theme.myTheme">
<activity
android:configChanges="keyboardHidden|orientation|screenSize" android:name="org.appcelerator.titanium.TiActivity"/>
</application>
</manifest>
</android>

Why do you need to use a button and depend on the system's default layout?
You could just use a View instead and listen to the click event.
You could style the view as you wish and it would look the same across different platforms.

Related

How to correctly set windowDrawsSystemBarBackgrounds in XF5?

We've been upgrading our application to Xamarin.Forms 5 and it's unclear how to correctly set the AppCompat theme now that we've migrated to the AndroidX package. When using
<style name="MyTheme.ActionBarAppCompat" parent="#android:style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
</style>
I get error APT2260: resource android:style/Theme.AppCompat.Light.DarkActionBar not found.
If I remove the android: the application compiles, but the navigation bar overlaps controls on the page.
I couldn't see the full code of your styles.xml, but I tried to create a simple xamarin android app with the latest vertion of nuget Xamarin.Androidx.AppCompat.
The default code of file styles.xml is:
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
Note:You can compare it to your code. If the problem still exists after correction, you can post the code of your styles.xml here.

Develop an Android Auto custom app

I'm an Android developer and I'm trying to develop a custom Android Auto app, that does a simple mirroring of the phone screen.
I know that currently the API are only available for music and messaging apps, but I would write an app for mirror a simple "hello world".
I follow the Google Getting Started tutorial and I'm using the Desktop Head Unit (DHU) provided by Google (at developer.android.com/training/auto/testing/index.html)
but when I tap last button on the bottom of the display and select "All car apps", my application doesn't appear on the list.
All car apps
For example, if Android Auto is launched in a Samsung tablet (SM-T555), the DHU lists these app:
com.google.android.gms, Maps, System UI, Video, SampleAuthenticatorService, SecureSampleAuthService, Screen capture, Android Auto, Phone, Media, Return to Google, Samsung Billing, Google App, Google Play Music, Music
Available Car Apps in a Samsung Tablet
How can I make an app that is displayed on the available app list in Android Auto? Is possible do mirroring for a custom app in Android Auto?
Create a service like this:
public class HelloWorldService extends CarActivityService {
#Override
public Class<? extends CarActivity> getCarActivity() {
return HelloWorldAutoActivity.class;
}
}
Then add the service to your manifest like this:
<meta-data
android:name="com.google.android.gms.car.application"
android:resource="#xml/automotive_app_desc" />
<service
android:name=".HelloWorldService"
android:exported="true"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.google.android.gms.car.category.CATEGORY_PROJECTION" />
<category android:name="com.google.android.gms.car.category.CATEGORY_PROJECTION_OEM" />
</intent-filter>
</service>
Finally create a xml file called automotive_app_desc under your res folder:
<automotiveApp>
<uses name="service" />
<uses name="projection" />
<uses name="notification" />
</automotiveApp>
Your HelloWorldAutoActivity.class will work as your MainActivity.
Android auto not customized. some api (audio, map, contacts) are same, customized.but you can dolittle things. pls check this
https://github.com/Mutesham/AndroidAuto_TextApp
In order to have app displayed on the Auto. You will have to upload it to playstore on beta channel.
The Main Activity File
The main activity code is a Java file MainActivity.java. This is the actual application file which ultimately gets converted to a Dalvik executable and runs your application. Following is the default code generated by the application wizard for Hello World! application −
package com.example.helloworld;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
The Manifest File
Whatever component you develop as a part of your application, you must declare all its components in a manifest.xml which resides at the root of the application project directory. This file works as an interface between Android OS and your application, so if you do not declare your component in this file, then it will not be considered by the OS. For example, a default manifest file will look like as following file −
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.tutorialspoint7.myapplication">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The Strings File
The strings.xml file is located in the res/values folder and it contains all the text that your application uses. For example, the names of buttons, labels, default text, and similar types of strings go into this file. This file is responsible for their textual content. For example, a default strings file will look like as following file −
<resources>
<string name="app_name">HelloWorld</string>
<string name="hello_world">Hello world!</string>
<string name="menu_settings">Settings</string>
<string name="title_activity_main">MainActivity</string>
</resources>
The Layout File
The activity_main.xml is a layout file available in res/layout directory, that is referenced by your application when building its interface. You will modify this file very frequently to change the layout of your application. For your "Hello World!" application, this file will have following content related to default layout −
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:padding="#dimen/padding_medium"
android:text="#string/hello_world"
tools:context=".MainActivity" />
</RelativeLayout>

How to show application name in windows tiles in windows phone uwp

How to show the application name in the tiles.
As shown in the figure, i am developing the last application in the screen. For that i need to show the name of the application.
In PackageManifest file i have added all the images to show the images in the home screen.
Any help on this highly appreciated.
Thank you.
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="MMRevamp_2016.App">
<uap:VisualElements DisplayName="Maalaimalar" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="MMRevamp_2016" BackgroundColor="transparent">
<uap:LockScreen Notification="badge" BadgeLogo="Images\BadgeLogo.png" />
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Images\Square142x142Logo.png" Square310x310Logo="Images\Square310x310Logo.png">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square310x310Logo" />
</uap:ShowNameOnTiles>
</uap:DefaultTile>
</uap:VisualElements>
</Applications>
If you open your Package.appxmanifest and go to Visual Assets, you will see show name with check boxes. Check off appropriate box next to your asset.
See Screenshot for Example
If you are doing XML you can set the branding attribute to "name" as well. E.g like this:
<tile>
<visual>
<binding template="TileMedium" branding="name">
</binding>
</visual>
</tile>

Xamarin android, how to make navigation bar back button bigger and change color?

I am using Xamarin forms, but I want to make navigation-bar back button only for android project. I simply want make it bigger and change color of it. What would be the best way to do it? Thank you for any answers or suggestions.
As #Rohit mentioned you will need a to customize the action bar inside the styles.xml which is inside the values folder inside the Resourses folder of your android project, James Montemagno did a blog post related to that when he introduce the FormsAppCompatActivity an example of a cuztom nav bar would be like this:
<style name="AppMainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">#0063a4</item>
<item name="colorPrimaryDark">#003A63</item>
<item name="colorAccent">#86c447</item>
<item name="android:windowBackground">#color/AppBackgroundColor</item>
<item name="windowActionModeOverlay">true</item>
<item name="android:datePickerDialogTheme">#style/AppCompatDialogStyle</item>
</style>
And the blog post is here: https://blog.xamarin.com/android-tips-hello-toolbar-goodbye-action-bar/
In regards of navigation bar height it may involved more cuztomization and a custom view inside the Navigation Bar, here is an android example:
https://guides.codepath.com/android/Using-the-App-ToolBar

I can not let my app available on market of honeycomb(xoom)

I have an app, and I have changed this app according to tutorial of
google as http://developer.android.com/guide/practices/optimizing-for-3.0.html.
this is my mainfest xml:
<uses-permission android:name="android.permission.INTERNET" />
<!--uses-permission
android:name="android.permission.READ_PHONE_STATE"/-->
<uses-permission android:name="android.permission.READ_CONTACTS" /
>
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="11"/>
<supports-screens
android:resizeable="true"
android:anyDensity="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
/>
.............
...........
after I upload it to google market.
I can see it at htc dream, magic, nexus one, desire-z, samsung galaxy
tab.
when I borrow an XOOM to install app. I found I can not see the app,
even if I look for its name or similar words, the result is nothing.
and I have searched for long time, but I can not get answer.
any answer will be appreciated so much!
I'm not sure if you're having this issue still, but I had the same problem. I had to setup licensing instead of copy protection on the market. You need to add the licensing library and a little code to your project but it's pretty simple, step by step guide is in google's documentation: http://developer.android.com/guide/publishing/licensing.html
And also check your uses, phone options will not work on the Xoom I believe, I had maybe 2 permissions and it was driving me nuts why it wouldn't show on the Xoom. Because the Xoom doesn't have sd card support yet it relies on internal storage and because of permissions the copy protection doesn't work so you must use licensing. Hope this helps.
also check that if you are using uses-feature in the manifest that it's supported on the xoom (btw your manifest is not viewable)

Resources