Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android img fetch #5

Open
wants to merge 17 commits into
base: 4.14
Choose a base branch
from
2 changes: 2 additions & 0 deletions Config/FilterPlugin.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[FilterPlugin]
/Documentation/
Binary file added Documentation/MobileUtils_UserGuide.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 gameDNA
Copyright (c) 2017 gameDNA

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 7 additions & 5 deletions MobileUtils.uplugin
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.2.0",
"VersionName": "1.5.0",
"FriendlyName": "Mobile Utils",
"Description": "Additional utilities for mobile games",
"Category": "Misc",
"CreatedBy": "gameDNA",
"CreatedByURL": "http://gamednastudio.com",
"DocsURL": "https://github.com/gameDNAstudio/MobileUtils",
"MarketplaceURL": "",
"EngineVersion": "4.14.0",
"MarketplaceURL": "com.epicgames.launcher://ue/marketplace/content/94e8f674898a4589882c283436190676",
"EngineVersion": "4.16.0",
"SupportURL": "mailto:[email protected]",
"Modules": [
{
"Name": "MobileUtils",
"Type": "Runtime",
"LoadingPhase": "PostConfigInit"
"LoadingPhase": "PostConfigInit",
"WhitelistPlatforms": [ "Win64", "Win32", "Mac", "IOS", "Android" ]
}
],
"EnabledByDefault": true,
"CanContainContent": false,
"IsBetaVersion": false,
"Installed": false
"Installed": true,
"RequiresBuildPlatform": false
}
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

# Mobile Utils

The **Mobile Utils** plugin lets you integrate out-of-the-box mobile utitilites for iOS & Android into your [Unreal Engine 4](http://www.unrealengine.com) project.
**Mobile Utils** lets you integrate out-of-the-box mobile utilities for iOS & Android into an Unreal Engine 4 project. For example, it allows you to check an Internet connection and Google Play Services availability as well as get persistent Unique Device ID (you can identify users between application installations in order to, for example, store saved games in a cloud). This plugin is a mobile community initiative. Everyone can contribute and pull request with awesome new features to extend the editor and functionality of Unreal Engine 4.

* **Current version:** 1.2.0
* **Binaries compiled for:** Unreal Engine 4.14
* **Required Unreal Engine 4.14 or above.**
We want to make a big mobile plugin with many features from community so feel free to make pull request! After review, if all is good, it will be merged into plugin. Thank you! :-)

* **Current version:** 1.5.0
* **Binaries compiled for:** Unreal Engine 4.16
* **Required Unreal Engine 4.16 or above.**

## Features
* Checking internet connection availability
* Checking Google Play Services availability
* Getting persistent Unique Device ID
* Retrieving Auth Token from Online Subsystem
* Works with dev & shipping builds
* Out-of-the-box for iOS & Android
* Additional SDK included
Expand All @@ -27,19 +30,19 @@ Enable *Mobile Utils* in *Edit -> Plugins -> Misc -> Mobile Utils*.

![EnablePlugin](Resources/EnablePlugin.png)

#Recommended PR pipeline
# Recommended PR pipeline
* Write java and/or Obj-C code in Android Studio or XCode depending on the platform(s) you wish to add functionality to
* Test your code with a very simple app setup on your Android or iPhone
* Integrate your code to the plugin **without** creating an interface to blueprints
* Create a new sample project and test your code on a packaged project, at your desired device and platform
* If everything works correctly, perform a Pull Request
*

The reason that we prohibit you from creating a new blueprint node is to ensure cross platform compatibility as well as a uniform look and feel throughout the codebase. After your PR gets merged we will make sure that a new blueprint node is created if needed. We recommend trying to integrate your changes to the actual engine's master branch first and if your PR doesn't get merged, then resort to adding functionality to this plugin.

#Integration to the plugin
# Integration to the plugin
Here you will find the steps you need to take in order to add new functionality to this plugin.

##For Android
## For Android
At /Source/MobileUtils/MobileUtils_APL.xml,
Add your tested java code:

Expand All @@ -62,7 +65,7 @@ Continue your integration:

And now, some extra intel. Do not be afraid to open up the source of Unreal and look into the Android related parts of the system as well as pull requests that add features to the android part. You can find more information about JNI method signatures [here!](http://www.rgagnon.com/javadetails/java-0286.html)

##For iOS
## For iOS
At /Source/MobileUtils/Private/IOS/MobileUtilsPlatform.h,
Start integrating your code into the plugin:

Expand All @@ -74,7 +77,7 @@ Continue your integration:

In UE4 iOS specific code should be written in Objective-C. Remember you can mix C++ code with Objective-C code!

#Testing the plugin
# Testing the plugin
In order to test your changes, create a new project with your engine version of choise (although, it should be greater than our current minimum requirement~4.12),then clone the plugin at *Project Folder*/Plugins and then regenerate project files. The new folder "MobileUtils" should then be visible. After building the development editor you will be able to use code that you integrated or existing blueprint nodes. Note that this happens if you want to make a PR. If you are just looking to use the plugin, check the [releases](https://github.com/gameDNAstudio/MobileUtils/releases) page.

Plugin icon designed by _Freepik_.
Binary file modified Resources/Splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Source/MobileUtils/Classes/Interfaces/MobileUtilsInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#pragma once

#include "Runtime/Engine/Classes/Engine/Texture2D.h"


class IMobileUtilsInterface
{
Expand All @@ -28,4 +30,20 @@ class IMobileUtilsInterface
* @return - Unique Device ID
*/
virtual FString GetPersistentUniqueDeviceId();

/**
* Prompt user to select an image from gallery.
*
*
*/
virtual void SelectImage();

/**
* Return the path to user's selected image.
*
* @return - The full file path of the selected image.
*/
virtual FString GetImagePath();

virtual UTexture2D* GetImgTexture(float& Height, float& Width);
};
21 changes: 21 additions & 0 deletions Source/MobileUtils/Classes/MobileUtilsBlueprintLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#pragma once

#include "Kismet/BlueprintFunctionLibrary.h"
#include "Runtime/Engine/Classes/Engine/Texture2D.h"
#include "MobileUtilsBlueprintLibrary.generated.h"


Expand Down Expand Up @@ -36,4 +37,24 @@ class MOBILEUTILS_API UMobileUtilsBlueprintLibrary : public UBlueprintFunctionLi
*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category = MobileUtils)
static FString GetPersistentUniqueDeviceId();


/**
* Start intent to select image.
*
*
*/
UFUNCTION(BlueprintCallable, Category = MobileUtils)
static void SelectImage();

/**
* Return the path to the image that the user selected.
*
* @return - full path to the image user selected in gallery prompt.
*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category = MobileUtils)
static FString GetImagePath();

UFUNCTION(BlueprintCallable, Category = MobileUtils)
static UTexture2D* GetImgTexture(float& Height, float& Width);
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!--
Mobile Utils Plugin
Created by Patryk Stepniewski
Copyright (c) 2014-2016 gameDNA studio. All Rights Reserved.
Copyright (c) 2014-2017 gameDNA. All Rights Reserved.
-->
<root xmlns:android="http://schemas.android.com/apk/res/android">
<init>
Expand Down
7 changes: 7 additions & 0 deletions Source/MobileUtils/MobileUtils_UPL_IOS.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Mobile Utils plugin additions -->
<root xmlns:android="http://schemas.ios.com/res/ios">
<init>
<log text="Mobile Utils init"/>
</init>
</root>
Loading