Sometimes, client demand needs changes within the parent theme. However, if the parent theme file is modified directly, we’ll not be able to upgrade it within the future. This is because if we upgrade the parent theme version we will lose all the changes. By making a child theme, we’ll be able to retain our customization and additionally maintain each the original theme and also customized theme in separate folders.

What is a theme?

A design theme is an important part of Magento. The theme is a collection of files like styles, templates, images, Javascript etc which effects on your website look to catch the user’s eyes.

What is a child theme?

The child theme is a theme inherit all the properties from parent theme and can help to customize the present parent theme style as per our website demand.

How to create child theme in Magento 2?

All the following steps are used to create child theme in Magento 2.

Note: In this example,
‘Simbeez’ as vendor name and
‘luma’ as parent theme name.

Step-1: Create child theme folder named as {parent-theme-name}_child

Path:Magento root folder/app/design/frontend/{theme-vendor-name}/

{parent-theme-name}_child

Example:Magento root folder/app/design/frontend/Simbeez/luma_child

Child theme name can be anything whatever you want.But if the name refers parent theme name, it would be easily understandable and developer friendly.

Step-2: Create a file theme.xml inside the child theme to specify the parent theme inherited by the child theme

Note : In above code you can see <media> and <preview_image> tag , both are optional. It is used to display preview how your child theme looks like.If you don’t want to add you can write below code also.

While working on Magento, if you are in dilemma regarding the commands of Magento 2, here are few useful commands that will really help you to work on Magento flawlessly.

Let’s have a look at some helpful Magento 2 commands.

Run the following commands under root directory. For using these commands you will need to have SSH access to your server or else you can use the command line for local access.

Setup Upgrade Command :

php bin/magento setup:upgrade

When to use:

When you do some changes in Magento installation setup like change in default module files or create your own extension you need to use setup upgrade command.

Options:

[ --keep-generated ]When you don’t want to remove magento generated file ,this command is used to keep that files.

Example:

php bin/magento setup:upgrade --keep-generated

Cache Flush Command:

php bin/magento cache:flush

When to use:

Cache are generated automatically. In some configuration cache flush automatically and in some changes you have to flush cache from admin panel or using above command to remove default cache generated by Magento.

Cache Clear Command:

php bin/magento cache:clear

When to use:

It seems like cache:flush command but difference is flush remove default cache and clear remove all items of cache.

Indexer Reindex Command:

php bin/magento indexer:reindex

When to use:

After creating attribute set / newsletter / sitemap / confirm & transaction order / catalog price rule there is warning come like One or more Indexers are invalid that time use this command.

Deploy Mode Show Command:

php bin/magento deploy:mode:show

When to use:

Magento provide 3 types of mode: Production , Developer , Default . Each mode have its own purpose so you have to check in which mode you are working for developing.

Set Developer Mode Command:

php bin/magento deploy:mode:set developer

When to use:

In developer mode some static files create automatic or it take from it’s parent so it is helpful while you are developing customization or extensions.

Set Production Mode Command:

php bin/magento deploy:mode:set production

When to use:

In production mode static files are not generated automatically. So SEO purpose this command is used.

Static Content Deploy Command:

php bin/magento setup:static-content:deploy

When to use:

When you do some changes in magento static files like css,js files you have to deploy it using this command.

if you want to deploy specific theme or language then you can use below

]]>https://simbeez.com/magento-2/magento-2-useful-commands/feed/0Flutter – Cross platform Mobile UIhttps://simbeez.com/android/flutter-cross-platform-mobile-ui/
https://simbeez.com/android/flutter-cross-platform-mobile-ui/#respondSat, 10 Mar 2018 11:36:44 +0000http://simbeez.com/?p=23401What is Flutter? Flutter is Google’s mobile UI framework for crafting high-quality native interfaces on iOS and Android in record time. Flutter works with existing code, is used by developers and organizations around the world, and is free and open...

