Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Building SMTP client for Qt for Android target
Forum Updated to NodeBB v4.3 + New Features

Building SMTP client for Qt for Android target

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 851 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Phataas
    wrote on last edited by Phataas
    #1

    I am using the SMTP Client project to create a library file (.dll) on Windows. Everything works fine and e-mails are sent successfully.

    I want to port my Qt project to Android and since Android is a different architecture I need to build the library using a Android armv7 toolkit.

    I try this, but I get error:

    <Internal Error: Unknown Android deployment JSON file location. Error while building/deploying project SMTPEmail (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.4.2)) When executing step "Build Android APK">

    I suspect there is something I have to add/remove from the project file. I see there is a "win32:CONFIG += dll", but nothing similar for other platforms.

    The .pro files looks like this:

    #-------------------------------------------------
    #
    # Project created by QtCreator 2011-08-11T20:59:25
    #
    #-------------------------------------------------
    
    QT       += core network
    
    TARGET = SMTPEmail
    
    # Build as an application
    #TEMPLATE = app
    
    # Build as a library
    TEMPLATE = lib
    DEFINES += SMTP_BUILD
    win32:CONFIG += dll
    
    QMAKE_CXXFLAGS += -fPIC
    
    SOURCES += \
    src/emailaddress.cpp \
    src/mimeattachment.cpp \
    src/mimefile.cpp \
    src/mimehtml.cpp \
    src/mimeinlinefile.cpp \
    src/mimemessage.cpp \
    src/mimepart.cpp \
    src/mimetext.cpp \
    src/smtpclient.cpp \
    src/quotedprintable.cpp \
    src/mimemultipart.cpp \
    src/mimecontentformatter.cpp \
    
    HEADERS  += \
    src/emailaddress.h \
    src/mimeattachment.h \
    src/mimefile.h \
    src/mimehtml.h \
    src/mimeinlinefile.h \
    src/mimemessage.h \
    src/mimepart.h \
    src/mimetext.h \
    src/smtpclient.h \
    src/SmtpMime \
    src/quotedprintable.h \
    src/mimemultipart.h \
    src/mimecontentformatter.h \
    src/smtpexports.h
    
    OTHER_FILES += \
    LICENSE \
    README.md
    
    FORMS +=
    
    1 Reply Last reply
    0
    • Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      @Phataas It looks like you need the SMTP Client as a shared library compiled for the Android target architecture (it seems armv7 per your post). So step 1 is to build the SMTP Client as library for armv7. You're very likely need a cross-compile environment under Linux and installing the Android NDK, Once you have the resulting .so library, you need to put it in folder android/libs/armeabi-v7a under your project root folder, so the library file is deployed to the Android device along all other files.

      I've been using an external library with my Android app without any issues, given creating the .so file was straitghforward. See project PixelKnot about how they use the external library F5Android

      Good luck!

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved