







Here i share my Android , React-Native , Kotlin coding knowledge for Android Beginner, Android Users, Android Developer. Kotlin android learners, React-Native learners. Also Support for Application developers with code suff to create applications.
AuroInfoSoft built the Merry Christmas app as a Free app. This SERVICE is provided by AuroInfoSoft at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Merry Christmas unless otherwise defined in this Privacy Policy.
Information Collection and Use
For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information. The information that I request will be retained on your device and is not collected by me in any way.
The app does use third party services that may collect information used to identify you.
Link to privacy policy of third party service providers used by the app
Log Data
I want to inform you that whenever you use my Service, in a case of an error in the app I collect data and information (through third party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing my Service, the time and date of your use of the Service, and other statistics.
Cookies
Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's internal memory.
This Service does not use these “cookies” explicitly. However, the app may use third party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.
Service Providers
I may employ third-party companies and individuals due to the following reasons:
I want to inform users of this Service that these third parties have access to your Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose.
Security
I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security.
Links to Other Sites
This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.
Children’s Privacy
These Services do not address anyone under the age of 13. I do not knowingly collect personally identifiable information from children under 13. In the case I discover that a child under 13 has provided me with personal information, I immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact me so that I will be able to do necessary actions.
Changes to This Privacy Policy
I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page. These changes are effective immediately after they are posted on this page.
Contact Us
If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at divyataptel27988@gmail.com.
This privacy policy page was created at privacypolicytemplate.net and modified/generated by App Privacy Policy Generator
<TextView
android:text="@{pojomodel.userName}" />
do in build.gradle file
android {
...
dataBinding { enabled = true}
}-> in Details under stand like below
-> Create Pojo class.
package com.t.databinding; public class Pojomodel { private String mid; private String strname; public String getMid() { return mid; } public void setMid(String mid) { this.mid = mid; } public Pojomodel(String id, String name) { this.mid = id; this.strname = name; } public String getName() { return strname; } public void setName(String name) { this.strname = name; } }-> Create Layout file like
<?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"><!--Step 1-->
<data><!--Step 2-->
<variablename="Pojomodel"type="com.t.databinding.Pojomodel" /></data>
<LinearLayout
android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"android:padding="16dp"tools:context="com.androidbytes.databindingdemo.MainActivity"><!--Step 3-->
<TextViewandroid:id="@+id/text_id"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="@{Pojomodel.mid}"android:textColor="@android:color/black"android:textSize="26sp" /><TextView
android:id="@+id/text_view_name"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="@{Pojomodel.name}"android:textColor="@android:color/black"android:textSize="18sp" /></LinearLayout>
</layout>
-> Create MainActivity
package com.t.databinding; import androidx.appcompat.app.AppCompatActivity; import androidx.databinding.DataBindingUtil; import android.os.Bundle; import com.t.databinding.databinding.ActivityMainBinding; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // After Data BindingActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main); Pojomodel personVO = new Pojomodel("#1","Abc "); binding.setPojomodel(personVO); } }-> Data Binding Use in Application improve app performance , handle null pointer exception,
prevent from memory leak
-> Thanks this detail will help full to you for understand about Data Binding usage in Android Application.
@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_main);
Done , above one line code in bold font we have to declare for window full screen.
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginTop="@dimen/d_10dp"
android:layout_marginBottom="@dimen/d_10dp"> <VideoView
android:id="@+id/videoview"
android:layout_width="match_parent"
android:layout_height="200dp" /> </RelativeLayout>
Now add below code in MainActivity.java
VideoView videoView;
MediaController mediaControls;
in onCreateView method add below code
videoView = (VideoView)view.findViewById(R.id.videoview);add below code where you want to play video
String FullVideopath = "Here is your video path";
videoView.setVideoPath(FullVideopath);mediaControls = new MediaController(mcontext); mediaControls.setAnchorView(videoView);videoView.setMediaController(mediaControls);videoView.start();
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { mp.setOnVideoSizeChangedListener(new MediaPlayer.OnVideoSizeChangedListener() { @Override public void onVideoSizeChanged(MediaPlayer mp, int width, int height) { videoView.setMediaController(mediaControls); mediaControls.setAnchorView(videoView); } }); } });viewvideoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mp) { Toast.makeText(mcontext, "Video over...!!!", Toast.LENGTH_LONG).show();} }); videoView.setOnErrorListener(new MediaPlayer.OnErrorListener() { @Override public boolean onError(MediaPlayer mp, int what, int extra) { Toast.makeText(mcontext, "Oops An Error Occur While Playing Video...!!!",Toast.LENGTH_LONG).show();
return false; } });}
do this process in Your Class
String result = "Your Json Resonse" ; List<MUsers> mUsers = null; try { Gson gson = new Gson(); Type type = new TypeToken<List<MUsers>>(){}.getType(); mUsers = gson.fromJson(result, type); } catch (JsonSyntaxException e) { e.printStackTrace(); }
public class MUsers{ @SerializedName("USR") @Expose private String usr; public void setUSR(String usern) { this.usr = usern; } public String getUSR() { return usr; } }
Here in your build.gradle file need to add supportive library to parse this data
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item >
<layer-list>
<item>
<shape>
<stroke android:width="1dp" android:color="#dddddd" />
<padding android:bottom="3dp" android:left="3dp" android:right="3dp" android:top="3dp"/>
<solid android:color="#FFFFFF" />
</shape>
</item> <item ><bitmap android:gravity="right|center" android:src="@mipmap/ic_downarrow" /> </item> </layer-list></item> </selector>
here you need to set ic_downarrow image in mipmap folder as per you need design. will look in Spinner
right side this image.
Now in your layout,xml file with Spinner item do set this xml file to display costume spinner background
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<Spinner
android:id="@+id/spnitem"
android:layout_width="200dp"
android:layout_gravity="center_horizontal"
android:layout_height="@dimen/editext_size"
android:overlapAnchor="false"
android:textSize="@dimen/reg_text_size"
android:background="@drawable/spinner_background" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="yourpackageName">
<uses-permission android:name="android.permission.CAMERA"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
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> <meta-data android:name="com.google.android.gms.vision.DEPENDENCIES"
android:value="ocr"/> </application> </manifest>
dependencies {
compile 'com.google.android.gms:play-services-vision:11.0.4'}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="vertical"
android:weightSum="5"
tools:context="Yourpackage.MainActivity">
<SurfaceView
android:id="@+id/surfaceView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4" />
<TextView
android:id="@+id/text_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="8dp"
android:layout_weight="1"
android:gravity="center"
android:textStyle="bold"
android:background="@drawable/mboarder"
android:text="@string/txt_message"
android:textColor="@android:color/black"
android:textSize="20sp" />
<Button
android:id="@+id/btnShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Share"
android:textAllCaps="false"
android:background="@color/colorAccent"
android:layout_marginBottom="5dp"
android:textColor="@android:color/white"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
MainActivity.java
package your.packageNamehere; import android.Manifest; import android.content.Intent; import android.content.pm.PackageManager; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.util.SparseArray; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.widget.Button; import android.widget.TextView; import com.google.android.gms.vision.CameraSource; import com.google.android.gms.vision.Detector; import com.google.android.gms.vision.text.TextBlock; import com.google.android.gms.vision.text.TextRecognizer; import java.io.IOException; public class MainActivity extends AppCompatActivity { SurfaceView mCameraView; TextView mTextView; CameraSource mCameraSource; private static final String TAG = "MainActivity"; private static final int requestPermissionID = 101; Button btnShare; String ReadString; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mCameraView = findViewById(R.id.surfaceView); mTextView = findViewById(R.id.text_view); btnShare = findViewById(R.id.btnShare); btnShare.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_TEXT,ReadString); sendIntent.setType("text/plain"); startActivity(sendIntent); } }); startCameraRead(); } @Overridepublic void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (requestCode != requestPermissionID) { Log.d(TAG, "Got permission result" + requestCode); super.onRequestPermissionsResult(requestCode, permissions, grantResults); return; } if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { try { if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) { return; } mCameraSource.start(mCameraView.getHolder()); } catch (IOException e) { e.printStackTrace(); } } } private void startCameraRead() { final TextRecognizer ReadText = new TextRecognizer.Builder(getApplicationContext()).build();if (!ReadText.isOperational()) { Log.w(TAG, "Detector yet not allow "); } else {mCameraSource = new CameraSource.Builder(getApplicationContext(), ReadText) .setFacing(CameraSource.CAMERA_FACING_BACK) .setRequestedPreviewSize(1280, 1024) .setAutoFocusEnabled(true) .setRequestedFps(2.0f) .build();mCameraView.getHolder().addCallback(new SurfaceHolder.Callback() {@Override public void surfaceCreated(SurfaceHolder holder) { try { if (ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.CAMERA}, requestPermissionID); return; } mCameraSource.start(mCameraView.getHolder()); } catch (IOException e) { e.printStackTrace(); } } @Overridepublic void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { } @Overridepublic void surfaceDestroyed(SurfaceHolder holder) { mCameraSource.stop(); } }); ReadText.setProcessor(new Detector.Processor<TextBlock>() {@Overridepublic void release() { } @Overridepublic void receiveDetections(Detector.Detections<TextBlock> detections) { final SparseArray<TextBlock> items = detections.getDetectedItems(); if (items.size() != 0 ){ mTextView.post(new Runnable() { @Override public void run() { StringBuilder stringBuilder = new StringBuilder(); for(int i=0;i<items.size();i++){ TextBlock item = items.valueAt(i); stringBuilder.append(item.getValue()); stringBuilder.append("\n"); } mTextView.setText(stringBuilder.toString()); ReadString = stringBuilder.toString(); } }); } } }); } } }
In Kotlin, determining the difference in hours between two timestamps is a common task, especially in scenarios involving time-based calcu...