Flutter is Google’s mobile UI framework for crafting high-quality native interfaces on iOS and Android in record time. Flutter works with existing code, is used by developers and organizations around the world, and is free and open source.

Why to use Flutter?

Be Highly Productive

-Develop Android and iOS app using single codebase.

-Do more with less code, even on a single OS, with a modern, expressive language and a declarative approach.

Morden, Reactive Framework

-Flutter can easily create UI with modern reactive framework and rich set of platform, layout and widgets. Solve your tough UI challenges with powerful and flexible APIs for 2D, animation, gestures, effects, and more.

SDK’s and Native Features Access

-Using Flutter, you can also use the native code 3rd party Sdk, APIs. Flutter lets you reuse your existing Java, Swift, and ObjC code, and access native features and SDKs on iOS and Android.

Step 1 : Download the Flutter SDK

You can clone the beta branch of the repository, then add the Flutter tool in your path.

$git clone -b beta https://github.com/flutter/flutter.git

Step 2: Set Flutter path

You can set Flutter path temporarily as well as permanently. Below command is used to set the temporary path, for the current terminal window.

$ export PATH= pwd /flutter/bin:$PATH

To add Flutter permanently to your path, follow the below steps:

export PATH=[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin:$PATH

Run source $HOME/.bash_profile to refresh the current window.

Verify that the flutter/bin directory is now in your PATH by running:

$ echo $PATH

Step 3: Check Flutter Configuration

$flutter doctor

The above command is used to check for any dependencies need to the complete setup. When you run the doctor command for the first time, it will download its own dependency and compile itself. When you run the command, it will display the following output in your cmd screen.

Step 4: Set up your Android device

To run and test your Flutter app on an Android device, you’ll need an Android device running Android 4.1 (API level 16) or higher. By default, Flutter uses the version of the Android SDK where your adb tool is based.

Connect your device using the USB cable and turn on USB Debugging option. Run the command flutter devices to display the connected device list in terminal. Thereby, to run your app type flutter run command.

Taken reference from:

]]>https://simbeez.com/android/flutter-cross-platform-mobile-ui/feed/0How to Debug Android app over WiFihttps://simbeez.com/android/how-to-debug-android-app-over-wifi/
https://simbeez.com/android/how-to-debug-android-app-over-wifi/#respondMon, 09 Oct 2017 14:43:02 +0000http://simbeez.com/?p=23119The post How to Debug Android app over WiFi appeared first on SimBeez.
]]>

We mostly connect Android device to computers with a USB cable for debugging purposes. It is better to use adb over a wifi connection than a USB to save some wire-related hassles in our lives and many a times device is disconnected when we debug the app.

There is a simple way to connect Android devices to our computer. You will be needing a USB cable (for the initial setup) and make sure that both the devices should be on the same network. For connecting Android devices to your computer, follow the below steps.

Step 1 Connect your device on the same Wifi network:

You need to connect your device to your computer via USB cable. Make sure that the USB debugging is working; also your adb host computer and Android device must be on the same Wifi network.

Step 2 Get the list of connected devices :

Connect the Android device to the computer using your USB cable. After doing this, your device will be detected by your host computer. Also, adb will start running in the USB mode on the computer. You can check the attached devices with the command: adb devices and make sure that the adb is running in the USB mode by executing the command: adb usb. You can write command in terminal or cmd.

You can get the connected list of devices using the below command.

$ adb devices

List of devices attached

ZX1D63HX9R device

Step 3 Restart TCP Mode:

Write the below command to restart adb in tcpip mode.

$ adb tcpip 5555

restarting in TCP mode port: 5555

Step 4 Find IP address from mobile device:

Find out the IP address of the Android device:

Go to phone Settings -> About phone/tablet -> Status -> IP address

Step 5 Connect device to Computer:

Now you are aware about the IP address of your device; connect your adb host to it. You can connect your device using the below command.

$ adb connect 192.168.0.102

connected to 192.168.0.102:5555

Step 6 Re-connecting the device to your computer:

Remove the USB cable and you will be connected to your device. Now check whether the device is connected or not through this command: adb devices; if you do not see your device connected, then just reconnect it using the previous step’s command.

Now your device is successfully connected to your computer. Hence, you can debug the app in your connected device.

Step 7 Disconnecting the device to your computer:

For disconnecting the connected device, write the below command:

$ adb disconnect 192.168.0.102

Conclusion :

On continuous usage of connecting your Android phone to the computer system using USB cable, there are chances of damaging the phone battery as well as the USB cable due to continuous charging of battery while the cable is attached. Also, it will be quite difficult for us to use our phone for debugging various apps especially the sensor based apps when the mobile is connected with the USB.

So debugging apps over wifi is very useful. It saves the batteries and cables; also makes debugging the sensor based apps easier. Hence, just follow the above steps and debug your Android apps over Wifi.

]]>https://simbeez.com/android/how-to-debug-android-app-over-wifi/feed/0How to work with BLE (Bluetooth Low Energy) Devices on Androidhttps://simbeez.com/android/how-to-work-with-ble-bluetooth-low-energy-devices-on-android/
https://simbeez.com/android/how-to-work-with-ble-bluetooth-low-energy-devices-on-android/#commentsSun, 03 Sep 2017 11:27:31 +0000http://simbeez.com/?p=22966The post How to work with BLE (Bluetooth Low Energy) Devices on Android appeared first on SimBeez.
]]>

Bluetooth is one of the most used technology when the connection has to be established with a remote device. But this technology has a major limitation high battery consumption. Therefore an upgrade version of this technology with low energy consumption was introduced, called BLE (Bluetooth Low Energy).

Android 4.3 (API level 18) introduces built-in platform support for Bluetooth Low Energy (BLE) in the central role and provides APIs that apps can use to discover devices, query for services, and transmit information. (Android Developers Doc)
This allows Android applications to communicate with BLE devices that have stricter power requirements, such as proximity sensors, heart rate monitors, fitness devices, home Automation System, Medical services and the Automotive industry.

BLE Concepts:

These are the few concepts to understand in BLE which is used to easily communicate with other devices.

GATT Profile

GATT stands for Generic Attribute Profile. All devices implement one or more Profile.The profile is a specification for how a device works in a particular application.GATT is a general specification for sending and receiving short pieces of data (known as attributes) over the low energy link.

Attribute Protocol

GATT is built on top of the Attribute Protocol. This is also referred to as GATT/ATT. Attribute Protocol (ATT) is optimized to run on BLE devices. To this end, it uses as few bytes as possible. Each attribute is uniquely identified by a Universally Unique Identifier (UUID). Which is the standardized 128-bit format for a string ID used to uniquely identify information. The attribute transported by ATT formatted as characteristics and service.

Characteristic

A Characteristic is a data value transferred between client and server. A characteristic contains a single value and 0-n describes the characteristic value. A characteristic can be thought as a type, analogous to a class.

Descriptor

A service is a group of characteristics that operate together to perform a specific function. Many devices implement the Device Information Service. This service is made up of characteristics such as manufacturer name, model name, and firmware revision.

Implementation of Bluetooth Low Energy (BLE):

First of all, create a new project in the android studio.

File – > New – > New Project.

Please select the API level 18 Because it can not used old device due to change of the Bluetooth specification.Please specify the SDK version 18 in your app.

Bluetooth Low Energy (BLE) permission in App:

If you want to use, manipulate and discover the Bluetooth setting you must also declare the BLUETOOTH_ADMIN permission in you project manifest file.You must include the BLUETOOTH permission in your manifest file due to use permission BLUETOOTH_ADMIN.

If your app contains the BLE features than declaring the below permission in manifest file.

You can check device is supported the BLE or not. Then you can disable the related feature in the app.

To Find the Bluetooth Devices:

To find BLE devices, you use the startLeScan() method. This method takes BluetoothAdapter.LeScanCallback as a parameter. You must implement this callback, because that is how scan results are returned.

Connecting to a GATT Server

Every BLE device has owned GATT profile through which they can act as a server. Like all network devices, Bluetooth LE also works in a client/server manner. The above step is used for getting a list of BLE enabled devices. now we want to connect other device using the GATT server. To connect to a GATT server on a BLE device, you use the connectGatt() method. This method takes three parameters: a Context object, autoConnect (boolean indicating whether to automatically connect to the BLE device as soon as it becomes available), and a reference to a BluetoothGattCallback.

This BluetoothGattCallback connects to the GATT server hosted by the BLE device, and returns a BluetoothGatt instance, which you can then use to conduct GATT client operations. The caller (the Android app) is the GATT client. The BluetoothGattCallback is used to deliver results to the client, such as connection status, as well as any further GATT client operations.

onConnectionStateChange:

Callback indicating when a remote device has been connected or disconnected.

onServicesDiscovered:

Callback invoked when the list of remote services, characteristics and descriptors for the remote device have been updated, ie new services have been discovered.

onCharacteristicRead:

Callback reporting the result of a characteristic read operation.

Conclusion

The Above example is use for scanning list of BLE (Bluetooth Low Energy) devices and discover their services and read the basic characteristics of it. BLE which is used to easily communicate with other devices. BLE ( Bluetooth Low Energy ) take very low power Consumption So Now a days Bluetooth Low Energy is using hug Android devices, Home Automation System, Medical services and Automotive industry.

]]>https://simbeez.com/android/how-to-work-with-ble-bluetooth-low-energy-devices-on-android/feed/1What is Kotlin?https://simbeez.com/android/what-is-kotlin/
https://simbeez.com/android/what-is-kotlin/#respondMon, 15 Sep 2014 12:29:20 +0000http://zephyr.us-themes.com/this-is-a-sticky-post/What is Kotlin? Kotlin is a statically-typed programming language that runs on the Java Virtual Machine and also can be compiled with JavaScript source code or uses the LLVM compiler infrastructure. It is primarily developed by a team of JetBrains...

Kotlin is a statically-typed programming language that runs on the Java Virtual Machine and also can be compiled with JavaScript source code or uses the LLVM compiler infrastructure. It is primarily developed by a team of JetBrains programmers based in Saint Petersburg.

Why Kotlin?

Kotlin is aimed at eliminating the danger of null references from code.

Kotlin compiles to JVM bytecode or JavaScript.

It imposes no runtime overhead.

The standard library is small and tight, it consists mostly of focused extensions to the Java standard library.

One of Kotlin’s greatest strengths as a potential alternative to Java is the sheer level of interoperability between Java and Kotlin—you can even have Java and Kotlin code existing side by side in the same project, and everything will still compile perfectly. Below, you can see an example of a project that consists of a Java Activity and a Kotlin Activity.

How to configure Kotline in Android Studio

Step 1: Setup the Kotlin Plugin in Android Studio

In order to ensure Android Studio support Kotlin, the first thing is to install the Kotlin Plugin for your Android Studio.Android Studio → Configuration → Plugins →Install JetBrains Plugins → type “Kotlin” in search box →install

That’s all the generically applied to your Android Studio. Only needed to do once per installation of Android Studio.

Now restart the android Studio.Aftet create a new android project and fill all the required Detail. File -> New -> android project.

Step 2: Add Kotlin classpath to project Build.Gradle

To configure the plugin, we first need to add the plugin to the root, project’s build.gradle, Same way it’s done for the Gradle plugin (automatically). Add the plugin to the dependencies closure in the project build.gradle file. The project build.gradle file looks like this:
buildscript
{ext.kotlin_version = "1.0.6" // replace with the latest (stable) version: https://github.com/JetBrains/kotlin/releases/latest
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}